KB Command


[(bool  )] kbAddAttackRouteIgnoreID( int ignoreAreaID ): ignore this area when finding the route. 

[(bool  )] kbAddAttackRouteIgnoreType( int ignoreAreaTypeID ): ignore this areatype when finding the route. 

[(bool  )] kbAddAttackRouteSector( int sector ): add a new sector to path to. 

[(void  )] kbAreaCalculate(): Creates areas and area groups. DO THIS BEFORE ANYTHING ELSE IN YOUR SCRIPT. 

[(int   )] kbAreaFindBestGatherAreaID( int unitTypeID ): Returns the Area ID of the best area to gather the given unit type. 

[(int   )] kbAreaGetBorderAreaID( int areaID, long index ): Returns the Area ID of the index-th border area in the given area. 

[(vector)] kbAreaGetCenter( int areaID ): Returns the center of the given area. 

[(int   )] kbAreaGetClosetArea( vector position, int areaType, int areaType1, float minDistance ): Returns the Area ID of the closest area, of the given types, to given postion. 

[(int   )] kbAreaGetIDByPosition( vector position ): Returns the ID of the given area. 

[(int   )] kbAreaGetNumber( void ): Returns the number of areas. 

[(int   )] kbAreaGetNumberBlackTiles( int areaID ): Returns the number of black tiles in the given area. 

[(int   )] kbAreaGetNumberBorderAreas( int areaID ): Returns the number of border areas for the given area. 

[(int   )] kbAreaGetNumberFogTiles( int areaID ): Returns the number of fog tiles in the given area. 

[(int   )] kbAreaGetNumberTiles( int areaID ): Returns the number of tiles in the given area. 

[(int   )] kbAreaGetNumberUnits( int areaID ): Returns the number of units in the given area. 

[(int   )] kbAreaGetNumberVisibleTiles( int areaID ): Returns the number of visible tiles in the given area. 

[(int   )] kbAreaGetType( int areaID ): Returns the Type of area. 

[(int   )] kbAreaGetUnitID( int areaID, long index ): Returns the Unit ID of the index-th unit in the given area. 

[(int   )] kbAreaGetVisibilityChangeTime( int areaID ): Returns the gametime of the last visibility change for the given area. 

[(int   )] kbAreaGetVPSiteID(int areaID): returns an area's VP site ID (-1 if an area doesn't have a VP site). 

[(vector)] kbAreaGroupGetCenter( int groupID ): Returns the center of the given areaGroup. 

[(int   )] kbAreaGroupGetIDByPosition( vector position ): Returns the ID of the given area group. 

[(bool  )] kbAttackRouteAddPath( int attackRouteID, int pathID): Rreturns true if path was added to attack route. 

[(bool  )] kbBaseAddUnit( int playerID, int baseID, int unitID ): Adds the given unit to the base. 

[(int   )] kbBaseCreate( int playerID, string name, vector position, float distance ): Creates a base. 

[(bool  )] kbBaseDestroy( int playerID, int baseID ): Destroys the given base. 

[(void  )] kbBaseDestroyAll( int playerID ): Destroys all of the bases for the given player. 

[(int   )] kbBaseFindCreateResourceBase( int resourceType, int resourceSubType, int parentBaseID ): Finds/Creates a resource base. 

[(int   )] kbBaseFindForwardMilitaryBase( int enemyPlayerID, int enemyBaseID ): Finds/Creates a 'forward' military base against the given enemy base. 

[(bool  )] kbBaseGetActive( int playerID, int baseID ): Gets the active flag of the base. 

[(vector)] kbBaseGetBackVector( int playerID, int baseID ): Gets the back vector of the base. 

[(bool  )] kbBaseGetEconomy( int playerID, int baseID ): Gets the economy flag of the base. 

[(bool  )] kbBaseGetForward( int playerID, int baseID ): Gets the forward flag of the base. 

[(vector)] kbBaseGetFrontVector( int playerID, int baseID ): Gets the front vector of the base. 

[(int   )] kbBaseGetIDByIndex( int playerID, int index ): Returns the BaseID for the given base. 

[(vector)] kbBaseGetLastKnownDamageLocation( int playerID, int baseID ): Gets the last known damage location of the base. 

[(vector)] kbBaseGetLocation( int playerID, int baseID ): Gets the location of the base. 

[(bool  )] kbBaseGetMain( int playerID, int baseID ): Gets the main flag of the base. 

[(int   )] kbBaseGetMainID( int playerID ): Gets the main base ID for the player. 

[(float )] kbBaseGetMaximumResourceDistance( int playerID, int baseID ): Gets the maximum resource distance of the base. 

[(bool  )] kbBaseGetMilitary( int playerID, int baseID ): Gets the military flag of the base. 

[(vector)] kbBaseGetMilitaryGatherPoint( int playerID, int baseID ): Gets the military gather point of the base. 

[(int   )] kbBaseGetNextID( void ): Returns the ID of the next base that will be created. 

[(int   )] kbBaseGetNumber( int playerID ): Returns the number of bases for the given player. 

[(int   )] kbBaseGetNumberUnits( int playerID, int baseID, int relation, int unitTypeID ): Returns the number of units that match the criteria. 

[(int   )] kbBaseGetOwner( int baseID ): Returns the player ID of the specified base's owner. 

[(bool  )] kbBaseGetSettlement( int playerID, int baseID ): Gets the settlement flag of the base. 

[(int   )] kbBaseGetTimeUnderAttack( int playerID, int baseID ): Returns the number of continuous seconds the base has been under attack. 

[(bool  )] kbBaseGetUnderAttack( int playerID, int baseID ): Gets the under attack flag of the base. 

[(bool  )] kbBaseRemoveUnit( int playerID, int baseID, int unitID ): Removes the given unit to the base. 

[(bool  )] kbBaseSetActive( int playerID, int baseID, bool active ): Sets the active flag of the base. 

[(bool  )] kbBaseSetEconomy( int playerID, int baseID, bool Economy ): Sets the economy flag of the base. 

[(bool  )] kbBaseSetForward( int playerID, int baseID, bool forward ): Sets the forward flag of the base. 

[(bool  )] kbBaseSetFrontVector( int playerID, int baseID, vector frontVector ): Sets the front (and back) of the base. 

[(bool  )] kbBaseSetMain( int playerID, int baseID, bool main ): Sets the main flag of the base. 

[(void  )] kbBaseSetMaximumResourceDistance( int playerID, int baseID, float distance ): Sets the maximum resource distance of the base. 

[(bool  )] kbBaseSetMilitary( int playerID, int baseID, bool military ): Sets the military flag of the base. 

[(bool  )] kbBaseSetMilitaryGatherPoint( int playerID, int baseID, vector gatherPoint ): Sets the military gather point of the base. 

[(bool  )] kbBaseSetSettlement( int playerID, int baseID, bool settlement ): Sets the settlement flag of the base. 

[(bool  )] kbBuildingPlacementAddAreaGroupID( int areaGroupID ): Adds the AreaGroup ID to the current BP. 

[(bool  )] kbBuildingPlacementAddAreaID( int areaID, int numberBorderAreaLayers, bool addCenterInfluence ): Adds the Area ID to the current BP (with the given number of border area layers), addCenterInfluence - adds a positional influence from the area center. 

[(bool  )] kbBuildingPlacementAddPositionInfluence( vector position, float value, float distance ): Adds the position influence for the current building placement. 

[(bool  )] kbBuildingPlacementAddUnitInfluence( int typeID, float value, float distance, long kbResourceID ): Adds the unit influence for the current building placement. 

[(int   )] kbBuildingPlacementCreate( string name ): Creates a building placement; returns the ID. 

[(bool  )] kbBuildingPlacementDestroy( int id ): Destroys the given building placement. 

[(vector)] kbBuildingPlacementGetResultPosition( int bpID ): Returns the vector result position for given BP ID. 

[(float )] kbBuildingPlacementGetResultValue( int bpID ): Returns the result value for given BP ID. 

[(bool  )] kbBuildingPlacementResetResults( void ): Resets the current building placement. 

[(bool  )] kbBuildingPlacementSelect( int id ): Selects the given building placement. 

[(bool  )] kbBuildingPlacementSetBaseID( int baseID, int locationPref ): Sets the base ID and location preference for the current building placement. 

[(bool  )] kbBuildingPlacementSetBuildingType( int buildingTypeID ): Sets the building type for the current building placement. 

[(bool  )] kbBuildingPlacementSetCenterPosition( vector position, float distance, float obstructionRadius ): Sets up center position-based BP. 

[(bool  )] kbBuildingPlacementSetEventHandler( int eventType, string handlerName ): Sets event handler function for the current BP and event. 

[(bool  )] kbBuildingPlacementSetMinimumValue( float minimumValue ): Sets the minimum acceptable value for evaluated spots in the BP. 

[(bool  )] kbBuildingPlacementStart( void ): Starts the placement of current building. 

[(bool  )] kbCanAffordTech( int techID, int escrowID ): Returns true if the player can afford the tech. 

[(bool  )] kbCanAffordUnit( int protoUnitTypeID, int escrowID ): Returns true if the player can afford the proto unit. 

[(bool  )] kbCanPath2( vector pointA, vector pointB, long protoUnitTypeID, float range ): Returns true if the given unit type can path from pointA to pointB. 

[(bool  )] kbCanSimPath( vector pointA, vector pointB, long protoUnitTypeID, float range ): Returns true if the given unit type can path from pointA to pointB. 

[(int   )] kbCreateAttackRoute( string name, int startAreaID, int goalAreaID, int numInitialRoutes): Returns the Route ID if successful. 

[(int   )] kbCreateAttackRouteWithPath( string name, vector startPt, vector endPt): Returns the Route ID if successful. 

[(int   )] kbCreateTechProgression( string techName, string name ): Creates a tech progression of the given name. 

[(int   )] kbCreateUnitProgression( string unitName, string name ): Creates a unit progression of the given name. 

[(bool  )] kbDestroyAttackRoute( int routeID ): Returns true if the route was deleted. 

[(void  )] kbDump( int player1, int player2 ): KB dump for player2's units from player1's perspective. 

[(void  )] kbDumpType( int player1, int player2, string typeName ): KB dump for player2's units of the given type from player1's perspective. 

[(void  )] kbDumpVPSiteInfo(): blogs out info about all VP sites. 

[(bool  )] kbEscrowAllocateCurrentResources( void ): Reallocates the current resource stockpile into the escrows. 

[(int   )] kbEscrowCreate( string name, int resourceID, float percentage, int parentID ): Creates an escrow. 

[(bool  )] kbEscrowDestroy( int escrowID, bool promoteChildren ): Destroys an escrow. 

[(bool  )] kbEscrowFlush( int escrowID, int resourceID, bool flushChildren ): Removes all credits (and puts them into the root escrow) of the given resource type from the given escrow. 

[(float )] kbEscrowGetAmount( int escrowID, int resourceID ): Returns the amount of credits in the given escrow for the given resource. 

[(int   )] kbEscrowGetID( string name ): Returns the ID of the named escrow. 

[(float )] kbEscrowGetPercentage( int escrowID, int resourceID ): Returns the percentage of the escrow. 

[(bool  )] kbEscrowSetCap( int escrowID, int resourceID, float cap ): Sets the cap of the escrow. 

[(bool  )] kbEscrowSetPercentage( int escrowID, int resourceID, float percentage ): Sets the percentage of the escrow. 

[(int   )] kbFindAreaGroup( int groupType, float surfaceAreaRatio, int compareAreaID) : returns the visible area group that matches the given criteria. 

[(int   )] kbFindAreaGroupByLocation( int groupType, float relativeX, float relativeZ ) : returns the visible area group that matches the given criteria. 

[(int   )] kbFindBestBuildingToRepair(vector position, float distance, float healthRatio, int repairUnderAttackUnitTypeID) : returns the id of the best building to repair. 

[(long  )] kbFindClosestBase( long playerRelation, vector location ): gets the nearest base of player relation from the location. 

[(int   )] kbGetAge( void ): Returns the current age for the current player. 

[(int   )] kbGetAgeForPlayer( int id ): Returns the current age for the player specified. 

[(float )] kbGetAICostWeight( int resourceID ): Returns the AI cost weight for the given resource. 

[(float )] kbGetAmountValidResources( int baseID, int resourceTypeID, int resourceSubTypeID, float distance  ): Returns the resource amount of valid KB resources for the resource types. 

[(int   )] kbGetAttackRouteID( long startAreaID, long goalAreaID): Returns the id of the routes from area1 to area2. 

[(bool  )] kbGetAutoBaseCreate( void ): Returns the auto base creation value. 

[(float )] kbGetAutoBaseCreateDistance( void ): Returns the auto base creation distance. 

[(bool  )] kbGetAutoBaseDetect( void ): Returns the auto base detection value. 

[(float )] kbGetAutoBaseDetectDistance( void ): Returns the auto base creation distance. 

[(int   )] kbGetBlockID( string blockName ): Returns the UnitID of the cinematic block. 

[(vector)] kbGetBlockPosition( string blockName ): Returns the position of the cinematic block. 

[(int   )] kbGetBuildLimit(int player, int unitTypeID ): Returns the number of the unit type you are allowed to have (ONLY WORKS ON BASE UNIT TYPES); returns -1 if there is no limit. 

[(int   )] kbGetCiv( void ): Returns the civilization for the player. 

[(int   )] kbGetCivForPlayer( int playerID ): Returns the civ for the given player. 

[(string)] kbGetCivName( int civID ): Returns the civ name for the given civ. 

[(float )] kbGetCombatEfficiency( int playerID1, int unitTypeID1, int playerID2, int unitTypeID2 ): Returns the combat efficiency of the comparison (in terms of playerID1's units). 

[(int   )] kbGetCulture( void ): Returns the culture for the player. 

[(int   )] kbGetCultureForPlayer( int playerID ): Returns the culture for the given player. 

[(string)] kbGetCultureName( int cultureID ): Returns the culture name for the given culture. 

[(long  )] kbGetHCLevel( int playerID ): Returns the current HomeCity Level of the given player. 

[(vector)] kbGetMapCenter( void ): Returns the center vector of the map. 

[(float )] kbGetMapXSize( void ): Returns the X size of the map. 

[(float )] kbGetMapZSize( void ): Returns the Z size of the map. 

[(int   )] kbGetNumAttackRoutes( long startAreaID, long goalAreaID): Returns num paths from start to goal area. 

[(int   )] kbGetNumberMutualAllies( void ): Returns the number of mutual allies. 

[(int   )] kbGetNumberValidResources( int baseID, int resourceTypeID, int resourceSubTypeID, float distance ): Returns the number of valid KB resources for the resource types. 

[(int   )] kbGetNumberValidResourcesByPlan( int planID, int baseID ): Returns the number of valid KB resources for the given plan/base. 

[(float )] kbGetPlayerHandicap( int playerID ): Returns the player's handicap multiplier (ie., 1.0 = no handicap). 

[(string)] kbGetPlayerName( <playerID> ): Returns the player's name. 

[(int   )] kbGetPlayerTeam( <playerID> ): Returns the player's team number. 

[(int   )] kbGetPop( void ): Returns the current population for the player. 

[(int   )] kbGetPopCap( void ): Returns the current population cap for the player. 

[(int   )] kbGetPopCapAddition(int player, int unitTypeID ): Returns amount of pop cap addition provided by the given unit type (ONLY WORKS ON BASE UNIT TYPES). 

[(int   )] kbGetPopSlots(int player, int unitTypeID ): Returns the number of pop slots this unit takes (ONLY WORKS ON BASE UNIT TYPES). 

[(int   )] kbGetPopulationSlotsByQueryID( int queryID ): Returns the number of pop slots currently occupied by the results in the given query. 

[(int   )] kbGetPopulationSlotsByUnitTypeID( int playerID, int unitTypeID ): Returns the number of pop slots currently occupied by this unit type. 

[(float )] kbGetProtoUnitAICost( int protoUnitTypeID ): Returns the AI cost for the given protoUnit type ID. 

[(int   )] kbGetProtoUnitID( string name ): Returns the ID of the protounit. 

[(string)] kbGetProtoUnitName( int protoUnitTypeID ): Returns the name of the protounit ID. 

[(int   )] kbGetRandomEnabledPUID( int unitTypeID, int escrowID ): Returns a random, valid PUID that's of the given type. 

[(float )] kbGetResourceIncome( int resourceID, float seconds, bool relative ): Returns the resource income over the last X seconds. 

[(float )] kbGetTargetSelectorFactor(int type) : gets the TargetSelector Factor value. 

[(float )] kbGetTechAICost( int techID ): Returns the AI cost for the given tech ID. 

[(string)] kbGetTechName( int techID ): Returns the name of the tech ID. 

[(float )] kbGetTechPercentComplete( int techID ): Returns the percent complete for the the requested tech of the current player. 

[(int   )] kbGetTownAreaID( void ): Returns the area ID of the main town. 

[(vector)] kbGetTownLocation( void ): Returns the location of the main town. 

[(int   )] kbGetUnitBaseTypeID( int unitID ): Returns the base type ID of the unit. 

[(string)] kbGetUnitTypeName( int unitTypeID ): Returns the name of the unit type. 

[(int   )] kbGetVPGeneratorByScoreType(int siteType): returns the protounit ID for the VP generator that corresponds to this type of VP site. 

[(bool  )] kbHasPlayerLost( <playerID> ): Returns the player's lost status. 

[(bool  )] kbIsGameOver(): Returns whether the game is over or not. 

[(bool  )] kbIsPlayerAlly( int playerID ): Returns true if the given player is an ally. 

[(bool  )] kbIsPlayerEnemy( int playerID ): Returns true if the given player is an enemy. 

[(bool  )] kbIsPlayerHuman( int playerID ): Returns true if the given player is a a human player. 

[(bool  )] kbIsPlayerMutualAlly( int playerID ): Returns true if the given player is a mutual ally. 

[(bool  )] kbIsPlayerNeutral( int playerID ): Returns true if the given player is a neutral player. 

[(bool  )] kbIsPlayerResigned( <playerID> ): Returns the player's resigned status. 

[(bool  )] kbIsPlayerValid( int playerID ): Returns true if the given player is a valid player (i.e. it exists in the game). 

[(bool  )] kbLocationVisible( vector location ): Returns true if the location is currently visible to the player. 

[(void  )] kbLookAtAllUnitsOnMap( void ): Cheats and looks at all of the units on the map.  This will format your harddrive if you're not authorized to use it. 

[(bool  )] kbMakeAttackRoutes(): find all the paths to the sector specified. 

[(float )] kbMaximumResourceGet( int resourceID ): Returns the maximum amount of the given resource you can have. 

[(bool  )] kbPathAddWaypoint( int pathID, vector waypoint ): Adds the waypoint to the given path. 

[(int   )] kbPathCreate( string name ): Creates a path with the given name. 

[(bool  )] kbPathDestroy( int pathID ): Destroys the given path. 

[(int   )] kbPathGetIDByIndex( long index ): Returns the index-th path ID. 

[(float )] kbPathGetLength( int pathID ): Returns the length of the given path. 

[(string)] kbPathGetName( int pathID ): Returns the name of the given path. 

[(int   )] kbPathGetNumber( void ): Returns the number of paths. 

[(int   )] kbPathGetNumberWaypoints( int pathID ): Returns the number of waypoints in the given path. 

[(vector)] kbPathGetWaypoint( int pathID, long waypointNumber ): Returns the appropriate waypoint from the given path. 

[(float )] kbProgessionGetTotalResourceCost( int progressionID, int resourceID ): Returns the total cost of the given resource for this progressionID. A resourceID of -1 will return the total Cost. 

[(int   )] kbProgressionGetNodeData( int progressionID, int nodeIndex ): Returns the data at nodeIndex, either UnitID or TechID, depending on the type. 

[(int   )] kbProgressionGetNodeType( int progressionID, int nodeIndex ): Returns the type of node at the given index, either Unit type or Tech type. 

[(int   )] kbProgressionGetTotalNodes( int progressionID ): Returns the total number of steps to complete the progression. 

[(bool  )] kbProtoUnitAvailable( int protoUnitID ): Returns true if the protoUnit is currently available. 

[(bool  )] kbProtoUnitIsType( int playerID, int protoUnitID, int unitTypeID ): Returns true if the protounit is of the unitTypeID. 

[(float )] kbResourceGet( int resourceID ): Returns the current amount of the given resource. 

[(long  )] kbResourceGetXP( int playerID ): Returns the current amount XP the given player has. 

[(bool  )] kbSetAICostWeight( int resourceID, float weight ): Sets the weight this resource type is given during AI cost calculuations. 

[(void  )] kbSetAutoBaseCreate( bool v ): Sets the auto base creation value. 

[(void  )] kbSetAutoBaseCreateDistance( float v ): Sets the auto base creation distance. 

[(void  )] kbSetAutoBaseDetect( bool v ): Sets the auto base detection value. 

[(void  )] kbSetAutoBaseDetectDistance( float v ): Sets the auto base creation distance. 

[(void  )] kbSetForwardBasePosition(vector position) set the explicit position that every forward base will use. 

[(void  )] kbSetPlayerHandicap( int playerID, float handicap ): Sets the indicated player's handicap multiplier (ie., 1.0 = no handicap). 

[(int   )] kbSetTargetSelectorFactor(int type, float val) : sets the TargetSelector Factor value. 

[(bool  )] kbSetTownLocation( vector location ): Sets the location of the main town. 

[(bool  )] kbSetupForResource( int baseID, int resourceID, float distance, float amount ): Returns true if amount of resource is within distance of a dropsite. 

[(bool  )] kbTargetSelectorAddQueryResults( int queryID ): Sets the list of potential targets to the results in the given query. 

[(bool  )] kbTargetSelectorAddUnitType( int protoUnitTypeID ): Add the UAIT for the given BASE unit type as a filter. 

[(int   )] kbTargetSelectorCreate( string name ): Creates a target selector; returns the ID. 

[(bool  )] kbTargetSelectorDestroy( int id ): Destroys the given target selector. 

[(int   )] kbTargetSelectorGetNumberResults( void ): Returns the number of results in the given target selector. 

[(int   )] kbTargetSelectorGetResultValue( int index ): Returns the result value for given index of the current target selector. 

[(bool  )] kbTargetSelectorResetResults( void ): Resets the current target selector. 

[(bool  )] kbTargetSelectorSelect( int id ): Selects the given target selector. 

[(bool  )] kbTargetSelectorStart( void ): Starts the current target selector. 

[(float )] kbTechCostPerResource( int techID, int resourceID): returns the cost of the tech for the given resource. 

[(int   )] kbTechGetStatus( int techID ): Returns the current tech status for the current player of the requested tech. 

[(void  )] kbTechTreeDump( void ): Dumps the current state of the KBTT. 

[(int   )] kbTechTreeGetCheapestEconUpgrade( int resourceUnitTypeID ): gets cheapest researchable econ upgrade, optionally for specified resource unit type. 

[(int   )] kbTechTreeGetCheapestUnitUpgrade( int unitTypeID ): gets cheapest researchable unit upgrade, optionally for specified unit/unit line. 

[(float )] kbTotalResourceGet( int resourceID ): Returns the total amount of the given resource gathered to this point in the game. 

[(float )] kbUnitCostPerResource( int protoUnitID, int resourceID): returns the cost of the protounit for the given resource. 

[(int   )] kbUnitCount(int player, int unitTypeID, int stateID ): Returns a quick unit count of units for a player. 

[(void  )] kbUnitCountConsole(int playerID1, int playerID2, string unitType, string state(s) ): Returns a quick unit count of player2's units from player1's perspective. 

[(int   )] kbUnitGetActionType( int unitID ): Returns the actionTypeID of the unit. 

[(int   )] kbUnitGetAreaID( int unitID ): Returns the area ID for this unit ID. 

[(int   )] kbUnitGetArmyID( int unitID ): Returns the army ID for this unit ID. 

[(int   )] kbUnitGetBaseID( int unitID ): Returns the base ID for this unit ID. 

[(float )] kbUnitGetCurrentAICost( int unitID ): Returns the current AI cost (worth) for this unit ID. 

[(float )] kbUnitGetCurrentHitpoints( int unitID ): Returns the current hitpoints for this unit ID. 

[(float )] kbUnitGetHealth( int unitID ): Returns the health for this unit ID. 

[(float )] kbUnitGetMaximumAICost( int unitID ): Returns the maximum AI cost (worth) for this unit ID. 

[(float )] kbUnitGetMaximumHitpoints( int unitID ): Returns the maximum hitpoints for this unit ID. 

[(int   )] kbUnitGetMovementType( int unitTypeID ): Returns the movementType for this unitTypeID. 

[(int   )] kbUnitGetNumberWorkers( int unitID ): Returns the number of units currently working on the given unit. 

[(int   )] kbUnitGetPlanID( int unitID ): Returns the plan ID for this unit ID. 

[(int   )] kbUnitGetPlayerID(int unitID ): Returns the player ID for this unit ID. 

[(vector)] kbUnitGetPosition( int unitID ): Returns the position for this unit ID. 

[(int   )] kbUnitGetProtoUnitID( int unitID ): Returns the unit's protounit ID. 

[(int   )] kbUnitGetTargetUnitID( int unitID ): Returns the target unit ID of the given unit. 

[(int   )] kbUnitGetWorkerID( int unitID, int index ): Returns the index-th worker unit ID. 

[(bool  )] kbUnitIsType( int unitID, long unitTypeID ): Returns true if the unit is of the unitTypeID. 

[(bool  )] kbUnitPickAddCombatEfficiencyType( int upID, int typeID, float weight ) : Adds an enemy unit typeID to the unit pick combat efficiency calculation. 

[(bool  )] kbUnitPickAdjustPreferenceFactor( int upID, int unitTypeID, float baseFactorAdjustment ) : Adjusts the preferenceFactor for that unit type (uses 50.0 as the base if the UP doesn't exist yet). 

[(int   )] kbUnitPickCreate( string name ): Creates a unit pick. 

[(bool  )] kbUnitPickDestroy( int upID ): Destroys the given unit pick. 

[(int   )] kbUnitPickGetAttackUnitType( int upID ) : Gets the unit pick attack unit type. 

[(int   )] kbUnitPickGetDesiredNumberBuildings( int upID, int index ) : gets the unit pick desired number buildings for the index-th unit type. 

[(int   )] kbUnitPickGetDesiredNumberUnitTypes( int upID ) : Gets the unit pick desired number unit types. 

[(int   )] kbUnitPickGetGoalCombatEfficiencyType( int upID ) : Gets the unit pick attack unit type. 

[(int   )] kbUnitPickGetMaximumNumberUnits( int upID ) : Gets the unit pick maximum number units. 

[(int   )] kbUnitPickGetMaximumPop( int upID ) : Gets the unit pick maximum pop. 

[(int   )] kbUnitPickGetMinimumNumberUnits( int upID ) : Gets the unit pick minimum number units. 

[(int   )] kbUnitPickGetMinimumPop( int upID ) : Gets the unit pick minimum pop. 

[(int   )] kbUnitPickGetNumberResults( int upID ) : Returns the number of unit pick results. 

[(float )] kbUnitPickGetPreferenceWeight( int upID ) : Gets the unit pick preference weight. 

[(int   )] kbUnitPickGetResult( int upID, int index ) : Returns the index-th ProtoUnitID. 

[(bool  )] kbUnitPickResetAll( int upID ) : Resets all of the unit pick data. 

[(bool  )] kbUnitPickResetCombatEfficiencyTypes( int upID ) : Resets the enemy unit typeIDs for the unit pick combat efficiency calculation. 

[(bool  )] kbUnitPickResetResults( int upID ) : Resets the unit pick results. 

[(int   )] kbUnitPickRun( int upID ) : Runs the unit pick. 

[(bool  )] kbUnitPickSetAttackUnitType( int upID, int type ) : Sets the unit pick attack unit type. 

[(bool  )] kbUnitPickSetCombatEfficiencyWeight( int upID ) : Sets the unit pick combat efficiency weight. 

[(bool  )] kbUnitPickSetCostWeight( int upID ) : Sets the unit pick cost weight. 

[(bool  )] kbUnitPickSetDesiredNumberBuildings( int upID, int index, int numberBuildings ) : Sets the unit pick desired number buildings for the index-th unit type. 

[(bool  )] kbUnitPickSetDesiredNumberUnitTypes( int upID, int number, int numberBuildings, bool degradeNumberBuildings ) : Sets the unit pick desired number unit types. 

[(bool  )] kbUnitPickSetEnemyPlayerID( int upID, int playerID ) : Sets the unit pick enemy player ID. 

[(bool  )] kbUnitPickSetGoalCombatEfficiencyType( int upID, int type ) : Sets the unit pick attack unit type. 

[(bool  )] kbUnitPickSetMaximumNumberUnits( int upID, int number ) : Sets the unit pick desired number unit types. 

[(bool  )] kbUnitPickSetMaximumPop( int upID, int number ) : Sets the unit pick desired max pop. 

[(bool  )] kbUnitPickSetMinimumNumberUnits( int upID, int number ) : Sets the unit pick desired number unit types. 

[(bool  )] kbUnitPickSetMinimumPop( int upID, int number ) : Sets the unit pick desired min pop. 

[(bool  )] kbUnitPickSetMovementType( int upID, int movementType ) : Sets the unit pick movement type. 

[(bool  )] kbUnitPickSetPreferenceFactor( int upID, int unitTypeID, float preferenceFactor ) : Sets the preferenceFactor for that unit type. 

[(bool  )] kbUnitPickSetPreferenceWeight( int upID, float v ) : Sets the unit pick preference weight. 

[(int   )] kbUnitQueryCreate( string name ): Creates a unit query, returns the query ID. 

[(bool  )] kbUnitQueryDestroy( long queryID ): Destroys the given unit query. 

[(int   )] kbUnitQueryExecute( long queryID ): Executes the current query; returns number of results. 

[(int   )] kbUnitQueryExecuteOnQuery( long currentQueryID, int previousQueryID ): Executes the current query on the previous query's results; returns the new number of results. 

[(int   )] kbUnitQueryExecuteOnQueryByName( long currentQueryID, string previousQueryName ): Executes the current query on the previous query's results; returns the new number of results. 

[(int   )] kbUnitQueryGetResult( long queryID, int index ): Returns the UnitID of the index-th result in the current query. 

[(float )] kbUnitQueryGetUnitCost(int queryID, bool considerHealth): gets total aiCost of query's units, weighted for HP if requested. 

[(float )] kbUnitQueryGetUnitHitpoints(int queryID, bool considerHealth): gets HP of query's units, using current HP if requested. 

[(int   )] kbUnitQueryNumberResults( long queryID ): Returns the number of results in the current query. 

[(bool  )] kbUnitQueryResetData( long queryID ): Resets the given unit query data AND results. 

[(bool  )] kbUnitQueryResetResults( long queryID ): Resets the given unit query results. 

[(bool  )] kbUnitQuerySetActionType( long queryID, int actionTypeID ): Sets query data. 

[(bool  )] kbUnitQuerySetAreaGroupID( long queryID, int areaGroupID ): Sets query data. 

[(bool  )] kbUnitQuerySetAreaID( long queryID, int areaID ): Sets query data. 

[(bool  )] kbUnitQuerySetArmyID( long queryID, int armyID ): Sets query data. 

[(bool  )] kbUnitQuerySetAscendingSort( long queryID, bool v ): If parm is true, results are sorted in ascending distance order from the query position. 

[(bool  )] kbUnitQuerySetBaseID( long queryID, int baseID ): Sets query data. 

[(bool  )] kbUnitQuerySetIgnoreKnockedOutUnits( long queryID, bool v ): Sets query data. 

[(bool  )] kbUnitQuerySetMaximumDistance( long queryID, float distance ): Sets query data. 

[(bool  )] kbUnitQuerySetPlayerID( long queryID, int playerID, bool resetQueryData ): Sets query data. 

[(bool  )] kbUnitQuerySetPlayerRelation( long queryID, int playerRelation ): Sets query data. 

[(bool  )] kbUnitQuerySetPosition( long queryID, vector v ): Sets query data. 

[(bool  )] kbUnitQuerySetSeeableOnly( long queryID, bool seeableOnly ): Sets query data. 

[(bool  )] kbUnitQuerySetState( long queryID, int state ): Sets query data. 

[(bool  )] kbUnitQuerySetUnitType( long queryID, int unitTypeID ): Sets query data. 

[(bool  )] kbUnitVisible( int unitID ): Returns true if the unit is currently visible to the player. 

[(int   )] kbVPSiteGetLocation(int siteID): returns the specified VP site's world location. 

[(int   )] kbVPSiteGetOwnerPlayerID(int siteID): returns the specified VP site's owning player. 

[(int   )] kbVPSiteGetState(int siteID): returns the specified VP site's state. 

[(int   )] kbVPSiteGetType(int siteID): returns the specified VP site's type (e.g., native, trade, etc). 

[(int   )] kbVPSiteQuery(int scoreType, int playerRelationOrID, int siteState): returns ID for an array containing VP site IDs that match the specified parameters.