User Tools

Site Tools


en:modulebuilding:randomtraps

This is an old revision of the document!


Random and Respawning Traps

First, find a Craft - Area Settings placeable in custom placeable palette, and place it into area. Then open its inventory and put inside trap kits of traps you want to be spawned in the area. You will find them in custom item palette - Miscellaniouis - Kit. Adding same trap multiple times will increase chances of that trap to be spawned.

After you do this, right click the Craft - Area Settings placeable and go to Variables. The placeable already has the variables set with “null” values. You just adjust them.

  • TRAP_ALLOW integer -1 - this variable tells the random trap system to never spawn a trap on the object
  • TRAP_NUM integer X - number of random traps to be created in the area
  • TRAP_DISARM_MIN integer X - minimal DC of the random traps for disarm
  • TRAP_DISARM_MAX integer X - maximum DC of the random traps for disarm
  • TRAP_SEARCH_MIN integer X - minimal DC of the random traps for search
  • TRAP_SEARCH_MAX integer X - maximum DC of the random traps for search
  • TRAP_OBJECTS integer 0/1 - by default random traps will be only spawned on floor, by setting this to 1 you enable traps to be spawned on objects such as doors and placeables
  • TRAP_UNLIMITED integer X - percentual chance for the traps to be unlimited (ie. not disappearing after triggering)

And lastly, set TRAP_ALLOW variable to -1 on every non-invisible door and useable placeable that you don't want the random trap to be ever spawned.

Static Traps On Objects

If you trapped some object such as door or placeable, you will probably want it to grant experiences for disarming and to respawn.

First of all, set the object script sh_trap_disarm into OnDisarm event.

If the trap is one-shot then add also sh_trap_trigger script into OnTrapTriggered event.

By default the trap will respawn with same type, DCs in about 1250-1450 seconds. You can change this via these variables:

  • TRAP_RESPAWN integer X - where X is number of settings for trap to respawn
  • TRAP_DISARM_MIN integer X - as above
  • TRAP_DISARM_MAX integer X - as above
  • TRAP_SEARCH_MIN integer X - as above
  • TRAP_SEARCH_MAX integer X - as above
  • TRAP_UNLIMITED integer X - as above

If random traps are set up in area and you don't set any of the variables then numbers for random traps are used instead.

👮‍ Arkhalia Wiki guard: Please put your h1 caption right at the beginning of the Article. Reason: It doesn't look good to have one Article like this and other Article like that. Every Article shall start with h1 caption.
en/modulebuilding/randomtraps.1762995122.txt.gz · Last modified: 2025/11/13 00:52 by shadooow