Game logic - Trigger zone – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
=Description=
=Description=
Trigger which fires when given object enters or exits its bounding area.
Trigger which fires when a object enters or exits its bounding area.


=Settings=
=Properties=
*Zone shape - shape of the trigger zone - box or sphere.
===Enabled===
*Radius - Can be adjusted in the properties or via scale option.
*Trigger will not fire if no enabled.
*Is triggered by - setup on what kind of entity passing the area will fire the trigger. It is possible to combine several condition by using "AND", "NOT" and "OR" options. Other conditions include:
 
===Zone shape===
*Shape of the trigger zone - box or sphere.
 
===Radius / Dimensions===
*Can be adjusted in the properties or via scale option.
 
===Visible===
*Makes the Trigger zone boundaries visible
 
===Color===
*Color of Trigger zone boundaries (when visible)
 
===Is triggered by===
*Setup what kind of entity passing the area will fire the trigger.
**Any animal / item / player /projectile
**Any animal / item / player /projectile
**Entity type - after picking an entity, any instance of this entity will fire trigger
**Entity type - after picking an entity, any instance of this entity will fire trigger
Line 11: Line 25:
**Labeled entities - will trigger only if trigger entity will be member of given Label
**Labeled entities - will trigger only if trigger entity will be member of given Label
**Player role - will react to players of specific role
**Player role - will react to players of specific role
*Perform - governs if the trigger will react to incoming/exiting entity if there is already another entity in the zone. That entity must meet trigger rules (e.g if trigger is set to "ANY PLAYER" animals and other types will not block the trigger)
*Times triggered - number of times trigger can be fired, -1 sets to infinite. Entering and leaving trigger counts separate.


=Events=
===Perform===  
*On Trigger Enter - Fires the trigger when entity enters the trigger zone.
*Governs if the trigger will react to incoming / exiting entity if there is already another entity in the zone. That entity must meet trigger rules (e.g if trigger is set to "ANY PLAYER" animals and other types will not block the trigger)
*On Trigger Exit - Fires the trigger when entity leaves the trigger zone.
 
===Times triggered===
*Number of times trigger can be fired, -1 sets to infinite. Entering and leaving trigger always removes one use.


=Literals=
=Trigger zone events=
*Trigger Object - Instigator of the trigger execution.
*[[Ylands Tile - On Trigger Enter-Exit|On Trigger Enter / Exit]]


=Trigger Zone in Use=
=Related instructions=
# Choose the Trigger Zone from the game logic tab and place it. With this game logic, positioning and size matters.
*[[Ylands Tile - Reset trigger zone|Reset Trigger]]
# Open its properties by double-clicking. Here you can ajdust the settings described above.
*[[Ylands Tile - Game logic enabled|Get / Set Enabled]]
# Open its edit script window. Start with one of the two special event script tiles, than add some more, as you need. In this case, entering the triggering zone opens large door.
*[[Ylands Tile - Game logic name|Get / Set Name]]
*[[Ylands Tile - Game logic position-rotation-scale|Get Position / Rotation / Scale]]
*[[Ylands Tile - Is game logic|Is Game Logic]]
*[[Ylands Tile - Get game logic ID|Get ID]]
*[[Ylands Tile - Attach-Remove Game logic label|Attach / Remove Label]]
*[[Ylands Tile - Has Game logic label|Has Label]]
*[[Ylands Tile - Get Game logic labels|Get Labels]]




----
----
{{Ylands scripting navbox}}
{{Ylands scripting navbox}}

Revision as of 23:36, 2 December 2018

Description

Trigger which fires when a object enters or exits its bounding area.

Properties

Enabled

  • Trigger will not fire if no enabled.

Zone shape

  • Shape of the trigger zone - box or sphere.

Radius / Dimensions

  • Can be adjusted in the properties or via scale option.

Visible

  • Makes the Trigger zone boundaries visible

Color

  • Color of Trigger zone boundaries (when visible)

Is triggered by

  • Setup what kind of entity passing the area will fire the trigger.
    • Any animal / item / player /projectile
    • Entity type - after picking an entity, any instance of this entity will fire trigger
    • Specific entity - after picking an entity, only this specific instance (ID) will fire trigger
    • Labeled entities - will trigger only if trigger entity will be member of given Label
    • Player role - will react to players of specific role

Perform

  • Governs if the trigger will react to incoming / exiting entity if there is already another entity in the zone. That entity must meet trigger rules (e.g if trigger is set to "ANY PLAYER" animals and other types will not block the trigger)

Times triggered

  • Number of times trigger can be fired, -1 sets to infinite. Entering and leaving trigger always removes one use.

Trigger zone events

Related instructions



Template:Ylands scripting navbox