Spawn random traps on the ground, objects or doors:
Spawn a random trap on any or all objects or doors in an area, dependant on the percentage and category type set by the user and also random locations within the area.
If the trap is disabled or triggered it will respawn after a user set delay.
The traps can be stock Bioware traps or custmomize any or all of the settings to suit your module.
Full instructions for respawning random traps:
==============================================
1) Open the area propeties and in the OnEnter event add the script:
se_oea_rsp_traps
Optional - You can set a local float TRAP_AREA_TIMER = (in seconds) on each,
area for faster or slower respawns otherwise the default is used,
see se_inc_resp_trap.
2) Place the invisible object with the tag INVIS_TRAP_SPAWNER_RANDOM,
anywhere in the area.
3) Set a variable(int) on the invisible object to choose the percentage
chance of creating a trap on each object or door in the area.
TRAP_PERCENTILE int = 25 (25% chance of trapping each object/door)
*Note - If the trap percentile is not defined it will default to 50%
4) Set a variable(float) on the invisible object for the trap size.
TRAP_SIZE float = 2 (ie. 2 game meters)
*Note - If no trap size is defined it will default to 1(ie. 1 game meter)
5) Set a variable(int) on the invisible object for the trap strength.
TRAP_TYPE int = 1 (ie. 1 Minor, 2 Average, 3 Strong, 4 Deadly, 5 Epic)
A random trap will be selected from that category.
*Note - If no trap type is defined it will default to 2(Average)
6) Trap DisarmDC is randomly chosen depending on the trap type category ie:
1 Minor = 25 - 35 DC range
2 Average = 25 - 35 DC range
3 Strong = 30 - 40 DC range
4 Deadly = 35 - 45 DC range
5 Epic = 50 - 60 DC range
This can be set to suit your module (see se_inc_resp_trap)
7) For random ground traps place a waypoint tagged RANDOM_GROUND_TRAP_LOCATION,
in various places in the area that will suit a ground trap position.
When the spawner scans the area for objects, depending on the percentile,
each one of these may have a random trap spawned at their location.
*Note - If no trap size is defined it will default to 1.0
(This is not totally random but gives the builder control of where the,
random placement of these traps will/can occur)
8) To ensure a placeable or door is always trapped set this local int on it:
TRAP_ALWAYS int = 1
9) To ensure a placeable or door is never trapped set this local int on it:
TRAP_NEVER int = 1
10)If you want the random traps to be randomized each time a player enter
set this local int on the spawner:
RANDOMIZE_EVERYTIME int = 1
This will remove all previously spawned traps and randomly select new,
objects and locations for the new ones.
11) New optional setting(new to v2.6)
PRESET_TYPE int = 1 to 11
If set that type of trap will be selected rather than a random trap.
PRESET_TYPE int = 1 to 4
(Epic only)
1 = ELECTRICAL
2 = FIRE
3 = FROST
4 = SONIC
12) Optional settings(new to v2.7)
TRAP_DETECTABLE int = 1 (Non-Detectable)
TRAP_DETECT_DC int = 1 to 250
TRAP_DISARM int = 1 (Non-Disarmable)
TRAP_RECOVERABLE int = 1 (Non-Recoverable)
TRAP_MULTI_SHOT int = 1 (Multiple shot traps, new to v2.3)
Optional: Reward XP to the disabler of the trap.
Full instructions are within the read me or play the demo module.
v2.3 added SetTrapOneShot() to the optional settings - 1st May, 2006
v2.4 added optional setting, randomize trap placement every time a player enters - 7th May, 2006
v2.5 minor bug found and fixed
v2.6 added an optional setting to predetermine the type of traps to randomly spawn in the area ie. frost, fire, acid ect.
v2.7 the random trap spawner object can now handle optional settings
This is awesome! I'm using it for my NWN2 PW and it works just as well! _________________________ ShockWolF - Author of Wulverheim Zhjaeve ? Know that I must begin every sentence with the word ?Know?. Know that everything I say must be known. Know that it is important that you know this.
Posted by Sir_Elric at 2008-02-2513:49:06
Only standard traps. Adding custom traps to this package would require some 2da editing and extensive changes to the core code. _________________________ City of Melnibone ausnwn.dyndns.org:5121
Posted by Serrahn at on02/21/08
well just a little maybe stupid question. what about selfmaded traps? like traps with a bigby spell when triggerd. does ur script place them too or just simply the nwn standard traps? so far i just have to say same as most others above: realy a great work. greetings Serrahn
Posted by Jargh193 at on02/07/08
Sry for duoble post...but scripters should take note and follow in SEs footsteps with the script names. Easy to find to modify or even remove by looking for the scripts with the SE_ at the begining.
Posted by Jargh193 at on02/07/08
I forgot all about this script when making Liffe, but when goofing off on another Mod I was helping on (Asvhbourne) I saw it and felt really stupid for not remembering it. Truely a great script, Rates up there with the NESS and DMFI for must haves in a PW.
Posted by Poetic at on01/20/08
Changing vote to 10/10 for ease of use and also for author's through documentation and willingness to help. _________________________ Poetic Colossus
Posted by Poetic at on01/20/08
Truly beautiful piece of work bro - this bad boy is going into little PW project. _________________________ Poetic Colossus
Posted by sporaxis at on12/22/07
Actually upgrading my vote. Review, interation and rapid turn around on adding extra functionality pushes this to a 10. _________________________ Sporaxis "Smashing other peoples bits together to make a better world" blog: Link
Posted by sporaxis at on12/22/07
Sir Elric, Awesome work and thanks, very much appreciated the timely and rapid code update. Impacts two PWs, so very happy. Sporaxis _________________________ Sporaxis "Smashing other peoples bits together to make a better world" blog: Link