This section explains what a Resource is, how they are triggered, what Events they can emit, etc.
A Resource is a command that tells the Motive engine to perform an action. They can be used to interact with the game world, to update the player’s status and Inventory, send messages to the user or to the screen, or to perform actions on Motive components (Script, Frames, and other Resources).
A Resource is contained within a Frame. When a Resource’s Frame is processed, that Resource will be activated. A Resource will only be activated once, unless its Frame is processed again.
In the web editor, Resources are grouped under different categories based on their functionality. When creating a Script, the Resources available for your project will be listed on the right-hand side. Some Resources contain sub-resources. A sub-resource is the same as its parent Resource, except with some of the options prepopulated. To add a Resource to a Frame, find the Resource in the Resource list, and then drag-and-drop it into the Frame Editor column in the middle, or drop it directly onto a Frame in the Frame column on the left. Alternatively you can double click a Resource to add it to the currently selected Frame.
Resources emit certain Events during their life-cycle. Peruse the documentation for a Resource to see what events that Resource will emit. Using a Frame Precondition, you can listen for a Resource’s Event and open Frames when the Event is triggered. These Events are emitted for all Resources:
- Activate: This Event is emitted when the Motive engine begins processing the container Frame for this Resource (after Preconditions satisfied)
- Deactivate: This Event is emitted when the Resource’s container Frame is closed. A Frame will close when the Frame’s Script has finished processing, or the Frame is explicitly closed using a Close Frame Resource. A Resource’s deactivate Event will also be emitted if the Resource is deactivated using a Deactivate Resource Resource.
You can quickly create a new Frame that listens for a certain Resource’s Event by clicking on the blue plus symbol (“+”) in the bottom-right corner of the Resource box. Choose the Event you would like to trigger a new Frame on, and the Frame will be created with the Precondition already instantiated.
Caution: When selecting a Resource Event to listen to, ensure that the Event you select is emitted by that Resource by checking the docs.
- AR Resources
- Core Resources
- Gaming Resources