Performing actions when first entering a room

Hello all, I’m sure this is somewhat easy and obvious, but I am not having a lot of luck executing a command when the player first enters a room. My approach has 3 problems:

  1. the player does not go anywhere in the first turn of the game
  2. ‘After’ cuts off bolded room name and room description when entering the next room
  3. While starting does not count as entering, the second time to enter must be considered the second because the command doesn’t execute.

What would be a better way to do this?

exit listing is an action applying to nothing.
understand "exits" as exit listing.
understand "t" as exit listing.

after going to a room for the first time:
	try exit listing.

the industrial kitchen is a room.
The description of the industrial kitchen is "kitchen".
the pantry is south of the industrial kitchen.

carry out exit listing in industrial kitchen:
	say "Until you get off work, the only important exit is south to the pantry.".
	
the pantry is a room.
the description of the pantry is "pantry".

carry out exit listing in pantry:
	say "You can return to the kitchen by heading north."

I think this does what you want:

exit listing is an action applying to nothing.
understand "exits" as exit listing.
understand "t" as exit listing.

A room can be exit-listed.

carry out looking when the location is not exit-listed (this is the list exits rule):
	try exit listing;
	now the location is exit-listed;
	
The list exits rule is not listed in any rulebook.
The list exits rule is listed last in the carry out looking rules.

the industrial kitchen is a room.
The description of the industrial kitchen is "kitchen".
the pantry is south of the industrial kitchen.

carry out exit listing in industrial kitchen:
	say "Until you get off work, the only important exit is south to the pantry.".
	
the pantry is a room. "pantry".
the description of the pantry is "pantry".

carry out exit listing in pantry:
	say "You can return to the kitchen by heading north."
1 Like

That did it! Thanks.

I believe you don’t need the line

The list exits rule is not listed in any rulebook.

This line should be sufficient by itself:

The list exits rule is listed last in the carry out looking rules.

…if it isn’t sufficient, I’d like to know

2 Likes

Yes, that seems to work ok.

1 Like