Home   Help Search Login Register  

Author Topic: open ended event handlers  (Read 498 times)

0 Members and 1 Guest are viewing this topic.

bored_onion

  • Guest
open ended event handlers
« on: 25 Aug 2004, 16:59:00 »
can you have an event handler that works for any unit who creates the specified event
i.e
Code: [Select]

_anyunit addevethandler ["fired",{action}]


any thoughts?

no rush on this, just a general enquiry...

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:open ended event handlers
« Reply #1 on: 25 Aug 2004, 17:24:53 »
I don't understand the question.

An eventhandler is an attribute that you the mission designer adds to an object, in the same way as you might add a weapon.   If you want to detect that anybody in the mission has fired then you need to add an eventhandler to every relevant unit.
Plenty of reviewed ArmA missions for you to play

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:open ended event handlers
« Reply #2 on: 25 Aug 2004, 20:43:27 »
Here is a sample of your request using all members of a group. Just put this line in the group leader's init field. I believe that if you change the "group this" to "thislist" and have this line of code in the "on Activation" field of a trigger, it will apply the eventhandler to any unit that satifies the trigger condition (e.g. "West Present" will apply the EH to all west units in the trigger area).


Code: [Select]
{_x addeventhandler ["killed", {_this exec "yourscript.sqs"}]} forEach units group this

Hope that this helps!

                                                                Wadmann

                                     
« Last Edit: 25 Aug 2004, 20:45:43 by Wadmann »
Check out my Camouflage Collection! New items added 31 July 2005.

bored_onion

  • Guest
Re:open ended event handlers
« Reply #3 on: 25 Aug 2004, 21:05:00 »
like i said, just an inquiry for reference

very interesting

thanks