Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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, for 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, 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 end point for a script helps to make it reusable and modular. There are two ways to have a defined end point. Use an End Script resource or use a Custom Event.

Example # 1: Spawn Assets Script

In the above “Spawn Assets” script, the Spawn Asset Resource is used. Therefore, we do not want to use the End Script resource as the spawned assets will disappear. Therefore, we will create a Custom Event “Assets Spawned” and add it at the end of the script. We can then use that event as a Condition to open other scripts. You can see we used it here in the “Welcome” frame as we don’t want the script to run until the Assets are Spawned:

Example 2: Using an End Script Resource

This is an example of a typical script where an End Script resource will be used to script an end point:

As you script in Storyflow, you may want to understand the impact of the End Script resource on certain other resources. You may not be aware that the End Script resource will cause the other resources in the script to end. In this article there is a column that helps to identify this:

  • No labels