by Barry_1066 » Sun Jul 25, 2010 1:14 am
Some of this is posed elsewhere and all but the newest features are in the docs on NWNVault for download but here again is the information:
The Sparky Spawn system looks for string variables on the area entered
and processes them. The variable names should take the form
"encounter_<xx>", where "<xx>" is a two digit number. Encounters should
start with "01" and proceed sequentially - skipping a number will
case the script to stop loading encounters.
The basic form of a v2 Sparky Spawn encounter variable is:
v2, active hours, percentage chance, <encounter entry>
v2: The identifier for version 2 of the database structure.
active hours: The hours this encounter will be active. Valid
entries include day, night, always, or a range of hours (6-12).
percentage chance: What chance the encounter has to run. 100 for
always run.
<encounter entry>
Several different types of encounter entries are supported:
creature, <resref>, <amount>, <location>, <offset>, <random walk>, <continue>
placeable, <resref>, <amount>, <location>, <offset>, <continue>
item, <resref>, <amount>, <location>, <offset>, <continue>
script, <script name>
table, <table name>
amount: Can be a simple number (5) or a range of numbers (3-7).
random walk: 1 to make the spawns random walk.
continue: 1 to continue loading encounters if this encounter fires.
location: There are several ways to provide the encounter's location...
waypoint: <waypoint tag> (uses the location of the waypoint)
object: <object tag> (uses the location of the object)
location: <n>x <n>y <n>z (uses provided vector coordinates)
(zenith coordinate optional)
random (uses a random location)
last (uses the last (previous) location)
offset: If an offset is provided with either a waypoint, object, or location,
each spawn will be created at a random distance up to <offset> meters in a
random direction from the reference location.
circle: Prefixing any other location type with circle: will cause the spawns
to form a circle around the reference point, with a radius of <offset>.
circleflip: same as circle except the facing of the placeable is flipped 180 degrees.
script: Runs the script of the specified name.
table: Rolls d100, and checks the results on the specified encounter table.
Encounter table variables take the form of "table_<tablename>_<xx>", where
"<tablename>" is some name you wish to call it, and "<xx>" is the entry number.
The general form is as follows:
<percentage chance>, <encounter entry>
where "<encounter entry>" is the same as those listed above.
aliases
npc = creature
prop = placeable
loc = location
wp = waypoint
The second to the last field tells what action will take place. 0 = no action,
1 = random movement,
other actions for the sparky v2 spawner action field.
walk,
spasm,
threaten,
laugh,
talk,
beg,
worship,
pray,
conjure1,
conjure2
Traps:
format:
trap(s), strength, type, amount, size, detect DC, disarm DC, recoverable, continue
strength - one of: minor, average, strong, deadly, epic, random
type - one of... well, all the many types, plus random
size should be a floating number - 1.0 is the minimum size, 2.0 the normal size
detect DC is either -1 for undetectable, or the DC to detect the trap
disarm DC is either -1 for not disarmable, or the DC to disarm the trap
recoverable is either 0 for unrecoverable, or 1 for recoverable
and continue, of course, is the legacy field to continue (or not) to load encounters
sparky0622.hak location field now accepts facing: add "@ <fAngle>" to the end of the location field,
where <fAngle> is the facing, floating point. added commands:
"@@sparky despawn" - removes spawns from the current area
"@@sparky respawn"/"@@sparky spawn" - removes any existing spawns, then forces a respawn
"@@sparky list encounters" - lists the encounter variables and their values
@@sparky list table <table name>
@@sparky list group <group name>
These scripts can be removed:
sparky_debugger, spawn_debug, enc_aisstog, enc_checkaiss, enc_aissmenu
ex:
v2, always, 100, trap, epic, random, 1.89, 19, 21, 1, 1
Now, let's have some examples!
v2, always, 100, script, scriptname
run script "scriptname" any hour of the day, 100% chance
v2, day, 100, npc, vendor, 1, wp: WP_Vendor, , 0, 1
active during day hours
always spawns 1 vendor at WP_Vendor, no random walk
continues to load encounters
v2, 22-0, 25, creature, thug, 2-5, location: 20x 25y, 8.25, 1, 0
only active between 10pm - 12:59am.
25% chance to spawn 2-5 thugs within 8.25 meters of (20, 25)
thugs random walk
does not continue to load encounters
v2, night, 25, table, slums
active during night hours
25% chance to make a roll on encounter table "slums"
v2, always, 25, creature, 10-15, circle: object: nw_kobold005, 3, 0, 1
always active
25% chance to spawn 10-15 in a circle around a kobold shaman, 3 meter radius
no random walk
continue loading encounters
v2, always, 100, prop, zep_chairs005, 8, circle: object: MiskUTable06, 2.5, 1
v2, always, 100, prop, hard_chest005, 8, circleflip: location: 79.19x 102.92y, 2.5, 1
Working Format:
encounter_01 (encounter_XX)
String (the variable string setting)
v2, day, 50, npc, missusbrewer, 1, wp: BrewersDroopTavern, 8.25, 1, 1
v2, day, 50, npc, shy, 1, wp: WP_Shy,, 1, 1
v2, day, 60, npc, nw_oldman, 1, location: 109.17x 76y, , 1, 1
Sheep Group
v2, always,100, npc, sheepfleece,5-9, location: 60.07x 117.17y,8.25, 1, 1
v2, night, 80, npc, cherri002, 1, location: 37x 9y, 1.25, 1, 1
v2, night, 45, npc, sambarleywine, 1, location: 55x 20y 5.00z, 1.25, 1, 1
v2, night, 25, placeable, herb_belladonna, 1-5, random, , 1, 1
night only
placeable
herb spawns 1 - 5
Random locations
v2, always, 100, prop, zep_chairs005, 8, circle: object: MiskUTable01, 2.5, 1
spawns chairs in a circle
uses a placed table tag as the spawn location
offset from the table is 2.5 meters.
***************************************************************************
Tables:
there's two issues
first, the table encounters look like this: v2, 75, table, night
you're missing the active hours: v2, night, 75, table, night
second, the table entries themselves are not quite right....
for a table encounter, it rolls d100, then looks it up on the table - it will stop looking once the die roll is LESS THAN the entry's chance to spawn... so you will only hit entries 3-6 if d100 is greater than 70 - and then it would always run encounter 3
and I have another correction - the encounter type is missing
encounter_01 string v2, night, 75, table, night
table_night_01 string 25, creature, nw_kobold002, 2-5, random, , 1, 1
table_night_02 string 45, creature, crp_troll02, 1-2, random, , 1, 1
table_night_03 string 50, creature, zep_grayoozes, 1-3, random, , 1, 1
table_night_04 string 60, creature, zep_gobspidrider, 1-5, random, , 1, 1
table_night_05 string 80, creature, zep_goblinworgg, 5-8, random, , 1, 1
table_night_06 string 100, creature, zep_owlbear, 1-2, random, , 1, 1
oh... hmm
you must have an entry for 100%
maybe change the percentages to 25, 45, 60, 80, 100?
encounter_01 string v2, always, 75, table, lvl1
table_lvl1_01 string 25, creature, nw_kobold002, 3 - 12, random, , 1, 1
table_lvl1_02 string 35, creature, crp_troll02, 1-2, random, , 1, 1
table_lvl1_03 string 45, group, skelly
table_lvl1_04 string 50, creature, zep_grayoozes, 1-3, random, , 1, 1
table_lvl1_05 string 60, creature, zep_gobspidrider, 1-2, random, , 1, 1
table_lvl1_06 string 75, creature, nw_ghoul, 1-2, random, , 1, 1
table_lvl1_07 string 80, creature, zep_goblinworgg, 5-8, random, , 1, 1
table_lvl1_08 string 100, creature, zep_skelogre, 1-2, random, , 1, 1
group_skelly_01 string npc, zep_skeldoll2, 3 - 5, random, , 1, 1
group_skelly_02 string npc, zep_skelyellow, 1 - 3, random, , 1, 1
group_skelly_03 string npc, zep_skelpurple, 1 - 2, random, , 1, 1
group_skelly_04 string npc, zep_skelflaming, 1 - 2, random, , 1, 1
*******************************************************************************
encounter_01: v2, 75, table, elemental
table_elemental_01: 25, zep_elemwaters, 3-5, random, , 1, 1
table_elemental_02: 50, zep_elemfires, 5-7, random, , 1, 1
table_elemental_03: 75, zep_elemairs, 4-6, random, , 1, 1
table_elemental_04: 100, zep_elemearths, 4-6, random, , 1, 1
75% chance of rolling on this encounter table, which will then roll for elemental type...
adds the "group" encounter type. this is merely a
group of encounter entries, each in a separate string.
example: if you want to spawn the Pye sisters...
encounter_01: v2, day, 50, group, pye
group_pye_01: npc, cherri, 1, random, , 1, 1
group_pye_02: npc, cherri001, 1, last, , 1, 1
group_pye_03: npc, cherri002, 1, last, , 1, 1
first example puts all three together in the same place -- the next example places the
group members scattered.
group_pye_01: npc, cherri, 1, random, , 1, 1
group_pye_02: npc, cherri001, 1, random, , 1, 1
group_pye_03: npc, cherri002, 1, random, , 1, 1
********************************************************************************
This feature allows one to call use a creature not on the palette but in a specific area
in the module. The, for instance, can allow for some custom spawns that are repeating -
or allow for some custom spawns in towns that, if they are killed, will respawn and no
longer be gone until server restart.
How I use this -- I have some high level creatures with custom equipment -- lets take the
4 horsemen of hell for an example. If i put these 4 on the palette i have to add all their
custom gear and other custom items as well. A total of 50 palette entries for adding 4 high
level custom creatures.
Instead, i have none of this stuff on the palette. The four horsemen are kept in a special
area (not required but helps keep them safe until needed) and then called by the
spawner.
Format:
v2, copy, area tag, object tag, new tag, aamt, location, offset, action, continue
v2, copy, area tag, horseman, horseman, 1, random, , 1, 1
So for my four horsemen custom creatures i have setup the C.R.A.P. Demo Area with
cells to place creatures and keep factions isolated. Here are the four spawner calls:
v2, always, 100, copy, DemoArea, War, , 1, random, , 1, 1
v2, always, 100, copy, DemoArea, Famine, , 1, random, , 1, 1
v2, always, 100, copy, DemoArea, Pestilence, , 1, random, , 1, 1
v2, always, 100, copy, DemoArea, Death, , 1, random, , 1, 1
or
v2, always, 100, copy, DemoArea, War, , 1, location: 160.01x 174.07y,8.25, 1, 1
v2, always, 100, copy, DemoArea, Famine, , 1, location: 160.01x 174.07y,8.25, 1, 1
v2, always, 100, copy, DemoArea, Pestilence, , 1, location: 160.01x 174.07y,8.25, 1, 1
v2, always, 100, copy, DemoArea, Death, , 1, location: 160.01x 174.07y,8.25, 1, 1
I have left the new tag section blank, it must be there but no change will occure
if it is blank.
format for Sparky Traps:trap(s):
strength, type, amount, size, detect DC, disarm DC, recoverable, continue
* strength - one of: minor, average, strong, deadly, epic, random
* random type - one of... well, all the many types, plus randomsize should be a floating number - 1.0 is the minimum size, 2.0 the normal size
* detect DC is either -1 for undetectable, or the DC to detect the trap
* disarm DC is either -1 for not disarmable, or the DC to disarm the trap
* recoverable is either 0 for unrecoverable, or 1 for recoverable
* continue, of course, is the legacy field to continue (or not)
to load encounters you can leave the detect DC, disarm DC, and
recoverable fields blank
v2, always, 100, traps, strong, random, amt, size, detect dc, disarm dc, recoverable, location, offset, continue
v2, always, 100, traps, minor, random, 5 - 10, 2.0, 15, 10, 1, random, , 1
v2, always, 100, traps, average, random, 5 - 10, 2.0, 15, 10, 1, random, , 1
v2, always, 100, traps, strong, random, 5 - 10, 2.0, 15, 10, 1, random, , 1
v2, always, 100, traps, deadly, random, 5 - 10, 2.0, 15, 10, 1, random, , 1
v2, always, 100, traps, epic, random, 5 - 10, 2.0, 15, 10, 1, random, , 1
v2, always, 100, traps, strong, random, 5 - 10, 2.0, 15, 10, 1, random, , 1
table_lowtraps_01 string 35, traps, minor, random, 5 - 10, 2.0, 15, 10, 1, random,, 1
table_lowtraps_02 string 70, traps, average, random, 5 - 10, 2.0, 15, 10, 1, random,, 1
table_lowtraps_03 string 100, traps, strong, random, 5 - 10, 2.0, 15, 10, 1, random,, 1
*********************************************************************************
sparky1023.hak group and table names are now converted to lowercase
spawn from MCS
you may now specify a new tag for creatures, items, and placeables
new actions: "dead", and "corpse"
v2, always, 100, mcs, 10, DMFI Ghoul, random, , pray, 1
10 is the specific MCS unit number, in this case, the storage unit for Undead
Look at the tag to the the number.
v2, always, 100, mcs, 5, Hydra L, random, , walk, 1
v2, always, 100, mcs, 13, Sheep - Powerful, random, , walk, 1
Containers:
3 --- Animals
4 --- Constuct
5 --- Dragon
6 --- Elemental
7 --- Giant
8 --- Humanoid
10 -- Undead
11 -- NPC
12 -- Misc Monster Storage
13 -- Hell/Epic
************************************************************************************
Spawning Stage Manager Widgets:
sms, crate number, widget name, location, offset, continue
example:
v2, always, 100, sms, 01, Galadriel's balcony, absolute, , 1
crate number MUST be two digits... 01 instead of 1
New option: if you put "absolute" as the location, sms will spawn with absolute coordinates
and orientation... otherwise, it will be relative coordinates and orientation, using the
location/offset you specify
Do not forget that you can specify facing in a location field
Some options will not work. like circle... kinda meaningless to a stage manager set
Dark Forest Lathine City encounters:
encounter_01 v2, always, 100, sms, 01, Galadriel's balcony, absolute, , 1
encounter_02 v2, night, 100, static, zep_bflame003, 1, location: 137.04x 108.30y 29.63z, , 1
************************************************************************************
Spawning from a trigger or from a placeable like a chest:
Place the spawner_onenter script in the OnEnter node of the trigger.
Place the spawner_onenter script in the onOpened node of the placeable.
Enter your variables on the trigger or placeable.
************************************************************************************
The Sparky spawner will now create/copy items onto creatures and placeables with inventories
The trap, item, and copy options will also accept "object: last" (or "obj: last") as a location.
this always equates to the last creature or placeable spawned by the spawner --
So you could:
1) spawn a chest
2) spawn items into the chest
3) trap the chest
All without having to have a unique tag for the chest
************************************************************************************