Jump to content
Sign in to follow this  
HateDread

Turning off Streetlights

Recommended Posts

How does one turn off the streetlights in a certain radius, town, or the whole map, respectively? I assume there must be a function or command?

Edit:

Dug this out of Eve of Destruction;

one=true;

publicvariable "one";

power setTaskState "SUCCEEDED";hint "Power supply is cut ... Objective complete ";

sleep .5;

{_x switchLight "off"} foreach (position powercut nearObjects ["streetlamp",3000]);

sleep .5;

{_x switchLight "off"} foreach (position powercut2 nearObjects ["streetlamp",3000]);

sleep 11;

elekgunfire=true;

publicVariable "elekgunfire";

hint "Enemy units at the port of Elecktrozavodsk have been alerted by the explosion at the power station "

Guess that helps?

Edited by HateDread

Share this post


Link to post
Share on other sites

When I wanted to do the same I just call this script when I want to turn them off:

{_x switchLight "OFF"} forEach ((getPos Solnichniy) nearObjects ["StreetLamp",1500])

_objHouse = nearestObjects [solnichniy, ["House"], 1500];

{
for "_i" from 1 to 5 do {

				_x animate [format ["Lights_%1",_i],0];
};
} forEach _objHouse;

NOTE: Solnichny is a Game Logic (Location) that I place in the center of where I want the lights to go out.

That will turn off all the house lights (in the windows, which are activated by ALICE), and all streetlights within 1500m.

Hope that helps :)

Share this post


Link to post
Share on other sites

How would I sent this up to say blow up transformers or other buildings and the lights went out?

Share this post


Link to post
Share on other sites

Ive got that set up in a mission I have, I'll just copy that and upload it if you want it...

Share this post


Link to post
Share on other sites

edit/ nm, I figured it out

Edited by Ish

Share this post


Link to post
Share on other sites

To run that from init.sqf you would just copy that code into notepad and save it into your mission folder as: LightsOff.sqf. Then in your init.sqf just put: 'execVM "LightsOff.sqf";'

EDIT: Well I have uploaded an example mission anyway; http://rapidshare.com/files/338316755/StreetLights.Chernarus.zip. You can use the radio trigger to destroy the transformer or you can use satchels :)

Hope it helped

Edited by Andy455

Share this post


Link to post
Share on other sites

Manzilla, if you're wondering how to do it, it's like in that other thread about blowing up the bridge. You remember? I helped you with;

!alive nearestObject [bridgeMonitor, "House"] && !alive nearestObject [bridgeMonitor1, "House"];

If you set that up, with a logic called 'BridgeMonitor', or whatever, on top of one transformer, and BridgeMonitor1 on the other, and trigger-exec this lights-off script, and there you go!

You can use ID's to be more precise in the above code, which can be found by zooming in on the transformers in the editor with ID's enabled.

Hope this helps.

- HateDread

Share this post


Link to post
Share on other sites
To run that from init.sqf you would just copy that code into notepad and save it into your mission folder as: LightsOff.sqf. Then in your init.sqf just put: 'execVM "LightsOff.sqf";'

EDIT: Well I have uploaded an example mission anyway; http://rapidshare.com/files/338316755/StreetLights.Chernarus.zip. You can use the radio trigger to destroy the transformer or you can use satchels :)

Hope it helped

Thanks a lot Andy455! I'll check it out.

---------- Post added at 06:52 PM ---------- Previous post was at 06:51 PM ----------

Manzilla, if you're wondering how to do it, it's like in that other thread about blowing up the bridge. You remember? I helped you with;

If you set that up, with a logic called 'BridgeMonitor', or whatever, on top of one transformer, and BridgeMonitor1 on the other, and trigger-exec this lights-off script, and there you go!

You can use ID's to be more precise in the above code, which can be found by zooming in on the transformers in the editor with ID's enabled.

Hope this helps.

- HateDread

Thanks Hate Dread!

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  

×