Update local_lights_street.sqf

This commit is contained in:
Andrew Gregory
2013-09-08 00:47:14 +01:00
parent 83bd87d98a
commit 365d878eb1

View File

@@ -1,39 +1,36 @@
/* /*
DayZ Epoch Lighting System DayZ Epoch Lighting System - Street Lights
Made for DayZ Epoch please ask permission to use/edit/distrubute email axeman@thefreezer.co.uk. Made for DayZ Epoch please ask permission to use/edit/distrubute email axeman@thefreezer.co.uk.
*/ */
private ["_streetLamps","_num","_location","_objLightPoint","_away","_objSLamp","_nrstGen","_dir"]; //Changed adding variable to generator to adding to new lightpoint as player now a trigger also.
private ["_streetLamps","_num","_location","_objLightPoint","_away","_objSLamp","_dir","_lp","_sLampCol","_rndLights"];
_streetLamps= _this select 0; _streetLamps= _this select 0;
_nrstGen = _this select 1; _sLampCol = _this select 2;
_rndLights = _this select 3;
_num=0; _num=0;
if(!isNil "_streetLamps")then{ if(!isNil "_streetLamps")then{
//Illuminate
{ {
_objSLamp= _x select 0; if(_rndLights>(random 100))then{
_location = getPos _objSLamp; _objSLamp= _x select 0;
_objLightPoint = nearestObject [_location, "#lightpoint"]; _location = getPos _objSLamp;
_away= abs ([_objSLamp, _objLightPoint] call BIS_fnc_distance2D); _objLightPoint = nearestObject [_location, "#lightpoint"];
_away= abs ([_objSLamp, _objLightPoint] call BIS_fnc_distance2D);
if(_away>1)then{ if(_away>1)then{
_dir = getDir _objSLamp; _dir = getDir _objSLamp;
_location set [1, (getPos _objSLamp select 1) + ((0.6)*sin(_dir))]; _location set [1, (getPos _objSLamp select 1) + ((0.6)*sin(_dir))];
_location set [2,_location select 2 - 0.2]; _location set [2,_location select 2 - 0.2];
_lp = [_sLampCol,0.04,_sLampCol,_location,_dir,[0,0,-1]] call axe_newLightPoint;
_lp setVariable ["axeSLight", 1, false];
[[1, 0.88, 0.73],0.04,[1, 0.88, 0.73],_location,_dir,[0,0,-1]] call axe_newLightPoint; }else{
if((_objLightPoint getVariable ["axeSLight",0])<1)then{
}else{
if((_nrstGen getVariable ["axeSLight",0])<1)then{
[[1, 0.88, 0.73],0.04,[1, 0.88, 0.73],_objLightPoint] call axe_lightPoint;
[_sLampCol,0.04,_sLampCol,_objLightPoint] call axe_lightPoint;
};
}; };
_num=_num+1;
}; };
_num=_num+1;
}forEach _streetLamps; }forEach _streetLamps;
_nrstGen setVariable ["axeSLight", 1, false];
}; };