When using just quadratic attenuation for a Flashlight it has no effect and seems to be fixed to 1. This was found by comparing it to a scripted light cone using #lightreflector.
Description
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Category
- Config
The following config should increase the range of the weapon flashlight, but it results in a fairly dim light.
class CfgWeapons { class ItemCore; class InventoryFlashlightItem_Base_F; class acc_flashlight: ItemCore { class ItemInfo: InventoryFlashlightItem_Base_F { class Flashlight { class Attenuation { constant = 0; linear = 0; quadratic = 0.001; start = 1; hardLimitStart = 1000; hardLimitEnd = 1000; }; }; }; }; };
The expected flashlight can be attached to the player using this code:
private _cfg = configFile >> "CfgWeapons" >> "acc_flashlight" >> "ItemInfo" >> "Flashlight"; private _light = "#lightreflector" createVehicleLocal [0, 0, 0]; _light attachTo [player, [0, 0, 0], "proxy:\a3\characters_f\proxies\weapon.001", true]; _light setLightIntensity getNumber (_cfg >> "intensity"); _light setLightColor (getArray (_cfg >> "color") select [0, 3]); _light setLightAmbient (getArray (_cfg >> "ambient") select [0, 3]); _light setLightConePars [ getNumber (_cfg >> "outerAngle"), getNumber (_cfg >> "innerAngle"), getNumber (_cfg >> "coneFadeCoef") ]; _light setLightAttenuation [ getNumber (_cfg >> "Attenuation" >> "start"), getNumber (_cfg >> "Attenuation" >> "constant"), getNumber (_cfg >> "Attenuation" >> "linear"), getNumber (_cfg >> "Attenuation" >> "quadratic"), getNumber (_cfg >> "Attenuation" >> "hardLimitStart"), getNumber (_cfg >> "Attenuation" >> "hardLimitEnd") ];
Event Timeline
This change will affect vanilla flashlight attachments:
acc_flashlight has quadratic 0.2
acc_flashlight_pistol 0.2
arifle_AKM_FL_F 1.1
acc_esd_01_flashlight 0.2
Previously these were ignored, now they will take affect and probably change their range. We might change the configs for these
I noticed this fixes problem when light from player1's flashlight is different for player2
i.e. the light on player1 was less intense than when another player is looking at him from the other side
But now when player1 turns on flashlight, for player2 its light becomes brighter for a few seconds and only then returns to normal
see YT demonstration video
I checkd this in current dev 150668 build on dedicated server