Reporting the location of wandering NPCs?

Hello, errrrveryone.

Let’s say I have a small cliff in a game whereupon the player can overlook a small village wherein I have wandering NPCs. I have the NPCs wandering with Michael Callaghan’s Patrollers extension. Let’s say the NPCs are all activated and wandering the various rooms that make up the village.

Can anyone tell me how to report these locations to the player in Informese? I’ve tried a few things and I’m coming up short.

Thank you!

I’m not sure what you’re looking for. How would you like it to work? You mean you’d like some sort of overview listing where people are? Can you give us an example of what you’d like the game to print?

Would you really be able to identify people from up there?

Good questions. Basically, I want the player to look down on the village and, if any wandering NPCs are in the “Exterior” (a region), then I want the game to print something like:

If they have to be separate lines, that’s fine, too.

I hope something like this is possible?

How about something like this? (kind of rough code, needs some refinement)

every turn when player is in cliff:
	say "From here you can see that [run paragraph on]";
	repeat with someone running through persons who is not the player: 
		if someone is in the exterior:
			say "[The someone] is in [location of someone][run paragraph on], ";
	say "[paragraph break]".

Thanks, Harpua, I will try that out! :smiley:


I’ll be damned. I had to tweak it very little and it worked! I would paste the code to illustrate, but I have a little more tweaking to do to ensure the grammar looks acceptable. Thanks again!

I have a similar thing I want to do in my game and I was just wondering what extension might fit best. I want the NPCs to undertake some actions at certain times, e.g. walk from one room to another one several rooms away, then pause for a while engaged in a conversation (that could be overheard), then going to a different location, picking up or dropping some objects, later going to another location etc. However, they are not “patrolling” per se; in other words, these are one time routes, not repeated loops etc.

Would the Patroller extension be a good fit for this or is there something that would be easier?

Thanks much!

Yes, I think it would be a good fit, or to at least check it out. You can set if the patrollers as aimless, fixed path, repeating loops. You can activate/deactivate at certain times. You can check out the documentation on the Inform7 site. :stuck_out_tongue:

I had never looked at that extension before you brought it up tonight…but it looks pretty cool. Looking forward to finding a use for it.

I was writing a scenario, a small part of the game, which had City Guards working various areas and with different behaviours depending on what the player had done/not done. This looks perfect :slight_smile: