Interactable Actors

From PSwiki
Jump to navigation Jump to search

You can create actors the player can interact with, there are already some predefined templates:

  • door (has 3 states, closed, open inside, open outside, and cycles between these states)
  • doubledoor (same as door above, but with two meshes, left and right door)
  • sliding door (represents a gate or secret passage, can slide up, down, left or right)
  • light (a mesh with a point light, you can change color, and all other light parameters)
  • particle (a mesh with a particle, can be used for example as a brazier with fire particle on and off, or a faucet with water pouring down or off)

Each one has one static mesh (mandatory), which will be activated by the player. MUST be visible and collision query enabled.

To create a new actor in a level follow the steps below:

  • Choose the type of actor, example door
  • right-click on the InteractableDoor template and choose "create child"
  • name your child, example : DelverHouseDoor
  • Open it and change the mesh if needed, you can change position, scale, rotation, materials. You cannot delete the nodes on the left tree
  • Check the properties and depending on the object you will have the ability to set:
    • Sound on Toggle
    • Interact Distance (distance between the CENTER of the actor and the player to allow him to interact)
    • Direction and Move Distance (only for sliding doors)
    • Script Can Toggle: name of the mathscript to run to check if the player can actually toggle this item. The mathscript needs to return a value 1 or 0, and can optionally have a message in case of 0. Example script:

Result = if (Actor:GetSkillValue(11)>150,1,0); MessageNo = "Nothing happens";

  • Script on Toggle: name of the progression script to run when the item is toggled independent on the state. So for example on a door it will run when you open the door and when you close.
  • ContainedItemIDsToActivate: an array of strings listing item_stats.IDs to place into the container to allow the object to be activated
  • Linked Actors: these are the actors that will be toggled when this item toggles, like a cascade effect. If the item is a final item like a gate, this field is used to list all the source items needed to actually toggle the gate. So for example if a gate has 3 levers in its linked actors list, it means all 3 levers will have to be toggled before the gate toggles.
  • Disable Direct Interaction: if flagged this item cannot be toggle directly, but only through other actors having this one as linked actor. Example a lever that toggles a gate. The gate should have this flag on.
  • Time of Animation: time for the animation in seconds. Example a door opening
  • Brute Force Difficulty: if greater than zero, the item can be brute forced (new icon in the context menu) to toggle. This is the difficulty factor.
  • Brute Force Reset Time: After the interactable has been successfully brute forced to toggle, it will return to its previous state after this amount of seconds.

An Interactable actor can be trapped, see Traps