Controling randomly wandering NPC

I've been doing some game work with wandering monsters, using the “RandomNextUnlockedRoom” function and it works out quite well for the most part, but is there a way to block off certain rooms/exits from the path.

Its common that the monster finds a cul-de-sac, with 4 or five rooms leading off of it but no where else, thus having the monster pop in one..then out the the cul de sac, then move to another of the small rooms and never explore the rest of the game. Since the function is based on exits would I have to manually edit the function to remove various exits from the list as it was dynamically made?


You (or somebody) could extend RandomNextUnlockedRoom to ignore rooms with a certain attribute (e.g. "skipRandomWalk"), and then you could set that attribute on each room (or exit?) you don't want to visit (e.g. each room as it is visited).


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums