Class Variables
- Namespace
- SuzerainModdingKit
- Assembly
- SuzerainModdingKit.dll
Static interface for reading and writing game variables.
public static class Variables
- Inheritance
-
Variables
- Inherited Members
Methods
GetBool(string)
Get a bool variable. This can be a Suzerain variable or a custom variable.
public static bool GetBool(string name)
Parameters
namestringThe name of the variable.
Returns
- bool
The value of the variable casted to a bool.
GetFloat(string)
Get a float variable. This can be a Suzerain variable or a custom variable.
public static float GetFloat(string name)
Parameters
namestringThe name of the variable.
Returns
- float
The value of the variable casted to a float.
GetInt(string)
Get an int variable. This can be a Suzerain variable or a custom variable.
public static int GetInt(string name)
Parameters
namestringThe name of the variable.
Returns
- int
The value of the variable casted to an int.
GetString(string)
Get a string variable. This can be a Suzerain variable or a custom variable.
public static string GetString(string name)
Parameters
namestringThe name of the variable.
Returns
- string
The value of the variable casted to a string.
Register(string)
Registers a game variable so Suzerain Modding Kit can save/load it.
public static bool Register(string name)
Parameters
namestringThe name of the variable. Recommended style: PascalCaseModName.PascalCaseVariableName (eg. MyMod.MyVariable).
Returns
- bool
A boolean indicating whether the operation succeeded.
Set(string, object)
Set a variable. This can be a Suzerain variable or a custom variable.
public static bool Set(string name, object value)
Parameters
namestringThe name of the variable.
valueobjectThe new value of the variable. Supported types: bool, int, float, string.
Returns
- bool
A boolean indicating whether the operation succeeded.