Logic is used to track, trigger and monitor different events via variables. Variables are data values that can change during the RichCast Title, for example, a score value. Each is given a unique name so it can be referred to and altered and should be named in Camel Text (LikeThis.)
To create a new variable, open a Logic Tile and click the add variable button at the bottom, then User, and the plus at the bottom. Type in your variable name and set it to be either a Number or a Boolean (True or False).
Creators can use their variable by choosing “Set” in a Logic Tile. Variables can be set at any time. For example, if a Creator is creating a quiz, and the player gets a question right, they will want to set their score variable to increase by 1. Alternatively, if the player has visited a location, Creators may want to set VisitedLocation to be true.
Once set, ‘If’ statements can be used to change the players' experience. For example, if the score is 1, the player may be taken to a Speak Tile where they're told to go back and study, whereas if they got 10 out of 10, they may be directed to a Speak Tile where they're complimented for their performance.
Else can also be selected by clicking on If, and clicking on where it says If. They work in the same way as If. Every If should have an Else to make sure the flow continues. If a Boolean is true, go to this tile. Else, go to this other tile. Both should be connected to the previous tile, not to each other.
Ticking the "Watch" option will allow Creators to track the Variable on the console in Test Mode.
Shuffle and Random can be selected with a number variable by clicking the "Number" dropdown in a Set command. Both shuffle and random will set a variable to be a number between two specified numbers. Random will always pick a number at random from those parameters. Shuffle will exhaust all options first before repeating a number.
System variables are pre-programmed variables you can set a custom variable to be. We will be adding more in the future.
Creators may wish to make a timer. This can be done in the following way:
- Make two new number Variables: StartTimer and Timer. Set them to 0.
- Set StartTimer to equal Session Time.
- Set Timer to Equal Session Timer, and then change "End" to "Continue", and Decrease by StartTimer.
- Have an If and Else Statement. If Timer is greater than X (X being the seconds you want your timer to be), continue. Else, loop back to the previous Set Logic Tile.
This may require a bit of fiddling to get right. Please look at Project Logic in the app, where this technique is shown with videos on how to set it up.
For a video tutorial on Logic, click here.
Tips and Advice
Make sure to not have two variables with the same/similar names. This could cause faulty logic.
If you have a fallback/common Speak Tile (e.g “How may I help you”), consider writing three or four variants and use the Shuffle feature in a Logic Tile. This will go through all possible combinations before repeating any.
We recommend having a Google Docs/ Word document that you can put Variable names in a table, alongside where the variable is used. This can help find faulty tiles quickly when debugging.
Make sure not to have multiple IF statements trigger at the same time, as this could cause issues with your Title continuing down multiple flows at once.