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
@ sporaxis; I have tweaked the code so you can now pass optional settings to the random trap spawner object as requested, such as TRAP_DETECTABLE = 1 Setting optional variables on the random trap spawner object will pass them to the random traps that are spawned(note that specific trap spawner objects in the same area will use their own settings and will NOT be overridden by these changes). Merry Xmas! _________________________ City of Melnibone ausnwn.dyndns.org:5121
Posted by issendriel at on12/20/07
Tested the system and was extremely impressed with it. It works exactly as described, adding a lot of flavor and mystery to traps. Players will no longer take for granted that they ever "know" a dungeon inside out with this system installed. As usual, great work Sir Elric. Thank you once again for your great work and awesome scripting.
Posted by sporaxis at on12/22/07
AS I keep looking at things, one question I have is... Do the random traps have optional settings, especially making them non detectable? _________________________ Sporaxis "Smashing other peoples bits together to make a better world" blog: Link
Posted by sporaxis at on12/22/07
Just been testing this and noted that the optional switch TRAP_DETECTABLE =1 does not seem to woek. If I set it on the inv placeable, as I understand it, I should not be able to see the traps in the area. Has anyone else observed this behaviour or am I getting things wrong? _________________________ Sporaxis "Smashing other peoples bits together to make a better world" blog: Link
Posted by sporaxis at on12/22/07
Simply sweet, does more than I thought and does it well. _________________________ Sporaxis "Smashing other peoples bits together to make a better world" blog: Link
Posted by DM-Taino at on10/03/07
Simply awesome!! Taino
Posted by MeriLina at on04/05/07
Hey, this is great stuff! I can use this in my mod. Thanks for making it! *big smile*
Posted by markrendl at on02/17/07
Excellent little script. Using this to great effect on my server. markrendl
Posted by Mr__Damage at on02/12/07
Very nicely done !
Posted by Shargast at on01/25/07
Incorporates all the things that I want in a trap system. Easy to use and configure and it delivers what it promises. Why didn't I think of this!? Good work Cheers Sai aka Shargast _________________________ Realms of Shargast V1-V5ab, LOTR V15, The Undeath Clave Faithful of Aerth