Writing Update Scripts
All Update Scripts are written in .txt files and make use of a 'register' system.
These registers will tell you the state of the game world in relation to that object.
Outside of the registers there are 2 types of functions; Register Setters and Interactables.
An example of both functions types and registers would be:
KeyPressed a
IF key
Push 3 3
EXIT
Here, we call the KeyPressed function. This is a Register Setter, so it will set the register 'key'
as either true of false depending on if the parameter 'a' is being pressed. Then, we check IF the
register 'key' is true. If so, then the next line (Push 3 3, an Interactable function) gets called (this
pushes our object 3 in the x direction and 3 in the y direction). Lastly, we call EXIT to signify
leaving the IF condition.
It is important to note that there is only a SINGLE space between each element of the script.
Additionally, I will note here that the numerical values in Interactable functions can either be
whole numbers, as seen here, or floats, like 3.5.
For conditionals, there are only two; IF and IF NOT. To leave an if statement, you must call the EXIT command.
More complex Update Scripts can be found under the UpdateFunctions/Default folder in the project if you want more examples.
When compiling scripts in the engine, the Debug Log will pop out and errors it has reading scripts. Read this to help
figure out if you are writing Update Scripts correctly.