Jump to content
Sign in to follow this  
clydefrog

Turning off all of the lights in Agia Marina

Recommended Posts

I know this has been spoken about before but I can't find the Arma 3 thread about it so I can't reply to that. I've just been bringing an old mission up to date that uses a script to turn lights off in an area (made by kylania I think), but the street lamps no longer turn off so the classnames must have changed. Here is the script:

// off: 0 = [0.95] execVM "lights.sqf";
// on: 0 = [0] execVM "lights.sqf";

_types = ["Lamps_Base_F", "PowerLines_base_F"];
_onoff = _this select 0;

for [{_i=0},{_i < (count _types)},{_i=_i+1}] do
{
   // powercoverage is a marker I placed.
_lamps = getMarkerPos "powerCoverage" nearObjects [_types select _i, 500];
sleep 1;
{_x setDamage _onoff} forEach _lamps;
};

I have found one of them for the wooden pole street lamps but after trying that many other different types of lights remained on. How can I amend this script to turn off every type of light in the area?

Also is there an easy way of finding out the classname of map objects?

---------- Post added at 14:56 ---------- Previous post was at 14:30 ----------

Nevermind thanks to this thread (http://forums.bistudio.com/showthread.php?168808-99-working-lights-out-script-via-trigger-needs-your-help) I have found somebody with the exact same problem using the same script as me and a solution. However I would still like to know how you can find the classnames for certain objects on the map.

Edited by clydefrog

Share this post


Link to post
Share on other sites

I think there is a slight problem with your syntax.

// off: 0 = [0.95] execVM "lights.sqf";
// on: 0 = [0] execVM "lights.sqf";

_types = ["Lamps_Base_F", "PowerLines_base_F"];
_onoff = _this select 0;

for [{_i=0},{_i < (count _types)},{_i=_i+1}] do
{
   // powercoverage is a marker I placed.
_lamps = getMarkerPos "powerCoverage" nearObjects [[_types select _i], 500]; //ADDED BRACKETS 
sleep 1;
{_x setDamage _onoff} forEach _lamps;
}; 

Actually just noticed you are using nearObjects. Not nearestObjects. Nevermind

Edited by BangaBob
Not the same nearobject

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
Sign in to follow this  

×