I intended to write a clean yet dynamic scripting solution that is easy to use and fun to master.
This is a no-scripting, no-triggers, variable and 2da-based Encounter system intended for persistent worlds. Its variable-based structure allows scripters to change the spawns dynamically for things like quest-related spawning or night-time encounters.
No scripting skills are necessary whatsoever for basic use. Included is a tutorial for builders who have never used 2DAs before.
Some features:
Variables to let builder customize how far apart creatures spawn and how long they take to return after dying (see code box). Form clusters in alleys or fill a massive valley with just one Spawner object.
High Level players can not ruin the game for lower levels because encounters do not cater to player level.
2da-based creature lists allows for easy adding and modifying of creatures without touching the toolset.
Build two groups of opposing factions to set up battlefields quickly and eaily.
ResRefs are selected using a formula to reduce the number of 2da calls and prioritize which resrefs are selected.
If you run a large PW that's been using encounter triggers up until now you should notice a MAJOR drop in file size after converting to this system.
This is the first version of this code and I am accepting requests and suggestions on how to improve it so that it is more appealing to PWs. Please contact me at my e-mail [email protected] with ideas, troubleshooting, or if you come across any bugs in the code.
Posted by Nailius at 2006-08-27 19:02:36 Voted 10.00 on 08/27/06
This is really easy to use a lot less complicated than using triggers or scripting, espcially for people like me who like an MMO type spawning system with a rare chance to special monsters to spawn, and the equasion can be used to make a loot system similar to this.
Good thing there aren't frequent calls to the 2DA then, huh? This script uses a formula to determine which monsters to spawn instead of a builder-given probability chart like most 2DA encounter systems. There are only 2 2DA calls when the script spawns a creature. The first is to see how many resrefs are in the column and the second is to fetch the resref in the row the formula chose. Assuming the 2da is cached most of the time, the CPU efficiency should be comparable to using local variables.
It's 2DA driven, doesn't it make too much lag? It is said, that frequent using of 2DAs is quite CPU expensive... Just a first thought, I will be checking it out anyway.. ;)
You must be Logged In to post comments in this section.