Traps

From PSwiki
Revision as of 15:42, 19 December 2021 by Talad (talk | contribs) (Overview)
Jump to navigation Jump to search

Overview

There are three types of traps you can place in the game

1) Traps on the ground, which are spawned with Action Locations, based on proximity. The definition is done inside an Action Location specifying:

  • triggertype = PROXIMITY
  • responsetype = SCRIPT

In code terms, whenever an Action Location has a proximity trigger, it will spawn in the level an ApsProxyTrigger.

In the responsetype field place the name of the script stored in Progression Events, this will be triggered when the player walks within the radius of the action location.

2) Trap placed on a level item (InteractableActor object). Example a lever or a door. In this case place the item in the level through the UE Editor, then edit the properties under "PlaneShift" category:

  • isTrapped : has a trap on it
  • TrapScript : script to run when trap is triggered
  • isTrapBlockingUse : is the trap triggers, we cant use the item
  • trapStrength : how strong is the trap
  • trapResetTime : time needed for the trap to reset after it has been disabled by a player

3) Trap placed on a spawnable item. Example a chest. In this case the item needs to be flagged as ISTRAPPED in Item_instancesTable.flags , then the same set of properties of type 2) above are set on the item_traps table.