Creating Random Encounters

Hello, I am trying to figure out how to generate random encounters in some of my areas. I tried to use the Wandering Monster system described here
But I cannot find the hc_areanm_hb script in the OnHeartbeat or anywhere else. Please help me, I also tried the mmorpg style monster respawner but couldnt get the script to compile in the OnDeath slot. Am I just placing it wrong?

The missing script is probably in the HCR system. The author refers to it, but the link is broken. You could try installing this:

though I can’t confirm that it’s up to date. Maybe other people here know where the latest version is. Failing that you could contact the tutorial author via the e-mail provided.

The MMORPG Style Creature Spawner Script compiles OK for me - maybe you missed a line, or added one, when you copied it?

Taking a step back, have you considered the regular Encounter system? If you want the monsters to scale in difficulty, you could use LevelUpHenchman in the monster spawn script.

I would probably be most interested in using the regular encounter system. I wish to place random encounters in wilderness areas that scale to the players level. The monster spawn script? Do you mean the monsters OnSpawn script or something else? Cause I looked in the OnSpawn script but didn’t find a LevelUpHenchmen function.

If the only randomness is with level then standard encounter is all you need.

But in light of the topic, if someone would be interested in an encounter (+waypoints based spawn system that:

  • will choose random group from multiple groups specified by builder
  • will choose random monster from a list of monsters inside group selected by spawn
  • can spawn each group on different waypoint
  • can spawn each monster in group on different waypoint
  • can specify minimum and maximum number of specific monster in group that must be spawned
  • can specify minimum and maximum number of monsters spawned for each group
  • can fire specified script for Enter/Exhausted/Reset

I can post it. But I heard everyone uses NESS so I didn’t see a point…

So I think what I am after here, is to generate random encounters inside specific areas, like wilderness areas, that scale to the players level. But I also want those encounters to respawn every time a player visits the area. Just to make sure that the player never runs out of monsters to fight while navigating the world.

The point is freedom of choice. Everyone currently using NESS might be because of a lack of an alternative. For me I’d say go ahead and post it. Most builders Know the quality of your work so may well at least give it a look.



That would be most interesting, so yes please @Shadooow

Hmm this must wait… the variables it uses are named in my language as it was made for czech-only module so I need to translate it and change the code.

It is also using OnRestart event, which is custom event that runs for each area/object in area from OnModuleLoad, the problem is that it requires either nwnx, NWN:EE or placing custom waypoint into every area where builder wants to use these encounters to make it work properly. This is because 1.69 doesn’t have GetFirst/NextArea functions. I might need to look into it and check if this is really needed before I publish it…

1 Like

Personally I find the default encounter system not bad at all.

My exterior areas are mostly 32x32 tiles so I can afford to make encounter trigger areas quite large too. The engine spawns the creatures within that trigger area but as far from the PC who triggered it as possible.

So if the player enterss the trigger area at 2 different times from 2 different directions the creatures will also be spawned at different places each time. Sometimes the player might not even realize that creatures have been spawned as he is out of their perception range but since the respawning timer only starts after all creatures from the last spawn have been killed that is not a problem.

I actually like this better than working with spawning points as it provides - at least during my playtesting - more randomness then placing 4-6 spawning points.

I have to admit though that this works best for wilderness areas where the player roams freely. Areas that are narrow, have bottlenecks or roads that invite the player to travel along them will need spawning points to provide randomness - and lots of them.

Which all is still useless if the creature list consists of only very few creatures per level. As a player I often found it heavily immersion breaking when the exact creature group respawned for the 3rd time in a row (and mostly in the very same place too).

And to add another 2 copper: For a SP module I would not create encounters for a wide level range. If the player is in an area adjecant to his “homebase area” and he encounters rats and bats at lvl 1-2, I would find it illogical if that area slowly becomes overun by bigger and bigger creatures with every level-up of the PC until he runs into a group of bears. Unless its a story element, the areas closer to the “homebase area” should become safer over time for the PC, not the other way around.

1 Like

this was my main concern when making my own spawn system

i wanted immersion, i wanted to have 3+ completely\ different spawn groups

default encounter can’t do that, it selects monsters based on level so unless same player visits same area again then it will always spawn same monsters (and spawning higher lvl monsters in same area is easily exploitable in PW too so nobody really uses that in multiplayer)
EDIT: maybe if all creatures in encounter has same CR it spawns them randomly I don’t have this tested, however that is still not ideal as not always CR matches and making dozen copies of same monster with different CR just so you can use it in various encounters is not user friendly

One problem I’ve with the default encounter system is that it is biased towards lower CR creatures. It would spawn multiple lower CR monsters before spawning any that have a higher CR. It tries to spawn the easiest encounter that would satisfy the difficulty requirements when I’d prefer to have the toughest encounter instead. The only way to mitigate this is to tell it to spawn exactly one monster, but then you had to paint multiple instances of the same encounter.

Based on above comments about NWN:EE, I’m assuming this thread is for NWN1. Not trying to hijack but I have a similar problem on NWN2. My NWN1 world uses spawn by waypoint, specific to that world (or maybe just the custom flags within the engine). In any event, I cannot for the life of me get mobs to spawn via waypoints in my NWN2 world. I’ve looked into NESS but it seems NWN1 specific. I’m trying to use RCSS v2.03 and have set the OnAreaEnter and OnAreaExit scripts for each area as instructed. I also have the area variables set appropriately. Looking through the sample module, there is a trigger in the area with an OnEnter script. I have replicated that trigger and written a matching script specific to my tag/resref that I wish to spawn in. Nothing seems to be working. Any advice?