Traps: Difference between revisions

From PSwiki
Jump to navigation Jump to search
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
* triggertype = PROXIMITY
* triggertype = PROXIMITY
* responsetype = SCRIPT
* 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 [[ProgressionEventsTable| Progression Events]], this will be triggered when the player walks within the radius of the action location.
In the responsetype field place the name of the script stored in [[ProgressionEventsTable| Progression Events]], this will be triggered when the player walks within the radius of the action location.
Line 17: Line 19:
* trapResetTime : time needed for the trap to reset after it has been disabled by a player
* 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.
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 in the [[TrapsPropertiesTable|traps_properties]] table.

Latest revision as of 16:13, 6 March 2022

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 in the traps_properties table.