Epoch/Sources/epoch_code/compile/EPOCH_niteLight.sqf

34 lines
1.1 KiB
Plaintext
Raw Normal View History

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
*/
2015-09-14 20:55:36 +00:00
private ["_pos"];
if (!isNull EP_light) then {
deleteVehicle EP_light;
};
2016-06-20 15:58:31 +00:00
_config = 'CfgEpochClient' call EPOCH_returnConfig;
_nlSettings = getArray ( _config >> "niteLight");
_nlBright = _nlSettings select 0;
_nlZ = _nlSettings select 1;
2015-09-14 20:55:36 +00:00
_pos = (getPosATL player);
2016-06-20 15:58:31 +00:00
_pos set [2,_nlZ];
2015-09-14 20:55:36 +00:00
EP_light = "#lightpoint" createvehiclelocal _pos;
EP_light setposATL _pos;
2016-06-20 15:58:31 +00:00
EP_light attachTo [player,[0,8.11,_nlZ]]; //offset infront of player so that the darkness is 'following' them.
EP_light setLightDayLight true; //TODO: Test if this can be turned off (Dawn / Dusk)
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