Overview of the Custom Event resource
The Custom Event resource emits an event within a script. Frames can conditionally play if the custom event is specified using the Custom Event condition. This resource can be used for branching out a script.
The Custom Event resource is different from the System State or Story Point resources in that it does not use an enum. Furthermore, the author can specify the scope in which the custom event is called out. For example, the event can be local to the script, or global (in the session).
|Custom Event||Specifies the name of the custom event.|
Example in the Headset:
I have two scripts. I want an event in one to trigger something in the second. In this case, there is a Welcome Message that plays for the learner. When it is closed, I want it to trigger a second script to run where Ted is spawned.
- In the first script, go to the resource and click on the blue + event link at the bottom and choose the Close event:
- In the sub-frame that opens, go to the event tab on the right side and click on Add New:
- Name the event and click on the checkmark to save. Click "Global" to save this event across all of your scripts:
- Drag the event to the Resource area of your frame to create the Custom Event resource:
- Save changes.
- Navigate to the second script and open the frame that you want the event to trigger. In this example, it's the script where I Spawn Ted.
- Open the Events tab again and this time drag the Custom Event to the Conditions (not Resources):
- Now what will happen is that the Resource in this second script will not play until that event is complete. This is what it would look like in the headset: