2015-12-07 16:24:52 +00:00
|
|
|
/*
|
|
|
|
Author: Aaron Clark - EpochMod.com
|
|
|
|
|
2016-06-20 15:58:31 +00:00
|
|
|
Contributors: Andrew Gregory
|
2015-12-07 16:24:52 +00:00
|
|
|
|
|
|
|
Description:
|
|
|
|
setup nightlight to provide improved night vision
|
|
|
|
|
|
|
|
Licence:
|
|
|
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
|
|
|
|
|
|
|
Github:
|
2016-06-20 15:58:31 +00:00
|
|
|
https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_code/compile/EPOCH_niteLight.sqf
|
2015-12-07 16:24:52 +00:00
|
|
|
*/
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[cog import generate_private_arrays ]]]
|
|
|
|
private ["_config","_nlSettings","_pos"];
|
|
|
|
//[[[end]]]
|
2015-09-14 20:55:36 +00:00
|
|
|
if (!isNull EP_light) then {
|
|
|
|
deleteVehicle EP_light;
|
|
|
|
};
|
2016-06-20 15:58:31 +00:00
|
|
|
_config = 'CfgEpochClient' call EPOCH_returnConfig;
|
2017-05-02 13:28:52 +00:00
|
|
|
_nlSettings = getArray( _config >> "niteLight");
|
|
|
|
_nlSettings params [["_nlEnabled",1],["_nlBright",1.88],["_nlZ",22]];
|
2016-08-06 17:54:53 +00:00
|
|
|
if (_nlEnabled isEqualTo 1) then {
|
2018-01-06 14:11:57 +00:00
|
|
|
_pos = (getPosATL vehicle player);
|
2016-08-06 17:54:53 +00:00
|
|
|
_pos set [2,_nlZ];
|
|
|
|
EP_light = "#lightpoint" createvehiclelocal _pos;
|
|
|
|
EP_light setposATL _pos;
|
2018-01-06 14:11:57 +00:00
|
|
|
EP_light attachTo [vehicle player,[0,8.11,_nlZ]]; //offset infront of vehicle player so that the darkness is 'following' them.
|
2017-08-18 16:09:14 +00:00
|
|
|
EP_light setLightDayLight false; //Sets light so it can only be used at night.
|
2016-08-06 17:54:53 +00:00
|
|
|
EP_light setLightBrightness _nlBright;
|
|
|
|
EP_light setLightAmbient [0.435, 0.439, 0.439];//Using new Colours.
|
|
|
|
EP_light setlightcolor [0.435, 0.439, 0.439];
|
|
|
|
};
|
2015-12-07 16:24:52 +00:00
|
|
|
true
|