ACE3/addons/irlight/dev/createTestLight.sqf
BaerMitUmlaut d6faac5881
Add IR Flashlights (#6563)
* Initial IR flashlight tests

* More experiments

* Rewrite using engine IR lights

* Rework ranges, fix bugs, add docs

* Fix uncommented DISABLE_COMPILE_CACHE

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Use baseWeapon instead of custom property

* Add baseWeapon to SPIR

---------

Co-authored-by: jonpas <jonpas33@gmail.com>
2023-09-17 09:32:39 +02:00

43 lines
1.3 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Creates a scripted test light to test weapon lights without reloading.
*
* Arguments:
* 0: Flashlight class name <STRING>
*
* Return Value:
* None
*
* Example:
* "ACE_SPIR" call compile preprocessFileLineNumbers "\z\ace\addons\irlight\dev\createTestLight.sqf"
*
* Public: No
*/
params ["_className"];
private _cfg = configFile >> "CfgWeapons" >> _className >> "ItemInfo" >> "Flashlight";
deleteVehicle lgt;
lgt = "#lightreflector" createVehicleLocal [0, 0, 0];
lgt attachTo [player, [0.0396804,0.237947,0.104276], "proxy:\a3\characters_f\proxies\weapon.001", true];
lgt setLightIntensity getNumber (_cfg >> "intensity");
lgt setLightColor (getArray (_cfg >> "color") select [0, 3]);
lgt setLightAmbient (getArray (_cfg >> "ambient") select [0, 3]);
lgt setLightConePars [
getNumber (_cfg >> "outerAngle"),
getNumber (_cfg >> "innerAngle"),
getNumber (_cfg >> "coneFadeCoef")
];
attenuation = [
getNumber (_cfg >> "Attenuation" >> "start"),
getNumber (_cfg >> "Attenuation" >> "constant"),
getNumber (_cfg >> "Attenuation" >> "linear"),
getNumber (_cfg >> "Attenuation" >> "quadratic"),
getNumber (_cfg >> "Attenuation" >> "hardLimitStart"),
getNumber (_cfg >> "Attenuation" >> "hardLimitEnd")
];
lgt setLightAttenuation attenuation;