DIFF

class EnScriptSource

Part of Enforce script essentials

Constructors 2

private void EnScript()
private void ~EnScript()

Methods 4

static proto int GetClassVar(Class inst, string varname, int index, out void result)

Dynamic read of variable value by its name

inst
When inst == NULL, it's for global variable, otherwise it's class member
index
Is index when variable is array
out result
Variable must be of the same type!

Returns: int true when success

float count = 0;

bool success = EnScript.GetClassVar(myClass, "m_Counter", 0, count);
Print(count);
Print(success);

>> count = 5
>> success = 1
static proto int SetClassVar(Class inst, string varname, int index, void input)

Dynamic write to variable by its name

inst
when inst == NULL, it's for global variable, otherwise it's class member
varname
index
Is index when variable is array
input
Input variable must be of the same type!

Returns: int Returns true(1) when success

Print(myClass.m_Counter);

>> m_Counter = 0

bool success = EnScript.SetClassVar(myClass, "m_Counter", 0, 5.0);

Print(myClass.m_Counter);
Print(success);

>> m_Counter = 5
>> success = 1
static proto int SetVar(out void var, string value)

Sets variable value by value in string

out var
value

Returns: int

???
static proto void Watch(void var, int flags)

Debug tool for watching certain variable. Invokes debugger whenever is variable used

var
Certain variable for watching
flags
= 1 means it will break even when not modified

Returns: void