YesNoOk
avatar

Expressions in state and state controller parameters (CNS) (Read 3153 times)

Started by JustNoPoint, October 07, 2015, 02:28:29 pm
Share this topic:
Expressions in state and state controller parameters (CNS)
#1  October 07, 2015, 02:28:29 pm
  • ******
    • www.justnopoint.com/
For the most part, any parameter to the statedef or a state controller can be an expression. The exceptions are parameters that are given as strings. For instance, hit attributes, guardflags, etc. cannot be specified as expressions. Also, the ignorehitpause and persistent parameters (in all controllers) are irregular in that they cannot take expressions.

State controller parameters are evaluated at the time the controller is triggered, and are not subsequently re-evaluated unless the controller is triggered again. Parameters that are given as comma-separated lists are evaluated from left to right. To achieve continual evaluation of controller parameters, the controller must be continually triggered.

In the case of certain controllers such as HitDef, it is not always wise to use continual triggering, since this decreases performance and also may lead to undesired behavior. In this case, the programmer may wish to try to delay triggering the HitDef as long as possible, so as to evaluate the HitDef parameters right before they are used.