Home   Help Search Login Register  

Author Topic: Check if a unit performs an animation  (Read 501 times)

0 Members and 1 Guest are viewing this topic.

laulau

  • Guest
Check if a unit performs an animation
« on: 07 Sep 2003, 06:56:51 »
hi!
Maybe it will seems useless for you guys but i'm trying to make a script checking if a player salute an officer. I tried different things but it doesn't work. Does Someone  know how to check if a unit performs an animation?

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Check if a unit performs an animation
« Reply #1 on: 07 Sep 2003, 11:42:04 »
probably the best way to do this, is instead of checking whether he has saluted, add to the animation activation section in your script a boolean variable and declare it true

eg

do whatever lines you have to run, to activate the salute on whatever condition that was required to activate it

then add the line
SALUTED = TRUE; publicvariable "SALUTED"

_________________________________________________________________

then on the script that was waiting for the soldier to salute add the lines

@ saluted
or if you want to put it into a slower loop that the @ command uses

#START
? SALUTED: goto "THENWHAT"
~1
goto "START"

#THENWHAT
______________________________________________
or if you use a  trigger, then in the condition line add
SALUTED


this will then activate the trigger


hope this workaround helps
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

laulau

  • Guest
Re:Check if a unit performs an animation
« Reply #2 on: 07 Sep 2003, 20:57:29 »
thanks for your answer, Terox. i understand what you wrote but there's a little problem. There's no line activating the animation in my script because the player has to do it himself, from the action menu. so first i thought of checking when the action is performed, like it exists in this script which is a light script from the Baracken addon from Mapfact:

Quote
_Schalter = _this select 0

#Runde

@ (_Schalter animationPhase "Component02" >= 0.01) or (not alive _Schalter)
(object 53492) switchlight "off"
(object 4885) switchlight "off"
(object 8192) switchlight "off"
? (not alive _Schalter):exit

@ _Schalter animationPhase "Component02" < 0.5 or (not alive _Schalter)
? (not alive _Schalter):exit
(object 53492) switchlight "on"
(object 4885) switchlight "on"
(object 8192) switchlight "on"

Goto "Runde"

it checks the animation with this line:
@ (_Schalter animationPhase "Component02" >= 0.01)

So reading this, i thought it could be possible to check a player animation.

anyway, i thought about an other way to check when the animation is performed. the action "Salute" is from the action menu. So maybe it should be better to check if the player activate the action from the menu than to check if he performs the animation.
So what i know about actions is that they have number to identify them.
so the salute action is the first one and it's the number 0, but how to check if the player select this action?