This article describes the order in which the system processes frames.
A script can have many frames. The order and relationship between the frames impact when they will be processed by the system. Frame processing happens at the speed of a computer, not that a human. It is quite fast. Two frames on the same level with no conditions appear to happen at the same time to a user.
The flexibility of this system makes several types of branching possible within Storyflow.
A frame is considered processed once the system has evaluated its conditions. If its conditions are false, the frame is queued until:
- The frame or any parent of it on the same branch becomes deactivated.
- The script which contains the frame is ended.
- The conditions on the frame become true. In this case, the frame will open.
An open frame is a processed frame whose conditions are true. An open frame activates its resources and its child frames will be processed.
The main function of child frames is to control the order in which frames are processed. Frames are arranged in a tree structure. A child frame will only be processed when:
- Its parent frame is open, meaning its parent has been processed and the conditions on the parent are true.
Frame conditions gate resources. Frame resources will activate and any child frames will begin to be processed once the frame conditions are true. Frame conditions will only be evaluated by the system if the frame has been processed.
When a script is launched, the system script processor will begin processing the frames in the tree starting from the root frame. Each script has a single root frame called Main Frame. That frame has a tree of 0-n child frames below it. The script processor processes each frame as follows:
- Evaluate the conditions. If the conditions evaluate to true or no conditions are present, it is considered to be met
- If the conditions are met
- Activate frame resources
- Process any child frames
- If the conditions are not met
- Queue until the conditions are met and move to the next frame on the same level
The flowchart below describes the process.
As an example, the script below shows the order in which the frames will be processed. This assumes that all frame conditions are true.