Home   Help Search Login Register  

Author Topic: Batch addition of Switchmoves  (Read 812 times)

0 Members and 2 Guests are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Batch addition of Switchmoves
« on: 23 Apr 2005, 18:04:21 »
My brain is a bit fuddled.  I know how to give a named individual a switchmove to do when they are killed.  What I want to do is to give the switchmove to a batch of units that don't have individual names or at least I don't know what they are.

I have tried:

{_x addEventHandler ["Killed",format ["%1 ",_x]+{switchMove "FXStandSurDead"}]} forEach units infGrp

I get an error:

WEST |#|Bravo Black 7 switchMove "FXStandSurDead":  Error unknown operator Bravo

{_x addEventHandler ["Killed",format ["%1 switchMove {FXStandSurDead}",_x]]} forEach units infGrp

Gives exactly the same result


This works for a single named unit:
unitname addEventHandler ["Killed",{unitname switchMove "FXStandSurDead"}]

I am losing the will to live.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Batch addition of Switchmoves
« Reply #1 on: 23 Apr 2005, 18:35:31 »
I'm a bit hazy on this, but doesn't the EH return certain paramaters?     Could you have _this select 0 switchmove instead of the format stuff?

There's a square bracket missing in the second one.
Plenty of reviewed ArmA missions for you to play

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:Batch addition of Switchmoves
« Reply #2 on: 23 Apr 2005, 18:45:25 »
Code: [Select]
{_x addEventHandler ["Killed",{_this select 0 switchMove "FXStandSurDead"}]} foreach units infGrpWorks...

But it doesn't look good if the soldier was lying on the ground when getting shot. Soldier will suddenly jump to a standing position and then fall back down. Not good.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Batch addition of Switchmoves
« Reply #3 on: 23 Apr 2005, 19:00:43 »
Thank you both.

Baddo - the guys that will get this are standing up with their hands on their heads - promise

Missing square bracket - by gad sir you are right.  I could have sworn I copied and pasted from the trigger - maybe I forgot to do it again after I got a 'bracket missing error' and I certainly remember a few of those.