Welcome, Guest Thursday 24th April 2014, 06:50:22
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: Check if house door is closed  (Read 220 times)
0 Members and 1 Guest are viewing this topic.
Callsign
*
Offline Offline


« on: 22 Feb 2012, 16:16:10 »

How would I check if a house door is closed?

Callsign
Logged
Wolfrug
Addons Depot
Administrator
*****
Offline Offline


Official OFPEC Old Timer


« 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 Smiley 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.
Logged

"When 900 years YOU reach, look as good you will not!"
Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: