Jump to content
Sign in to follow this  
Fu-ion

How to check if a door/gate is open ?

Recommended Posts

I am using the baracken "green current house" or Stomhaus addon (Mapfact) which has an animated switch.

I need to be able to check if it is open or not.

I know it will change state using xxx animate ["component2",1] or 0

but does anyone know how to check if the state of the component is 1 or 0 ??

Share this post


Link to post
Share on other sites

i am still noob on addons but i guess this is what you need.

Quote[/b] ]object animationPhase animation

Operand types:

object: Object

animation: String

Type of returned value:

Number

Compatibility:

Added in version 1.75

Description:

Return animation phase of animation on object.

Multiplayer notes: See comments on animate above. Might return a different value from different computers, due to desync and lag. Works best on the server.

Example:

house animationPhase "doors1"

i am sure someone will come and say why and if not why.

btw i use the comref over at ofpec, its v good.

Share this post


Link to post
Share on other sites

Yep that's it :

in a script or trigger :

? nameofobject animationphase "component02" == 1 (true if the door is open)

or

? nameofobject animationphase "component02" == 0 (true if the door is closed)

Share this post


Link to post
Share on other sites

wicked stuff, I hadn't gotten round to looking into "animationphase" but I guess the command itself is a clue.

Thanks all yay.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×