A Terminate Point is used to immediately stop execution of the entire script.
A Terminate Point is represented by the following graphic:
One or more incoming transitions may be connected to a Terminate Point, but it may not have an outgoing transition.
When a transition is taken to a Terminate Point, the script is considered to be completed and the running state of the script is set to FALSE. If the script is to be started up again, then it's running state must be set to TRUE and the script reset, either manually through your virtual world's interface, or through the function calls llSetScriptState and llResetScript respectively.
The following model shows the state VampireProwling, which upon receiving a timer event determines that it is now daylight, takes the transition Daylight to the Terminate Point which immediately stops the script.
- Only one Terminate Point may be defined within the decomposition of a Composite State.
- In the generated code a Terminate Point calls the function TERMINATE_SCRIPT to terminate the script. The function is also used to terminate a script due to an ill-defined model which sometimes can only be determined at run-time. In this case a specific message string is passed to TERMINATE_SCRIPT that will then be output on the Trace Output channel set in the Options dialog. When a script terminates as a result of the Terminate Point, no message is output.