The age old topic of doors

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

The age old topic of doors

Post by Zip »

Another door post I'm afraid (Yawn! :roll: )

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 :D
Zip :?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

hmmm

Post 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
Last edited by tltrude on Thu Jun 05, 2003 8:08 pm, edited 2 times in total.
Tom Trude,

Image
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

Post by Zip »

:cry: 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 :wink:
Zip :?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

stall doors

Post by tltrude »

Don't stall doors normally open inwards?
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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 :wink:

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 :?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Cool!

Post by tltrude »

If that works, it will sure help zip. I will have to try "alwaysaway 0" on some cupboard doors.
Tom Trude,

Image
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

Post 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!)
Zip :?
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

take out the cups and plates, first :wink:
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

Post 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)
Zip :?
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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!?
User avatar
Zip
Major
Posts: 323
Joined: Wed Apr 09, 2003 6:47 pm
Location: Belgium

Post by Zip »

Morning Wacko,

Hehe, your explanation is perfect as usual :D It all makes sense now, maybe it was getting a bit late last night so my brain stopped working! :oops: Your explanation is so good I even printed it out :wink:

Thanks m8
Last edited by Zip on Fri Jun 06, 2003 10:49 am, edited 1 time in total.
Zip :?
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

it usually happens when ur func_door is leaked.
Live to map, not map to live.
-mohaa_rox, .map
moderator
The_Grass
Corporal
Posts: 33
Joined: Sat Mar 15, 2003 12:54 pm
Location: Netherlands

Post 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.
Greetings The_Grass Aka Ruud Grasman
Post Reply