# GetDefCoreVal

Get*Val
5.1 OC
any
string entry Name of the entry to be retrieved.
string section Section of the entry to be retrieved. If not specified, all sections will be searched for an entry of the specified name.
int entry_number Index of the value to be retrieved if an entry contains multiple values.
Returns the property value of an object definition by its name in the DefCore.txt.
If the requested entry is an id list (e.g. "Components" in DefCore.txt) an even entry_number will return the listed id and an uneven entry_number will return the matching count (see example).
var wdt = GetID()->GetDefCoreVal("Width", "DefCore");
Determines the width an object.
Log
(" A tools workshop requires the following material:");

for(var i = 0;; i++) { var id = GetDefCoreVal("Components", "DefCore", ToolsWorkshop, i*2); if(!id) break; var cnt = GetDefCoreVal("Components", "DefCore", ToolsWorkshop, i*2+1);

Log
("%d x %s", cnt, id->GetName()); }
Determines the necessary components for construction of a workshop.
The loop will run until GetDefCoreVal returns id `nil` which means the end of the list.
GetObjectVal
GetObjectInfoCoreVal
GetActMapVal
GetScenarioVal
GetPlayerVal
GetPlayerInfoCoreVal
PeterW
2002-04