Home   Help Search Login Register  

Author Topic: Destroying ID's with radio  (Read 1775 times)

0 Members and 1 Guest are viewing this topic.

Offline Binary

  • Members
  • *
Destroying ID's with radio
« 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 :)
"Ah.. Home sweet hell !" - Al Bundy

Offline schuler

  • Contributing Member
  • **
Re: Destroying ID's with radio
« Reply #1 on: 06 Jul 2008, 15:16:55 »
i am not sure if this works with Arma , not tested
Code: [Select]
{(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
« Last Edit: 06 Jul 2008, 15:38:16 by schuler »
Semper Fi

Offline Binary

  • Members
  • *
Re: Destroying ID's with radio
« Reply #2 on: 06 Jul 2008, 15:46:35 »
Using the example you gave schuler - i get this error.



 ???
"Ah.. Home sweet hell !" - Al Bundy

Offline schuler

  • Contributing Member
  • **
Re: Destroying ID's with radio
« Reply #3 on: 06 Jul 2008, 16:03:18 »
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!
Semper Fi

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Destroying ID's with radio
« Reply #4 on: 06 Jul 2008, 17:02:34 »
i am not sure if this works with Arma , not tested
Code: [Select]
{(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:
Code: (radio trigger activation) [Select]
{([0, 0, 0] nearestObject _x) switchLight "ON"} forEach [1251,2003,28419,28420,28424,28664,32938,37326,66997,66998,67026,90863];
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Binary

  • Members
  • *
Re: Destroying ID's with radio
« Reply #5 on: 06 Jul 2008, 17:34:59 »
Simpy amazing Spooner  :good:

Although - switchLight "OFF" seemed to work better for killing the lights  :D

Problem solved, thanks a lot :)
"Ah.. Home sweet hell !" - Al Bundy

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Destroying ID's with radio
« Reply #6 on: 06 Jul 2008, 18:38:36 »
I always miss the easy stuff like remembering you want to turn the lights off, not on ;P
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Destroying ID's with radio
« Reply #7 on: 06 Jul 2008, 18:38:46 »
You may also try this for a more generic solution:

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Destroying ID's with radio
« Reply #8 on: 06 Jul 2008, 19:47:45 »
For completeness, you could also check out the scripts accompanying this demomission. 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.