Entering room for 1st time after item has been introduced


I want to draw the attention to something in a room if it’s the first time a player has entered that room after something has been introduced into play.

The player leaves and enters Room A as much as they like.
The player pulls a lever in Room B and this opens a window in Room A and introduces a bird into play in Room A.
The player returns to Room A for the first time after pulling the lever and gets the comment of "now you realise what the lever was for…as the window is open and a bird has flown in’

This isn’t a real example of what I want to do, but would cover it.

So, what I’m looking for is the command that is ‘If the player is in Room A for the first time after Bird has been introduced into play’

Many thanks


Here’s one (simple) way:

The Lab is a room.  The window is a fixed in place thing in the lab.  It can be open or closed.  

Check opening the window:
	say "It seems to be stuck." instead.

Rule for writing a paragraph about the window:
	if the window is closed, say "There's a closed window here.";
	otherwise say "[one of]You realize what that sound was when you pulled the lever.  The window is now open and [a tiny bird] has flown inside[or]There's an open window here[stopping].".

East of the lab is the Foyer.  The lever is in the foyer.  It is fixed in place.
The tiny bird is an animal.

Check pulling the lever the first time:
	say "You hear the sound of gears turning.";
	now the window is open;
	move the bird to the lab instead.

Check pulling the lever:[this will fire on subsequent pulls]
	say "Nothing happens.  Maybe you broke it." instead.

test me with "open window / e / w / e / pull lever / g / w / l".

The [one of] text substitution is discussed in ch 5.6 “Text w/ random alternatives”. The [stopping] part removes the randomness and makes sure the first option prints only once, with the last option printing subsequently. I used [tiny bird] (in brackets) since that marks the bird as mentioned and keeps it from being mentioned again after that first time description of the open window. Notice that after that initial time, the bird gets it’s normal generic line in the room description.

I like Mike’s solution and would go for that myself, but here is an even more bare-bones example:

"Bird in Hand"

Use full-length room descriptions. 

The Greenhouse is a room. "The somnolence of orchids. [the bird in hand]". It can be open.

To say the bird in hand: if The Greenhouse is open, say "A blue bird flutters like mad.".

The Potting Room is north of The Greenhouse. "The richness of loam." A lever is here. It is fixed in place.Instead of pulling the lever the first time: say "You hear a click in the Greenhouse, then a flutter of wings."; now The Greenhouse is open. Instead of pulling the lever: say "You have already pulled it.".

test me with "n / s / n / pull lever / s / n / pull lever"

So there’s no window and no bird here. You could also nest the if clause from the ‘To say…’ in the room description itself, I believe.

As an aside, does anyone know how to suppress the ‘It’s fixed in place’ message when doing something to a fixed in place object?

You could, but I was under the impression that the poster wanted the special message to print once – the first time entering the room after the lever had been pulled – and then revert back to a more generic room description. I might have misunderstood, however. :wink:

Of course, in that case, you could still use the “one of / stopping” text sub. in the room description itself, instead of that whole “writing a parapraph about” thing.

Do you want to replace it in general, or with a specific action(s)?

Yeah, you’re right Mike, I think I didn’t get the gist of the OP.

For fixed in place, I want to suppress the ‘It’s fixed in place.’ message, maybe replacing it with a custom response. I couldn’t find anything on this searching RAIF, other than some I6 stuff that was beyond me.

Normally, this would be simple. There are three rules which print this message: The can’t take what’s fixed in place rule, the can’t pull what’s fixed in place rule, and the can’t push what’s fixed in place rule. (Actually, only the first one prints “It’s fixed in place”, the other two print “It is fixed in place”, but whatever.) Replacing those 3 rules with your own would be easy, but there’s a bug in the current version of I7 that has to do with rules with the word “in” in them. So the easiest way to replace all three is to get the latest version of David Fisher’s Default Messages extension from the I7 website and use it:

“raif1” by Mike Tarbert

Include Default Messages by David Fisher.

The Lab is a room. The table is a fixed in place thing in the lab.

Table of custom library messages(continued)
Message Id Message Text
LibMsg “Your message here.[/n]”
LibMsg “Ditto.[/n]”
LibMsg “Whatever.[/n]”

test me with “get table / push it / pull it”.[/code]

Note that cutting and pasting tables into the IDE tends to screw them up, so you might have to fiddle with the tabs.

If you’d rather add them by hand without using an extension:

[code]The Lab is a room. The table is an enterable supporter in the lab.

Check an actor taking something fixed in place:
say “Your message here.” instead.

Check an actor pushing something fixed in place:
say “Your message here.” instead.

Check an actor pulling something fixed in place:
say “Your message here.” instead.

test me with “get table / get on table / get table / push it / pull it”.[/code]
Although this is probably easier, it puts the fixed in place rule first(since it’s more specific). This doesn’t effect pushing and pulling, but it does slightly effect taking. Normally, the rules check taking something you’re on or in before checking whether or not it’s fixed in place. It’s only a slight change and probably doesn’t matter. You can see the difference by commenting out the check taking rule in the above code.

Cool, thanks Mike, great explanation.

Thanks for your help…though not a perfect solution for the real scenario I had in mind, it gave me enough to work with.

Many thanks

you may notice that my account is new but, I assure that I am not new to this community, it is simply that something so startling has happened to make me finally create an account here. It is that fact that Murphyz, aka, Micheal Murphy Age 37 from the U.K, has past away last year at 16 September 2013. In real life he was a farm hand employed by one Arthur Gibson and he turned the gun on his former employer and then turn the gun to himself.

Rest in Peace