Skip to end of metadata
Go to start of metadata

 

Overview

Topics

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.

Pic1: Game Tokens in the DataBase View

 

Toolbar

The toolbar can be divided into two groups: buttons for library control and buttons for library item control.

Library Control

Pic2: Library control

Button
Description
Load Library

Loads a library and adds it to the Library drop down List.

Save Modified Libraries

Saves the changes made to the active library.

Add Library

Adds a new, custom library.

Remove Library

Removes the selected library.

Library List

Drop-down list of libraries within the current tab.

Reload Library

Reloads the active library. All changes you made since the last save will be lost.

Item Control

Pic3: Item control

ButtonDescription
Add New Item

Adds a new item to the active library.

Clone Library Item

Makes an exact copy of the selected item and pastes it in the same group.

Remove Item

Deletes the selected item from the database.

Assign Item to Selected Objects

Select an item in the 3D Viewport and assign the highlighted item in the DB to your selection.

Get Properties From Selection

Select an item in the 3D Viewport and this will open up the corresponding DB and highlight the entry in the list.

Reload Item

Reloads the selected item.

Undo

Undoes your last action.

Redo

Redoes a previously undone action.

Copy Item

Copies the selected item.

Paste Item

Pastes the copied item.

Tasks

On the left are several tasks that are specific to Game Tokens. These are:

Library Tasks

These tasks do the same as mentioned above under Library Control:

TaskDescription
Add Library

Adds a new, custom library.

Remove Library

Removes the selected library.

Load Library

Loads a library and adds it to the Library drop down List.

Game Token Tasks

These tasks do the same as mentioned above under Item Control:

TaskDescription
Add New Item

Adds a new item to the active library.

Clone Library Item

Makes an exact copy of the selected item and pastes it in the same group.

Remove Item

Deletes the selected item from the database.

Rename Item

Renames the selected item. 

Changing Type, Values, and Description

After you have created a token, you can choose from the following types: BoolIntFloatString, or Vec3.

Depending on the type, you can add the following values:

Value

Description

Bool

True or False states.

Int

Any whole number.

Float

Any floating point number.

String

Any sequence of characters.

Vec3

Any 3-dimensional positional coordinate (x,y,y) - for example, 290,200,180.

Icon
Don't forget to add a description in the Description field, you may find it come in handy later on when you have many tokens in the library!

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.

Debugging 

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, and as new ones get added to the bottom of the list.

Pic2: Debugging Game Tokens

  • 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.

 

  • No labels