Reporting the location of wandering NPCs

I was recently having a discussion with Marshal Tenner Winter on the forums about having your PC standing on a high point where they would be able to peruse the landscape around them and see other NPCs in other locations.  The goal was to print out the locations of each NPC in a friendly way.

Here is some code I came up with that seemed to the trick and only really needs some tweaks to look more grammatically correct or visual appealing.

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]".

I could seem some tweaks and enhancements to this that would need to be made:

    1. Need to check if the location is actual visible from the high vantage point, this code does do that to a certain degree (by region, in this case the region exterior, assuming ALL of exterior is visible from this vantage) and that may be enough. But let’s say your vantage was up a high tree and not only could you see those locations outside, but perhaps also inside just a few rooms in a house that you’re peeping into.
    2. Grammatically, the code above produces some awkward sentences, tweaks would need to be made to conjunctions, location printed names, things like that.

I can see quite a few uses for this and is a nice little piece of code that I’ll keep around.

.

Advertisements

One thought on “Reporting the location of wandering NPCs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s