Home   Help Search Login Register  

Author Topic: How to detect who triggers UserAction??  (Read 414 times)

0 Members and 1 Guest are viewing this topic.

BullzEyeOnMyBack

  • Guest
How to detect who triggers UserAction??
« on: 02 Jan 2004, 23:05:43 »
I've tried several attempts at this with my addon recently, but I'm not sure if it is possible. I'm really really hopping someone out there has an answer for it. Here is an example of the config file.
Code: [Select]
class UserActions
      {
         class Open
         {
            displayName="Deploy ";
            position="aa";
            radius=4;
                                      condition="alive this && this animationPhase ""open"" < 0.5";
            statement=" [this] exec ""\Case\scripts\deploy.sqs""";            
         };

"this" produces the object that your triggering it on, but I would like to know who triggered it instead so then I can put them into a public array for later use.  
I've tried "thislist select 0 (with 1 and 2)"  then i've tried, "_this select 1"  
I'm just hoping someone knows.
Thanks in advance for any replies!  :)

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:How to detect who triggers UserAction??
« Reply #1 on: 03 Jan 2004, 00:27:57 »
to do a thing like that, I'm afraid you'd have to create an addon-scroll... so yer EVENT code should prolly be morelike this:



INIT="_this select 0 exec {\myAddon\MyScroll.sqs}";

and in that script you need some PRE-DEFINED units:


a looped check like:

_MyAddon = _this select 0

#loop
_MyMoron= nearestObject [_MyAddon, "SoldierWLAW"]

...and then you'd have to add some if/then stuff:

get the point?!  if door is open AND nearestObject is a _MyMoron, THEN .... etc.


but the real problem is (I fear) that you cannot pick out unspecified units in addon scrolls, so ya might need to do it from within the mission, using a pre-defined unitName  :-\ :hmm: