Use Script Objects
As a story developer, you can use script objects to encapsulate a set of functions that can be reused in scripting.
About Script Objects
Script objects act as containers of script functions that aren’t specific to an event and can be used directly. They can thus save you from duplicating codes and make maintenance of stories easier.
Once you've added a script object, you can add script functions and write scripts for them. Each function have access to other objects in the story, such as widgets, global variables, and popups.
-
Name
-
Return type
-
Arguments
Later when writing scripts, you can access a script object by its name.
Create a Script Object with Script Function
Procedure
Results
You've created a script object containing a script function, which can be reused in any other scripts.
You can add multiple script functions to the script object by selecting (More) Add Script Function next to it in the Outline panel.
ScriptObject_1.function1();
Modify And Delete Script Objects and Script Functions
To change the name, description, arguments and return type of a script function, select it in the Scripting area of the Outline panel. The panel opens where you can directly update your changes. After you've changed the elements, select Done to close the panel.
To edit an argument, in the Arguments section of the Script Function panel, select (Edit) when hovering over it. To remove an argument, select (Remove) next to it.
To delete a script object or script function, select (More) next to it and then Delete.
