# Default/Code Get Object Type
Grammar — (Default Code Version) Return the object type for object object made by player player
Flags —Native
|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
— Playerstring
— Object
Returns — int
native int AIDefaultGetObjectType(
int player,
string aliasType,
);
# Related
Category: AI Advanced / Requirements / Functions
- Script Get Maker
- Script Get Object Type
- Script Get First Missing Req
- Script Get First Unfinished Req
- Script Get Full Make Time
- Default/Code Get Maker —
string
— AIDefaultGetMaker - Default/Code Get Object Type —
int
— AIDefaultGetObjectType - Default/Code Get First Missing Req —
string
— AIDefaultGetFirstMissingReq - Default/Code Get First Unfinished Req —
string
— AIDefaultGetFirstUnfinishedReq - Default/Code Get Full Make Time —
int
— AIDefaultGetFullMakeTime - Get Base Name —
string
— AIGetBaseName - Get BuildAt Name —
string
— AIGetBuildAtName
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/RequirementsAI.galaxy:671
// override any special cases here
return AIDefaultGetObjectType(player, objType);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/RequirementsAI.galaxy:708
// override any special cases here
return AIDefaultGetObjectType(player, objType);
}