The way I'd be inclined to handle the problem is to use a single NPC in each room whose first command is to check whether the player is "
at"
one of the entrances Halph should enter from and then exactly which tile he's in, and then run a 5-turn loop where it tries to either teleport itself there and "
Turn into monster"
or use Generate Entity Halph.
If you're saying you want to put an NPC at each tile Halph could possibly appear at (for your own map-visibility purposes I presume?) then you could put a simple script on each of those NPCs that essentially says "
Is the player on top of me?"
at turn 0, and if the answer is yes they can set a variable to say which tile the generating/halph-becoming NPC should go to, which would eliminate the need for said NPC to "
find"
the right tile in any way and allow it to only be the 5-turn loop of "
trying"
to appear.
____________________________
109th Skywatcher
Here are some links to Things!
Click here to view the secret text