This article provides ways to get around Blades of Exile's somewhat touchy code for making NPCs appear and disappear.

>Date: Tue, 18 Aug 1998 10:25:52 -0700 (PDT)
>From: Marcy Kulic <nospam@space1999.net>
>To: spidweb@spidweb.com
>Subject: Making NPCs appear/disappear

>This might be something for the articles page. Others may find it useful.
>
>In my small scenario, I had based a pretty large chunk of plot around making
>some NPCs appear/disappear via a Major Event. When I began testing the
>scenario though, they wouldn't appear/disappear as expected. After some
>rooting around the Spider Web site I came across this:
>
>
>>I'm having a problem with making NPCs appear in towns after the player has
>>completed certain tasks. I place the NPCs in a town and set them to only
>>appear when a major event has occurred. When the player completes a certain
>>task related to the NPC, I use a Major Event Has Occurred node to set the
>>corresponding major event code. This should cause the NPC to appear.
>>
>>However, whenever I do whatever is necessary to trigger the Major Event
>>node, and go back to the town where the NPC is supposed to appear, the NPC
>>is not there. I have to go outside and type '>' to reset the town before
>>the NPC will appear. Interestingly enough, if I don't visit the town where
>>the NPCs are supposed to appear before triggering the Major Event special,
>>they appear normally.
>
>This is correct. The town gets saved, and the NPC doesn't appear until the
>town gets reset (when the party visits 4 other towns or dungeon levels).
>This is an unforseen result of the way the engine worked out, and, alas,
>all I can recommend is not having the major NPCs not work this way unless
>you have enough towns or dungeon levels for the party to visit to make sure
>the town the character is in resets. Sorry about that.
>
>
>There is a workaround for this. You can do this either to the town where the
>NPCs are supposed to appear/disappear, or the town where the Major Event
>occurred. It is best to use the one that is least visited as there are two
>noticable effects to the BoE player.
>
>The workaround: Create 3 identical copies of your town. At all exits, have a
>series of forced staircases that send you through the original town, then
>copy1, copy2 and copy3. At all entrances have a reverse series of forced
>staircases that send you through copy3, then copy2, copy1 and finally into
>the original town. This means that the player will have gone through 4
>towns, so your original town will be reset and the NPCs will
>appear/disappear as needed. Don't forget to set you outside town entry to
>copy3, not to the original town.
>
>Some caveats:
>
>-If your Major Event occurs outside you will need to put 4 copies on your
>original town, because the town where the Major Event occurs is the fourth
>visited town, the one that causes the reset.
>-The duplicates are much easier to handle on a town with limited entrances.
>I have mine on a cave with only one entrance, and I narrowed the entrance to
>2 squares wide so I only had to create 2 stairways in each direction. If you
>use an open town, you will have to create an entire hollow square of
>stairways in each direction. You can't copy the stairways either, because
>each one needs a unique destination point to make the transition between the
>towns smooth.
>-For a town with 3 duplicates you need 5 unobstructed spaces at every edge
>of town, to have enough room to place all the stairways correctly. For a
>town with four duplicates you need 6 unostructed spaces. By unobstructed I
>mean no specials, no doors that need to opened, etc. Walking through things
>like an open portcullis is fine. This is the stairway system I use:
>
>     __________________________________________________
>    |  Entry  |       | copy3 | copy2 | copy1 |       |
>    |  Square |       |  ->   |  ->   |  ->   |       |
>    |         |       | copy2 | copy1 | town  |       |
>    | _________________________________________________
>    |         | copy2 | copy1 | town  |       |       |
>    |  Entry  |  ->   |  ->   |  ->   |       |       |
>    |  Square | copy3 | copy2 | copy1 |       |       |
>    ___________________________________________________
>
>This ensures that the party can not get to the interior of copy1, copy2 or
>copy3.
>
>-There are two ways the player can tell something is up. The first is that
>instead of receiving the message "Moved: East" they will get "Now entering:
>town2". The second is if they have a map up. Each change of town causes a
>flash, and if they have fully mapped the original town, they will see the
>map change to the incompletely mapped town1, town2 and town3. I have played
>through it several times and it isn't that conspicuous. As a result of this,
>try and make the duplicated town someplace that isn't visited often; a
>one-shot dungeon is perfect.
>
>Other problems:
>
>After doing all this correctly I got my new NPC to appear, but the old one
>wouldn't disappear, despite everything being set correctly. I wound up
>having to use the if-then node on a stuff done flag set by the Major Event
>coupled with the Destroy Monster node upon town entry.
>
>Major Events are numbered 0-9. My Major Event was originally event 0, but in
>the Event Code box under Advanced Monster Editing, 0 means not tied to an
>event.
>
>Many thanks to Ivan who helped me refine the multiple town idea and
>suggested the Destroy Monster node workaround to the problem of the
>non-disappearing NPC.
>
>PS to Spiderweb only: If you post this, please change my email address to
>nospam@space1999.net. Thanks!