Triggering text upon entering a room, but AFTER room description

I’m very new to this (and to coding in general), so if my formatting or code is awful please be patient… TT_TT

As part of my first project, i’m setting up an event that triggers each time the player enters a particular room, prints some text, then resolves a turn later, checking if the player is in the room or not.

Everything works perfectly so far, it’s pretty straight forward. My only issue is that using “After going to the ___:” causes Inform to skip the initial room description!

After reading through the manual i’m pretty sure I understand why this happens, and by using Carry On I was able to get it to print both the room description and my triggered text.

However… I can’t make it print the triggered text AFTER the description, no matter what I try!

Is there a beginner-friendly way to make this happen?

Here’s the entirety of the text (it’s super short):

The Green Room is a room. "This room is creepy. You hate it here."

West of the Green Room is the Red Room. The description of the Red Room is "This room is very spicy. Being in here causes you physical pain, but at least it isn't creepy." The player is in the Red Room.

To get creeped:
	say "You lose all sensation in your limbs as the Green Room overpowers you. You have become... Creepy.";
		end the story saying "You have perished! Your death was singularly unpleasant."
		
To dodge:
	say "You escape to the Red Room just in time. Ow. Ow. Ow."

After going to the Green Room:
	say "Something is Wrong. 
	The air in the room swirls...";
	the creeps strike in one turn from now.

At the time when the creeps strike:
	if the player is in the Green Room:
		get creeped;
	otherwise:
		dodge.
	
1 Like

The room description is produced by a Report rule (the “describe room gone into rule”). Your After rule runs before the Report rules (and actually stops them running at all unless you “continue the action”.)

There are several ways you could change the order. The easiest way is probably just to move the room description into your After rule like so:

After going to the Green Room:
    follow the describe room gone into rule;
	say "Something is Wrong. 
	The air in the room swirls...";
	the creeps strike in one turn from now.

(You may need to tinker to get the spacing right, I haven’t checked it. Don’t “continue the action”, or you’ll get a second room description when the Report rules run.)

By the way, the way to find out which rules are running, and when, is to use the Rules debugging command. Also, the Actions tab of the Index will show you all the rules associated with a particular action (in this case the going action), whether from the Standard Rules, from any extensions you might be using, or from your own code.

2 Likes

Amazing! Thank you so much!

I was searching and searching for a phrase that mimics that effect!

I haven’t had a good reason to poke the index much yet- I never would have thought to check there! ^^_^^