Page MenuHomeFeedback Tracker

Flashlight quadratic attenuation does not work
Feedback, NormalPublic

Description

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.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Config
Steps To Reproduce

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

dedmen changed the task status from New to Feedback.Wed, Mar 15, 12:10 PM
dedmen added a subscriber: dedmen.

dev next week, rev 150345

dedmen claimed this task.Wed, Mar 15, 12:10 PM
dedmen set Ref Ticket to AIII-55585.

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