Page 1 of 1
The age old topic of doors
Posted: Thu Jun 05, 2003 7:31 pm
by Zip
Another door post I'm afraid (Yawn!

)
I've made some toilets with doors to get in them. I want the doors to open towards the player only, is this achievable? I heard you can use 'alwaysaway' for doors to open away from you (although some people have said that doesn't work

) Is there a 'alwaystowards' command (i can't find any notes on it) or do I have to do a script?
Thanks

hmmm
Posted: Thu Jun 05, 2003 7:58 pm
by tltrude
Well, one way to do it would be to use a remote door. Set the door to "targeted" and place a trigger_use targetname rd_trigger around the door. Then put a script_origin inside the stall with the targetname fake_player.
Then in the script:
Code: Select all
level waittill prespawn
level.rdoorpos = 0
thread remote_door
end
remote_door:
$rd_trigger waittill trigger
if (level.rdoorpos == 0)
{
$remote_door open $fake_player
level.rdoorpos = 1
goto remote_door
}
if (level.rdoorpos == 1)
{
$remote_door close $fake_player
level.rdoorpos = 0
goto remote_door
}
end
Posted: Thu Jun 05, 2003 8:03 pm
by Zip

I have to do that for every door?? There's loads of them! Oh my!
Hehe, thanks tltrude

If you think of a shorter/easier way let me know

stall doors
Posted: Thu Jun 05, 2003 8:10 pm
by tltrude
Don't stall doors normally open inwards?
Posted: Thu Jun 05, 2003 8:23 pm
by wacko
tltrude, you're such a scripting god, i wonder whether you write a script to set brushes into your empty map!? just kidding
s/th else before the solution: i'm deeply embarrassed and now "lie corrected" in front of my keyboard: the alwaysaway/1 is not neccessary! what makes a difference is just the angle you give the door! a door (always in top (xy) view) stretching from left to right which would so be used by players from above or below, needs an angle of 90 or 270.
A door
always opens away from the player (even without alwaysaway/1, which seems to be default) with such a correctly set angle (a wrong angle makes the door open depending on the players position relative to the door).
Now: A door opens just in one direction, when you give it a key/value of alwaysaway/0 and the direction it opens depends on the angle you gave it. In the above example, the door would open "upwards" with an angle of 90 and "downwards" with an angle of 270
I hope, this is right now. Atleast I did test it and the test door behaved this way

Cool!
Posted: Thu Jun 05, 2003 8:49 pm
by tltrude
If that works, it will sure help zip. I will have to try "alwaysaway 0" on some cupboard doors.
Posted: Thu Jun 05, 2003 9:43 pm
by Zip
Some interesting solutions tltrude and wacko

. Alwaysaway = angle might be quicker to apply to all my doors, but thanks tltrude.
I think you're right tltrude stall doors do open inwards (well they do down at the swimming pool!)
Posted: Thu Jun 05, 2003 9:45 pm
by wacko
take out the cups and plates, first

Posted: Thu Jun 05, 2003 9:51 pm
by wacko
Zip wrote:Alwaysaway = angle might be quicker to apply to all my doors
What do you mean with alwaysaway=angle?
there's just the key
alwaysaway with value
0 (turning it off) or
1 (turning it on), and then there's the key
angle determining the direction the door will open
Posted: Thu Jun 05, 2003 10:04 pm
by Zip
I just tried it (maybe it was a fluke but what I wanted worked for me)
I wanted the doors on my toilets to always open into the toilet stall. My player has to face right in XY view to open the doors, so I did this to all my doors:
Key: alwaysaway
Value: 0 (or 360 degrees)
When I tried it in my map it worked perfectly!.....
When I walk up to the door and press 'use' it opens into the stall away from me. Then I go inside the stall and press 'use' to close the door (if it hasn't closed behind me). If I then try and open the door again it opens towards me. Brilliant!
Haven't checked it for different angles, but maybe it will work if you had to face 'Up' in XY view (i.e. 90 degrees)
Posted: Thu Jun 05, 2003 10:33 pm
by wacko
errm....no
it just worked in your case, because the angle of 0 is default.
Your player standing in front of the door has to look right in XY view to see the door. And, you want the door to always open inside. Okay! The correct key/values are alwaysaway/0 (to make it not open alwaysaway, 0 in this case means no angle but just "NO") and the other key/value is angle/0 to let the door open in direction 0? (this 0 now is an angle, and 0? is default).
Another door the player had to look UP to see, would have key/values:
alwaysaway/0 and angle/90
Another door the player had to look LEFT to see, would have key/values:
alwaysaway/0 and angle/180
Another door the player had to look DOWN to see, would have key/values:
alwaysaway/0 and angle/270
A door that always opens away from the player where the player had to look left OR right would have just angle/0 or angle/180
A door that always opens away from the player where the player had to look UP OR DOWN would have just angle/90 or angle/270.
These two doors could have another key/value of alwaysaway/1 (which would mean "YES") but this is default and you don't have to set it therefore.
sorry for my bad explanation last time, hope this one is more clear!?
Posted: Fri Jun 06, 2003 8:28 am
by Zip
Morning Wacko,
Hehe, your explanation is perfect as usual

It all makes sense now, maybe it was getting a bit late last night so my brain stopped working!

Your explanation is so good I even printed it out
Thanks m8
Posted: Fri Jun 06, 2003 10:32 am
by mohaa_rox
it usually happens when ur func_door is leaked.
Posted: Sun Jun 08, 2003 4:28 pm
by The_Grass
Hey Wacko I take back my old backup and are going to try to let the bugs out , because i coudn't load my Boer5 map not in spearhead only in Allied Assault and now it's running well without leaks , compiling time is from 15 minutes back to 7 ( that be all the brushes I gues . Thanks a lot i Have dry eyes again

after such a frustrating problem , ps now you don't use to use control to go thru that door's , I lett you now when my map is finished , over a vew weeks I think
Thx again.