A Game Token is a script object or variable that is used for storing values. These tokens can be used for performing simple logic manipulations and checks within the game scripting language.
Possible token functions include states (squad mate = dead or alive), characters, information (research tool results), sequential logic (has an event taken place, in if/then sequences), or objects (for example, weapons, vehicles).
These are represented within various flow nodes with different functions, inputs, outputs, and checks.
In the database, all the defined values are stored in libraries. By loading or not loading the same library for every level, tokens can be set to be active only within one level, across multiple levels, or only in part of one level.
Add New Item
First, to create a token click the Add New Item button. Then, specify which type it should be and add a description by double-clicking the value or description.
Allows you to load an XML library file.
Whenever the entire level is saved, the archetype library is saved with it. Users can also save just the library by using the Save Modified Libraries button.
Creates a new library.
Removes the currently selected library. You need to manually delete it from the hard drive if you want to permanently remove it.
By clicking the drop-down button, you can see all the libraries that have been currently loaded.
Add New Item
Lets you create a new game token.
Clone Library Item
Duplicates the selected item so that you can have an alternative version, with slightly different parameters.
Deletes the selected game token.
Changing Type, Values, and Description
After you have created a token, you can choose from the following types: Bool, Int, Float, String, or Vec3.
Depending on the type, you can add the following values:
True or False states.
Any whole number.
Any floating point number.
Any sequence of characters.
Any 3 dimensional positional coordinate (x,y,y) - for example, 290,200,180.
Saving Tokens across Levels
There are 2 specific Flow Graph nodes related to the storing of information across levels.
- Mission:GameTokensLevelToLevelStore - Trigger this at the end of the level, and it will save the values specified in the listed game tokens.
- Mission:GameTokensLevelToLevelRestore - Trigger this at the beginning of the next level to retrieve the values from the previous level.
To investigate which game tokens are active or being modified during a session, you can enable a few CVars to track the recent changes.
New items get added to the bottom of the list and are colored red. They will fade to white over time & as new ones get added to the bottom of the list.
- gt_Show - 1=screen and log, 2=screen only, 3=log only . Displays a log of the recently changed tokens in the top left (default) of the screen.
- gt_showFilter - In the historic list only shows game tokens that include the filter string.
- gt_showLines - How many lines is used by the historic list.
- gt_showPosX - Defines the starting column in screen for game tokens debug info.
- gt_showPosY - Defines the starting row in screen for game tokens debug info.