Jump to content
GODSPEEDSNAKE

Arma III switchLight Coding

Recommended Posts

Hi all, been bugging around for hours now with no luck getting ALL LIGHTS on the Chernarus Redux map to turn off. Have managed to get most of them off with the following sqf

 

call{{  
_x setHit ["light_1_hitpoint", 0.97];  
_x setHit ["light_2_hitpoint", 0.97];  
_x setHit ["light_3_hitpoint", 0.97];  
_x setHit ["light_4_hitpoint", 0.97];  
  
} forEach nearestObjects [thisTrigger, [  
  
"Lamps_Base_F",
"PowerLine_01_pole_lamp_F",
"PowerLines_base_F",
"Land_PowerLine_02_pole_small_lamp_F",
"Land_PowerPoleWooden_L_F",
"Land_PowerPoleWooden_F",
"Land_LampHarbour_F",
"Land_LampShabby_F",
"Land_PowerPoleWooden_L_F",
"Land_PowerPoleWooden_small_F",
"Land_LampDecor_F",
"Land_LampHalogen_F",
"Land_LampSolar_F",
"Land_LampStreet_small_F",
"Land_LampStreet_F",
"Land_LampStreet_02_F",
"Land_LampStreet_02_double_F",
"Land_LampAirport_F",
"Land_LampStadium_F",
"Land_Lamp_Small_EP1",
"Land_Lampa_ind" 
  
], 10000]; 
 
_lamps = nearestObjects [thisTrigger, ["Land_PowerLine_01_pole_lamp_F"], 10000];   
   
{   
 for "_i" from 0 to count getAllHitPointsDamage _x -1 do   
 {   
  _x setHitIndex [_i, 0.97];   
 };   
} forEach _lamps;}

 

Now everything there works fine however the following objects don't turn off unless I one by one "cursorObject switchLight "ON";"

 

"Land_NAV_Lighthouse"
"Land_Ind_Expedice_1"
"Land_Ind_Expedice_2"
"Land_Mil_Guardhouse"
"Land_Vez_Silo"
"Land_Ind_Vysypka"

"Land_PowLines_Conc2L_EP1"
"Land_PowLines_WoodL"

"Land_NavigLight"
"Land_NavigLight_3_F"


I'm wondering is there anyway I could do something like
 

("Land_NAV_Lighthouse", "Land_Ind_Expedice_1", "Land_Ind_Expedice_2", "Land_Mil_Guardhouse", "Land_Vez_Silo", "Land_Ind_Vysypka") switchLight "OFF";

Just that the above is wrong 😞 any help would be much appreciated and thank u in advance...

Share this post


Link to post
Share on other sites

Do the same as the foreach loop above:

{  
	_x switchLight "OFF";
} forEach nearestObjects [thisTrigger, [
	/* list of classnames */
], 10000];

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×