2nd instant camera like "claims adjustment"

The code above ("move n to next;") does not print a message when it moves the NPC, so I think that can cause a confusing output where the player comes to a location, sees the NPC, and then the NPC is silently whisked away.

One way to print a message is to use the built-in actions, as in “try n going …”, but then you need to supply a direction instead of a room. And to avoid the NPCs bumping into walls, you need to define the viable directions; that’s no big problem, but you need to consider the viable directions not from “the location” (because that’s the location of the player), but from the location of the NPC.

Another way would be to simply add the messages yourself, like this:

Every turn:
	repeat with T running through tourists:
		if ambulatory of T is true:
			if T is visible, say "[T] wanders off.";
			move T to a random room adjacent to the location of T;
			if T is visible, say "[T] arrives.".

See also 7.13. Traveling Characters (the example “Mistress of Animals”, but the others are also interesting).

Edited to add: Ninja’d by Mike. :ninja: :smiley:

1 Like

Just to check, are you sure the understand person by their name property bit is working? Maybe the issue isn’t scope, it’s the tourists not being addressable by the name you’re using.

I just added the “[T] arrives…” as it was the simplest solution. Thank you all for your great help!

2 Likes