# Default/Code Get Object Type

Grammar — (Default Code Version) Return the object type for object object made by player player
FlagsNative | Function

Takes an Object ID and returns 0 if it is a unit, 1 if it is a building, 2 if it is an upgrade, and -1 if it does not fall into any of those categories. Same as the script version, except this version cannot be modified to handle custom requirements.

# Arguments

  • int — Player
  • string — Object

Returns — int

native int AIDefaultGetObjectType(
	int player,
	string aliasType,
);

Category: AI Advanced / Requirements / Functions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/RequirementsAI.galaxy:671

    // override any special cases here

    return AIDefaultGetObjectType(player, objType);
}

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/RequirementsAI.galaxy:708

    // override any special cases here

    return AIDefaultGetObjectType(player, objType);
}