# 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.sc2mod


// L671
AIDefaultGetObjectType(player, objType)
// L708
AIDefaultGetObjectType(player, objType)