For an overview of Resources, click here.
Overview
The End Script resource terminates the script. This can be used to prevent a script from progressing further.
Options for When a Script Finishes
In most training scenarios, more than one script is used. Understanding what happens when a script finishes running is important because it can have an impact on other scripts that run in the scenario.
At the end of the day, there are two main choices and an option associated with each one.
The Script Persists
A script will continue to run if it is not explicitly ended. This means that the script does not contain an End Script resource. If all of the frames have completed, the script can remain open.
When a script is open, the resources remain active. For a closed screen message or similar, this doesn’t mean much. However, resources used to set certain properties, spawn assets, or bind scene objects to behaviour models will remain active. If the script is ended, those property changes will be reverted, the spawned assets will disappear and any behaviour model bindings will be undone.
Generally, if a script uses Spawn Asset or Behaviour Model resources, you want the script to persist. Setup scripts are a good example of a script that should persist. They are designed to prepare the scenario and settings for other scripts.
The Script Closes
A script that closes contains an End Script resource. This means all frames in the script will be deactivated.
Defined Ending Points
Having a defined endpoint for a script helps to make it reusable and modular. There are two ways to have a defined endpoint. Use an End Script resource or use a Custom Event.
Required Fields
Field Name | Description |
---|---|
Status | Specifies the event emitted from this resource. This will fire |
Events
This will fire Success/Fail on any "Launch New Scripts" resources that launched this Script. It lets you manage the control flow from Director Scripts essentially.