Expression Trigger

The Expression Trigger enables to start or stop a behavior by returning true if the evaluation of an Expression or a Channel is successfully compared to a reference value.

Beware that the expression and the channel triggers are evaluated at the very start of each frame : you must allow a one frame delay, to take an attribute value change into account (compared to other operations on attributes which are immediate)

Creation

  • Behavior Editor / Trigger Library: 
  • Golaem Menu: Crowd Triggers / Triggers / CrowdTri Expression Node
  • MEL command: glmCrowdTriExpressionCmd;

Configuration

An Expression Trigger defines the following specific attributes. For common attributes see Trigger Common Attributes.

Expression Attributes

Expression

The Expression or Channel to evaluate. If the return value of the Expression or Channel is of type vector, the compared value will be the length of the vector. It is advised to use the combo-box to explicitly state the type of the Operand, otherwise Golaem will try to automatically determine it (but may fail sometimes).

Operator

A comparison operator (equal, greater than…)

Value

A reference value.

When using a Behavior Channel, it is possible to use the keyword thisBehavior instead of the Behavior name to design the triggered Behavior. When using that keyword, the trigger can not be shared anymore.

The value of an Expression can be displayed in the Visual Feedback using the ChannelOperator Behavior.