Core.GetInt

Parses the declared Variable name in the SILVIA Core and attempts to return an Integer value. All SILVIA Core Variables are “tokenized” with string names beginning “$”. This allows the Variables to be used in Absorbers and Exuders, e.g. if a Core Variable “$keyword” is set with the value “AI”, an Absorber or Exuder using the text “$keyword” will either expect the input “AI”, or speak “AI”.

Description

SILVIA Cores can store variables in by Variable Name and Value. Variables in SILVIA are all named by strings starting with “$”. Variables with names beginning “$_” are sorted into the System Variables side of the State Monitor, whereas Variables with names beginning “$” without an underscore are sorted into the Trainer Variables side of the State Monitor. Core.GetInt can be used in cases where the Variable is storing an integer value and you want to immediately cast or parse it as an integer rather than using Core.GetVariable and having to then parse the string into an int.

Example Usage (C#)


//Will return the integer itemNumber from the Core Variable "$item_number"
int itemNumber = Core.GetInt("$item_number", false);

Parameters

string

variableName

The name of the Variable to store in the SILVIA Core. Always declare Variable names beginning with “$”.

bool

randomResult

The boolean flag whether to randomly retrieve a value within the Variable. If the Variable has been set additively, one of the results will be returned at random.