Any easy way to make your NPC waits for one or several turns?

I want the player to follow a character and delay the disappearance of the NPC for one turn to give the player enough time to enter the room and see a relevant piece of information concerning the way this NPC enters a creak in the wall. I was trying to modify the Every turn code to delay the say “” command and the “now X is nowhere”, but I don´t know how to do that.
Is it possible to make this with a simple easy line or do I have to make something more complex?
Thanks in advance.

The good news is there are many easy ways to do this! They might not all play equally well with how you’ve already got things set up, though – if you post the code you’re currently using, I’m sure folks can suggest tweaks to add the delay.

1 Like
Every turn:
	if the monster is marching:
		if the monster is in Gloomy Place:
			if the monster is visible:
				now the monster is not active;
				now the monster is not marching;
				wait for any key;
				say "The monster is perspiring, takes a rest...";
				wait for any key;
				say "... And it disappears through a hole ...";
				now the monster is nowhere;

I have modified the original text for something equally functional. It is so lame it is embarrassing, but I hope you get the idea… Thanks!

1 Like
...if the monster is in the Gloomy Place:
    the monster disappears in one turn from now.

At the time when the monster disappears:
    now the monster is not active;
    etc...
2 Likes

Thank you, but it didn´t recognized “the monster disappears”. Maybe because I am in (build 6M62)?

I suppose I could delay the messages setting a timer when the monster arrives to Gloomy Place, isn´t?

You don’t need much of a timer.

alice has a room called previous location.
before doing anything: now the previous location of alice is the location of alice.

every turn when Alice is visible and the location of Alice is the previous location of alice:
try alice going west. [or whatever...]

With this, Alice will always wait for the player to appear before leaving but she always leaves immediately, so the player sees where she goes. (There’s a one turn lag if they start the game in the same room, but I’m guessing that won’t really be the case.)

2 Likes

This works for me in 6M62:

Alpha is a room. Beta is north of Alpha.
Every turn when the location is Beta:
	say "Scheduled.";
	the monster disappears in one turn from now.
At the time when the monster disappears: say "Disappeared."
1 Like

Thank you, Daniel. I don´t know if I am doing something wrong, but it still don´t recognize the verb. I will check the list of actions in case there is a problem with that.

Thank you, Zed. I have managed to create a rule for that NPC´s special behavior when the variable gets triggered, but my NPC is being unruly. As I am a beginner it could be that there is another fragment of code in collision with this because it seems a very good solution.

Thank very much you to both of you!

1 Like

“Disappears” isn’t really a verb here. “The monster disappears” is just the name of a scheduled event. You won’t find it under Index > Actions; it’s under Index > Scenes > Events.

Alpha is a room. Beta is north of Alpha.
Every turn when the location is Beta:
	say "Scheduled.";
	Hamlet proclaims to be or not to be in one turn from now.
At the time when Hamlet proclaims to be or not to be: say "Disappeared."

works exactly as well. Now, you want to name your events something that matches what they do, for ease of reading and understanding, but in theory this sort of thing is just an arbitrary name.

2 Likes

Ah, thank you for clarifying that. I see, I was looking for something easier than creating a scene, but this is interesting. I will try that. Thank you!