- GetDefCoreVal(string entry, string section, id definition);
- GetObjectVal(string entry, string section, object obj);
- GetObjectInfoCoreVal(string entry, string section, object obj);
- GetScenarioVal(string entry, string section);
- GetPlayerVal(string entry, string section, int player);
- GetPlayerInfoCoreVal(string entry, string section, int player);
GetDefCoreVal, GetObjectVal, GetScenarioVal
This family of functions provide direct access to all properties of the respective object as stored in the definition files.
Each function corresponds to the following files:
Function | File |
---|---|
GetDefCoreVal | DefCore.txt |
GetObjectVal | Objects.txt |
GetObjectInfoCoreVal | *.oci (in player files) |
GetScenarioVal | Scenario.txt |
GetPlayerVal | scenario.txt |
GetPlayerInfoCoreVal | Player.txt |
The property to be accessed is referenced through its name and section, if applicable (if no value is given for the section, all sections will be searched for the property). If a matching property was not found or does not correspond to a valid C4Script data type (e.g. ID lists) the result is
nil
.If
nil
is given for obj/definition in a call to GetObjectVal, the object or the definition of the object from which the call was made is used.There is a number of additional wrapper functions located in System.ocg/GetXVal.c. These functions allow for easy access to various common Get*Val functions (e.g.
GetObjWidth()
for GetObjectVal("Width", 0)
).