# GetDefinition

Objects
5.1 OC
id
int index Index of the definition.
Returns the id of the indicated definition from the list of definitions as currently loaded by the engine.
var index = 0, weapon_def, weapon_list = []; while (weapon_def = GetDefinition(index)) { if (weapon_def->~IsWeapon()) weapon_list[GetLength(weapon_list)] = weapon_def; index++; } var spawn_weapon = weapon_list[Random(GetLength(weapon_list))]; CreateObject(spawn_weapon,AbsX(Random(LandscapeWidth())),0);
Searches through all loaded definitions and all those which return `true` on call of the function "IsWeapon" are put into an array. After that, a random item of these defintions is selected to spawn at a random position in the landscape.
GetHomebaseMaterial
GetPlrKnowledge
C4D_Goal
C4D_Living
C4D_Object
C4D_Rule
C4D_StaticBack
C4D_Structure
C4D_Vehicle
Günther
2002-02