This section explains what a Frame is, how they are triggered, what they contain, etc.
A Frame is where you put the content for your experience and the Conditions under which that content will appear. A Frame can contain Resources, Preconditions and PostConditions. Every Frame resides somewhere within a Script‘s Frame tree. A Frame can have one or more Preconditions that gate the activation of the Resources in the frame. A Frame can have sub-frames that are processed immediately after the parent Frame is opened. A Frame can also have one or more Postconditions which, once met, deactivate the Frame Resources and close the Frame.
A Note can be added to any Frame. It is a good place to describe for what the Frame is intended. This is especially useful when more than one author is working on a Script. A note is only viewable by authors and will never be seen by users of Explore AR or any other template.
A Frame Resource is a Resource inside of a Frame. Resources contain the content for your experience and can trigger events. A Resource can be a message, a piece of media a 3D object, an instruction to close a Frame, a reward, a Task or any number of other things. A Frame can contain one or more Resources within it. Frame Resources are processed in the order in which they are listed in the Frame.
A Note can be added to any Resource. These Notes work the same way as Notes on a Frame.
When a Frame is processed, a check is performed to see if it contains any Preconditions. A Precondition specifies some parameters that must be true before the Frame is open. Once a Frame is open, its Frame Resources are activated. For example, a Wallet Condition might specify that the user must have greater-than $50 before the Frame Resources will activate.
If a Frame is processed and does not contain Preconditions, it immediately opens. However, if the Frame does contain Preconditions, and they are not satisfied, then the Frame will remain closed. This means that the Frame’s Resources will not be activated and the Frame’s subframes will not be processed. When this occurs, the Script Processor will store a reference to this Frame. Later, when this Frame’s Precondition becomes true, the Frame will open and its Frame Resources will activate and its subframes will be processed. A Frame will wait for its Precondition to be satisfied indefinitely, unless its parent Frame is explicitly closed using a Close Frame Resource.
Postconditions work in a similar manner to Preconditions with one key difference. A Postcondition is checked after the Frame has opened and its Frame Resources have activated. Once the Postcondition(s) on a Frame becomes true, the Frame Resources are deactivated and the Frame closes.
Let’s look at an example Frame. The Frame in the picture below has three parts:
- A Precondition which states that the user must have 1 or more Gold Stars.
- A Frame Resource which will display a Map Marker at the corner of Howe & Georgia Street.
- A Postcondition which will deactivate the Frame once the user is within 18 meters of the corner of Howe & Georgia Street
This Frame will play out in the following way: The Frame will be processed. Once a user has collected at least one Gold Star (Precondition is true), the Frame will open and the Map Marker will appear on their map at the corner of Howe & Georgia Street (Frame Resource activates). However, once the user is within 18 meters of the corner of Howe & Georgia Street (Postcondition is true), the Map Marker will disappear (Frame Resource deactivates) because the Postcondition will be true and the Frame will close.