Page 1 of 1

Door pushing/pulling

Posted: Wed Oct 10, 2012 2:02 pm
by Roody_Yogurt
The other day, I noticed that in a game compiled with USE_VERBSTUB, when it comes to doors, >PUSH always means >OPEN DOOR and >PULL always means >CLOSE DOOR. Of course, hinged doors in real life have 'interior' and 'exterior' sides, depending on which way they swing. Now, I don't consider myself a "simulationist", but this seems like an easy enough thing to fix. Here is the new code:

Code: Select all

#ifset VERBSTUBS
	before
	{
		object DoPush
		{
			if location = self.between
				return Perform(&DoOpen, self)
			else
				return Perform(&DoClose, self)
		}
		object DoPull
		{
			if location = self.between
				return Perform(&DoClose, self)
			else
				return Perform(&DoOpen, self)
		}
	}
#endif
In the above code, between #1 is always the exterior side and between #2 is always the interior side.

Anyhow, I thought I'd share that. I haven't thought of ways to simplify/represent it further, but people are welcome to try.

Re: Door pushing/pulling

Posted: Wed Oct 10, 2012 2:54 pm
by Tdarcos
Roody_Yogurt wrote:Of course, hinged doors in real life have 'interior' and 'exterior' sides, depending on which way they swing.
And then there are swinging doors that you can push either way, as well as revolving doors (hint, hint) that you can only push. About the only place I see swinging doors are in commercial restaurants and in the kitchens of some older houses as an easier way to allow people in and out of the kitchen where it had doors on it. (Most places today do not put a door on the kitchen.)

But I think your pointing out that doors have specific directions is an excellent addition. Have you ever looked at the Half Life series of games; when you go through a door, it always opens either toward the player or away from them? So the way the door is open depends on which side you were standing in front of it when you activated it. And I think Portal does the same thing when you escape into the back of the Enrichment Center.