Author Topic: Check if house door is closed  (Read 530 times)

0 Members and 1 Guest are viewing this topic.

Offline Callsign

  • Members
  • *
Check if house door is closed
« on: 22 Feb 2012, 16:16:10 »
How would I check if a house door is closed?


Offline Wolfrug

  • Addons Depot
  • Administrator
  • *****
  • Official OFPEC Old Timer
Re: Check if house door is closed
« Reply #1 on: 22 Mar 2012, 21:16:43 »
Hi Callsign!

I haven't tested this myself, but the command used would I believe be animationPhase. Doors are generally called "dvere1" or then something like "door" or "maindoor". The returned number is between 1 and 0. 1 is open, 0 is closed. So you'd want:

_phase = house1 animationPhase "dvere1";
if (_phase > 0) then {hint "Door is open!"};

Finding the house itself is done via the regular nearObjects/game logic deal I believe, although it was ages ago since I used it :) Also note that animationPhases for static objects don't necessarily update when not in player sight! So it might give wrong readings then.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"