OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Binary on 06 Jul 2008, 14:49:57
-
Hello :)
I've tried doing quite a few searches so far - but haven't found a thread that answered my question accurately enough.
What I'm trying to do, is via a radio command, turn off the lights in a village. I'm trying to do this with triggers/gamelogics and the nearestObject command - but i keep running into syntax problems..
I supose this could be done via a script - but it needs to be MP compatible.
ID's of the lightposts:
67175
67305
67304
67245
67307
67306
67244
67308
Any thoughts on this would be great :)
-
i am not sure if this works with Arma , not tested
{(object _x) setdamage 4} forEach [1251,2003,28419,28420,28424,28664,32938,37326,66997,66998,67026,90863]just change the obj in this code and ad to a trigger , with radio
cheers schuler
Edit,,, posted code with,,, lights off, not setdamage opps :whistle:
changed :D
-
Using the example you gave schuler - i get this error.
(http://img365.imageshack.us/img365/6595/errorpz8.jpg)
???
-
sorry i think some of the code is wrong,,, its in OFP not testing in Arma , but dont worry one of the member with fix it for you sortly ;)
cheers schuler
ps note where it says name in the trigger ,,, if you type- set off IED or what ever you like in that box, it will be show on the radio, after you get the right code!
-
i am not sure if this works with Arma , not tested {(object _x) setdamage 4} forEach [1251,2003,28419,28420,28424,28664,32938,37326,66997,66998,67026,90863]
The object command doesn't work in ArmA, thus try:
{([0, 0, 0] nearestObject _x) switchLight "ON"} forEach [1251,2003,28419,28420,28424,28664,32938,37326,66997,66998,67026,90863];
-
Simpy amazing Spooner :good:
Although - switchLight "OFF" seemed to work better for killing the lights :D
Problem solved, thanks a lot :)
-
I always miss the easy stuff like remembering you want to turn the lights off, not on ;P
-
You may also try this for a more generic solution:
-
For completeness, you could also check out the scripts accompanying this demomission (http://www.ofpec.com/FAQ/faq_obj.php#lights). It was made for OFP, but the principle is the same - get the classnames of all possible streetlamps and you can add a 'lightswitch' to them all.