Before going somewhere

Dear all,

before the player goes somewhere I want to check whether the target room has a certain attribute. “before going somewhere” seems useful, but what is the “name” of the target room? Like,

A room can be A or B. Before going somewhere: If the XXX is A, do this and that;

What is the word for XXX?

Thanks and kind regards,
G.

I don’t know whether this is the best way, but it seems to work:

A room can be good or bad.

The Kitchen is a room. The Kitchen is good.

The Playroom is south of the Kitchen. The Playroom is bad.

["Before" line taken from Recipe 213 Eddystone]
Before going from a room (called source) to a room (called destination): 
	if the destination is bad:
		say "You enter what seems to be a bad room..."
Kitchen

>s
You enter what seems to be a bad room...

Playroom

>n

Kitchen

>
2 Likes

It compiles…

…and it works! Thaaanks! <3

1 Like

Inform already has variables for the source and destination, called the “room gone to” and “the room gone from” so you can just write:

Before going: 
	if the room gone to is bad:
		say "You enter what seems to be a bad room..."

But you can even just have:

Before going to a bad room:
	say "You enter what seems to be a bad room..."
4 Likes