Revolving Door Implementation

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Revolving Door Implementation

Post by Tdarcos »

In the game Tripkey I happen to have a department store, so I decided to have the Department Store have a revolving door at the entrance, and when they push on the door, it changes where they can exit the revolving door. I could have used OUT for leaving the revolving door in both case, but I wanted them to have to use IN when entering the store and OUT to exit.

This presumes the user starts inside the store. Reverse the condition and the name of the room if they are not.

Here's how, in general:

Code: Select all

! Grammar
verb "push","press"
	* 										DoVague
	* pushable		 					DoPush


! grammar handlers

Routine DoPush
{
	if location is toward_store
	{
			location.name =  "In the revolving door, facing the parking lot."			
			location is not toward_store
			print "go OUT to leave building"

	} else {
			location.name =  "In the revolving door, facing the entrance to the store."
			location is toward_store		
			print "go IN to enter building"
	}
		MovePlayer(location)
}



! Attributes and properties

attribute Pushable						! Can be pushed or pressed



! Room and object definitions


! Room "vestibule_inside" is, obviously, the entry room 
! to the store, and what "parking_lot" is, is an exercise
! for the reader

Room Revolving_Door "In the revolving door, facing the entrance to the store."
{

	is toward_store
	long_desc
		"PUSH DOOR to rotate revolving door"

	IN_to	
	{
		if self is toward_store
			MovePlayer(Vestibule_Inside)
		else
			print "You are facing the parking lot.  Go OUT to leave, or PUSH DOOR to be able to enter the store."
	}
	OUT_to	
	{
		if self is toward_store
			print "You are facing the store entrance.  Go IN to enter, or PUSH DOOR to be able to exit the store."
		else
			MovePlayer(Parking_Lot)
	}

}
object entrance_door 		! So they can "push door" 
{
	in Revolving_Door
	is pushable, static, hidden 
	adjective "door"
}	
------------------------------

Arnold Horshack: Oooh, oooh, oooh, Mistah Kottah, I know what "parking_lot" is in that thing up there!
Mr. Kotter: What?
Horshack: A fuse box!
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: Revolving Door Implementation

Post by Tdarcos »

Damn, I left out

Code: Select all

attribute Toward_Store       ! If revolving door entrance is facing the store
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

Point of design!

Is there a reason the player would ever need to be inside the revolving door, for the purposes of the story, or would it be just as well for them to go in and out of the store without having to take the extra step inside the revolving door?

Thanks for taking my call.
I don't have to say anything. I'm a doctor, too.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

pinback wrote:Point of design!

Is there a reason the player would ever need to be inside the revolving door, for the purposes of the story, or would it be just as well for them to go in and out of the store without having to take the extra step inside the revolving door?

Thanks for taking my call.
Very good question, excellent question!

Uh yeah, before they go out there's a sign, uh, well let me show you:

Code: Select all


room Vestibule_Inside "Vestibule Entrance"
{

	N_to 		Store
	OUT_to		Revolving_door
	
	long_desc
		"Go NORTH to return to the store entrance, 
		or if you are leaving, USE CHECKOUT to pay for your
		purchases, then OUT or EXIT to leave the store.	\n
		Note that the security system will not allow you to
		leave the store with any unpaid merchandise.\n
		Thank you for shopping at Viridian's Department Store, and please come again soon."
}
So what it allows me to do, later, is check if the "customer" has any stolen merchandise, then the door gives an alarm and won't open. The same thing will happen if they try to use the restrooms and have merchandise on them. (I'll put the check in later.)

Code: Select all

room Restrooms "Restrooms"
{
	is SmokeSafe
	S_to			Store_1_escalator
	E_to			MensRoom
	W_to			WomensRoom
	
	long_desc
		"Go SOUTH to the escalators,
		go EAST (or MEN) to enter the Men's Restroom,
		WEST (or WOMEN) to enter the Women's Restroom.
		NOTICE: NO MERCHANDISE IS PERMITTED IN RESTROOMS.  
		SECURITY SYSTEMS WILL BE ACTIVATED IF MERCHANDISE IS
		BROUGHT INTO A RESTROOM."
}

room MensRoom "Men's Restroom"
{
	is SmokeSafe

	out_to Restrooms
	long_desc
		""NOTICE: Smoking is not permitted in public restrooms." \n- Winnemac B&E Code Sec. 70006."
}


room WomensRoom "Women's Restroom"
{
	is SmokeSafe

	out_to Restrooms
	long_desc
		""NOTICE: Smoking is not permitted in public restrooms." \n- Winnemac B&E Code Sec. 70006."
}
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

Can you just stop them from using the door if they have unpaid merchandise? Adding a separate room for the revolving door, while noble and interesting from an implementation standpoint, is troublesome for the player.

Love your guys's show.
I don't have to say anything. I'm a doctor, too.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

pinback wrote:Can you just stop them from using the door if they have unpaid merchandise? Adding a separate room for the revolving door, while noble and interesting from an implementation standpoint, is troublesome for the player.

Love your guys's show.
It's strictly a gimmick - they don't have to use the revolving door - and yes, I can stop them. All I have to do just add an attribute "stolen" and just scan everything the player is carrying, and if any hit comes up, a block comes down "like a fucking anvil" as the tech guy said in Die Hard.

I just thought it was a neat trick, a revolving door, and many stores - and some buildings - have them. Of course, I can have a handicapped exit next to it. And you'd have to push the button to activate that door.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

Look, just take the door out of the game. Nobody likes futzing with shit that doesn't need to be there, even though as implementors we all agree it's cool.
I don't have to say anything. I'm a doctor, too.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

pinback wrote:Look, just take the door out of the game. Nobody likes futzing with shit that doesn't need to be there, even though as implementors we all agree it's cool.
If you aren't a beta tester you'll never see the game; it's of absolutely no relevance to you.

If you do end up playing this game and you don't want to use the revolving door, don't. It will have no effect on the story.

It just happens that department stores routinely have revolving doors and I wanted to put one in to flesh out the story and increase realism. No, it doesn't have (or "need") to have a revolving door, but I think it works in the context of the story.

Hell, if we want to argue the point, every single thing that's in a game 'doesn't need to be there,' it's a plot point the writer adds or a part of the story the writer chose to insert.

Tripkey, the story I created, also doesn't have to have a bathroom, sinks with running water, a TV set in the living room, a <s>fuse</s> breaker box with switches that actually turn things on and off, central air conditioning in the building, or a courtyard outside of it, but I think these extra items add some character to the story and increase the 'immersion effect' of being in a game.

Games that don't have occasional red herrings or things not strictly necessary for the game tend to be kind of boring. Half-Life 2 has scenes and dialog unrelated to the game's purpose of allowing Gordon to stop or reverse the Combine's takeover of Earth.

One part where Dr. Kleiner is announcing in his broadcast that now that the Combine (reproductive) suppression field was down (thanks to Gordon, of course) it might be a good time to take advantage of this (to repopulate our species) before it was restored. Alyx looks at Gordon and says, "Is Dr. Kleiner telling us to 'get busy'?"

Starcraft II: Is there any reason the <s>borg queen</s> err I mean <s>hungry animals queen</s> oh wait, <i>Zerg queen</i> has to be protagonist Jim Raynor's (ex-)girlfriend? He could be just as dissatisfied with life and worn out from the Zerg just from having fought them as much as being severely depressed because his lover Sarah was "assimilated." But they probably felt it adds a level of complexity to the backstory to eventually end up with a confrontation ala Data meeting the Borg Queen in Star Trek: First Contact.

Only what happens in Starcraft II will be more personal since the Borg Queen had no personal connection with Data; he has no emotion and she was a stranger meant he had no feelings about her and could not care less about her extermination. However, this personally connection that does exist between Jim and Sarah Kerrigan will make the meeting between the two of them more personal and the outcome more of an effect upon Raynor than was the effect on Riker when Riker has to attack and eventually rescue Picard after the Borg assimilated him into Locutus. Riker was able to save Picard; I doubt Raynor will have any choice except to kill his ex- when they meet on the battlefield.

Is there any reason Jim Raynor's saloon needs the trick neon signs I noted ("U pay ray", etc.) months back when I reviewed the game, or the jukebox in the corner? He's so far out in the boondocks (especially when "the boondocks" can be several million years from the center of civilization!) that his jukebox being broken would be a reasonable point, if it even had to have a jukebox.

No, the game's designers added a working jukebox, with playable music - which has absolutely no effect on playing the game - just as scenery. As I have done with the working revolving door.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

I didn't read any of that.

TEXT GAME PLAYERS: How many of you would prefer to dick with a revolving door to get in an out of a store rather than just going in or out of the store?

SPOILER: Every single respondent said "just get me in and out already, christ".

You have to do what the public deserves, and demands.
I don't have to say anything. I'm a doctor, too.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

pinback may sound like he's trying to razz you, but in all honesty, he's making a good point. A lot of modern IF players will howl with anger even if you have a locked door that doesn't automatically open if you have the right key for it, like:
>GO EAST
(unlocking the door with the skeleton key first)
Unlocked.

Inside the House
blah blah blah
Making a detailed world is one thing, but if you start requiring 12 commands where only one is necessary, people will tire of your game quickly. Food for thought.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

Roody_Yogurt wrote:Making a detailed world is one thing, but if you start requiring 12 commands where only one is necessary, people will tire of your game quickly. Food for thought.
I keep repeating this, over and over. The Revolving Door is a gimmick, it is not necessary to use it to solve the puzzle and is simply a type of background or backstory. It's done to add realism and flesh out the story and has no real purpose other than as decoration the user can play with. If the user tries to go through the revolving door, they have to push on the door. Then, they can only go OUT to the parking lot if they have turned it that way, or they can only go IN to the store if they haven't turned it in the first place or they turned it again.

If they go out to the parking lot, the only place they can go is back through the revolving door back into the store.

It is strictly a red herring, it has no effect on the story, it's just a toy for the player to play with. Like being able to turn on the television, notice it's running MTV, until the cable company's EAS test locks the TV on a blank screen. (This is a private joke, see my post about the weekly EAS tests every other day over on Caltrops.)

Or being able to throw the breakers in the <s>fuse box</s> breaker box, most of them simply turn the lights off in a room or disable devices in the kitchen. Not required, just a gimmick to give the player something to play with.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

It's a gimmick the player HAS to mess with, which is different (and way worse) than one that a player CAN mess with. A TV you can turn off and on is cute. A door that adds an unnecessary, extra step to going in and out of the store is an abomination in the eyes of Jesus, our Lord and Savior.
I don't have to say anything. I'm a doctor, too.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

pinback wrote:It's a gimmick the player HAS to mess with, which is different (and way worse) than one that a player CAN mess with. A TV you can turn off and on is cute. A door that adds an unnecessary, extra step to going in and out of the store is an abomination in the eyes of Jesus, our Lord and Savior.
Try again, Mr. Parish. I'm at least an agnostic, and possibly an atheist. Appeals to God are of absolutely no use on me. And when did you become a Christian? If you're not a Christian then Jesus is not your Lord and Savior. What can I say, I got rooked into becoming a Christian until I was informed that the entire religion was wrong, built on a house of cards that was waiting for the entire thing to come crashing down once someone exposed the fatal flaw. Thus I became an agnostic, and some people claim my standings make me more of an atheist.

And maybe I'm mistaken but I thought you were either an agnostic or an atheist as well, am I incorrect on this point?

Okay, I'll give you the information as to absolutely why the user DOES NOT HAVE to mess with the revolving door. The user will get to the store by way of the Tripkey, which is a personal teleporter. The user will get out of the store the same way, WARP, PORT or TELEPORT. The revolving door is a gimmick the player CAN mess with, and would only use if they want to.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

As long as you're sure there's no reason a player has to mess with the door, then Jesus Christ, and I, approve.
I don't have to say anything. I'm a doctor, too.

Post Reply