AI Command





[(long  )] aiActivateOpportunity( int opportunityID, bool flag ): activates or deactivates an opportunity on the player's opp list. 

[(void  )] aiAttemptResign(): asks the player if its ok to resign 

[(void  )] aiAutoSavegame( string filename ): Saves the auto, debugging savegames (THIS DOESN'T REALLY DO ANYTHING). 

[(void  )] aiBreakpointGo( int playerID ): Restart XS execution after the current breakpoint. 

[(void  )] aiBreakpointSet( int playerID, string filename, int lineNumber, bool on ): Sets a breakpoint. 

[(bool  )] aiBreakTreaty(int escrowID): breaks the treaty using funds from the given escrow. 

[(bool  )] aiBuildWall(int buildingID, int escrowID): builds walls around the specified building's colony using the specified escrow. 

[(bool  )] aiBuyResourceOnMarket( int resourceID): buys (+100) the given resource. 

[(int   )] aiCalculateMostHatedPlayerID( int comparePlayerID ): Returns the playerID for the player the AI thinks it should be attacking. 

[(bool  )] aiCanBuildWall(int buildingID, int escrowID): returns whether it is allowed to build a wall around the specified building's colony, and whether the player can afford it from the specified escrow. 

[(bool  )] aiCastGodPowerAtPosition( int godPowerTechID, vector pos): Casts the given God power tech, at the specified position. 

[(bool  )] aiCastGodPowerAtUnit( int godPowerTechID, int unitID): Casts the given God power tech, at the specified unit. 

[(void  )] aiChat( int playerID, string chatString ): CP AI chat to playerID. 

[(      )] aiCommsAllowChat( bool flag ): enables or disables the chats from this ai player. 

[(long  )] aiCommsGetChatTargetType(int sentenceID): get target type for specified sentence. 

[(long  )] aiCommsGetChatVerb(int sentenceID): get chat verb for specified sentence. 

[(long  )] aiCommsGetSendingPlayer(int sentenceID): get sending player for specified sentence. 

[(long  )] aiCommsGetTargetListCount(int sentenceID): get number of items in target list for specified sentence. 

[(long  )] aiCommsGetTargetListItem(int sentenceID, int index): get index item from specified sentence. 

[(vector)] aiCommsGetTargetLocation(int sentenceID): get target location from specified sentence. 

[(void  )] aiCommsSendReply(int sentenceID, int responseID): send a reply to a sentence. 

[(int   )] aiCommsSendStatement(targetPlayerID, int promptType): Sends a statement to the designated player. 

[(int   )] aiCommsSendStatementWithVector(targetPlayerID, int promptType, vector v): Sends a statement to the designated player. Adds a location flare. 

[(bool  )] aiCommsSetEventHandler(string handlerFunctionName ): Sets the handler for the communications system (invalid name unsets the handler). 

[(long  )] aiCreateOpportunity(int type, int targettype, int targetID, int targetPlayerID, int source ): adds an opportunity to the list and returns the id. 

[(long  )] aiDestroyOpportunity( int opportunityID): remove an opportunity on the player's opp list. 

[(bool  )] aiDoesWallExist(int buildingID): returns whether a wall exists around the specified building's colony. 

[(bool  )] aiDoTradeMonopoly(): Executes a trade monopoly command, returns false if it fails. 

[(void  )] aiEcho( string echoString ): CP AI echo. 

[(void  )] aiErrorMessage( string errorString ): CP AI error. 

[(int   )] aiFindBestAttackGodPowerPlan(void): find a valid god power plan to attach to an attack plan 

[(void  )] aiFindBestOpportunity(): finds the best currently scored opp. 

[(int   )] aiFindBestTownDefenseGodPowerPlan(void): find a valid god power plan to use for town defense 

[(bool  )] aiGetAllowBuildings( void ): Returns allow buildings on/off. 

[(float )] aiGetAttackResponseDistance( void ): Returns the attack response distance. 

[(int   )] aiGetAutoFarmEscrowID( void ): Returns the auto Farm escrow ID. 

[(int   )] aiGetAutoGatherEscrowID( void ): Returns the auto gather escrow ID. 

[(bool  )] aiGetAutosaveOn(): returns whether or not its cool to turn ai autosaves on. 

[(int   )] aiGetAvailableEconomyPop( void ): Returns the available economy pop for this player. 

[(int   )] aiGetAvailableMilitaryPop( void ): Returns the script-defined military pop for this player. 

[(int   )] aiGetCaptainPlayerID( int playerID ): Returns the captain for the given player's team. 

[(int   )] aiGetCurrentEconomyPop( void ): Returns the current economy pop for this player. 

[(void  )] aiGetCurrentResourceNeed( int resourceID ): returns the current resource need for the given resource. 

[(float )] aiGetEconomyPercentage( void ): Returns the economy priority percentage. 

[(int   )] aiGetEconomyPop( void ): Returns the script-defined economy pop for this player. 

[(float )] aiGetExploreDangerThreshold(): gets the ai's Explore Danger Threshold value. 

[(int   )] aiGetFallenExplorerID(): returns the ID of the fallen explorer; if there isn't one, returns -1 

[(int   )] aiGetFarmLimit( void ): Returns the per plan farm build limit. 

[(int   )] aiGetGameMode( void ): Returns the game's mode. 

[(int   )] aiGetGameType(): returns the current game type (e.g., cGameTypeScenario, cGameTypeRandom, etc). 

[(int   )] aiGetGodPowerProtoIDForTechID( int techID): translate a granted tech id into a protopower id 

[(int   )] aiGetGodPowerTechIDForSlot( int slotID): Get the god power tech id from the given slot. 

[(int   )] aiGetGodPowerType( int protoPowerID): get the type for a ProtoPower 

[(vector)] aiGetHCGatherPoint( void ): Returns the HCGP. 

[(int   )] aiGetKOTHController(): Gets the team that is king of the hill. 

[(int   )] aiGetLastCollectedNuggetEffect(int playerID): Gets the last collected nugget's effect 

[(int   )] aiGetLastCollectedNuggetType(int playerID): Gets the last collected nugget's type 

[(float )] aiGetMarketBuyCost( int resourceID ): Returns the amount required to buy 100 units of the given resource. 

[(float )] aiGetMarketSellCost( int resourceID ): Returns the amount received for selling 100 units of the given resource. 

[(int   )] aiGetMaxLOSProtoUnitLimit(): gets the limit for how many LOS Protounits the AI can build 

[(float )] aiGetMilitaryPercentage( void ): Returns the militarypriority percentage. 

[(int   )] aiGetMilitaryPop( void ): Returns the script-defined military pop for this player. 

[(int   )] aiGetMinNumberNeedForGatheringAggressives(): gets the min number of needed units to gather aggressive animals. 

[(int   )] aiGetMinNumberWantForGatheringAggressives(): gets the min number of wanted units to gather aggressive animals. 

[(int   )] aiGetMostHatedPlayerID( void ): Returns the script-defined most hated player ID for this player. 

[(int   )] aiGetNumberIdlePlans( int planType ): Gets the of idle plans of the given type. 

[(int   )] aiGetNumberRelicsControlled(int teamID): Gets the number of relics controlled by this team (for relic victory). 

[(int   )] aiGetNumberRelicsNeededForVictory(): Gets the number of relics needed to make a relic win possible. 

[(long  )] aiGetNumberTeams(): returns the number of teams in the game. 

[(int   )] aiGetNumberTradePostsControlled(int teamID): Gets the number of tradeposts controlled by this team (for monopoly victory). 

[(int   )] aiGetNumberTradePostsNeededForMonopoly(): Gets the number of tradeposts needed to make a monopoly win possible. 

[(vector)] aiGetOpportunityLocation(  int opportunityID ): gets the location from this opportunity 

[(float )] aiGetOpportunityRadius(  int opportunityID ): gets the radius from this opportunity 

[(long  )] aiGetOpportunitySourceID(  int opportunityID ): gets the source id from this opportunity 

[(long  )] aiGetOpportunitySourceType(  int opportunityID ): gets the source type from this opportunity 

[(long  )] aiGetOpportunityTargetID(  int opportunityID ): gets the target id from this opportunity 

[(long  )] aiGetOpportunityTargetPlayerID(  int opportunityID ): gets the target playerID from this opportunity 

[(long  )] aiGetOpportunityTargetType(  int opportunityID ): gets the target type from this opportunity 

[(long  )] aiGetOpportunityType(  int opportunityID ): gets the type from this opportunity 

[(bool  )] aiGetPauseAllAgeUpgrades(): gets the pause all age upgrades flag from the AI. 

[(string)] aiGetPersonality( void ): Gets the player's personality. 

[(int   )] aiGetPoliticianChoice(int age): Gets the scripts choice for the AgeX Politician. 

[(int   )] aiGetPoliticianListByIndex(int age, int index): Gets the index'th Politicans avaiable for AgeX. 

[(int   )] aiGetPoliticianListCount(int age): Gets the number of Politicans avaiable for AgeX. 

[(int   )] aiGetPopNeeds(): gets the current Pop needs of all the plans. 

[(int   )] aiGetResourceBreakdownNumberPlans( int resourceTypeID, int resourceSubTypeID, int baseID ): Gets the number of plans for the given breakdown. 

[(float )] aiGetResourceBreakdownPercentage( int resourceTypeID, int resourceSubTypeID, int baseID ): Gets the percentage for the given breakdown. 

[(int   )] aiGetResourceBreakdownPlanPriority( int resourceTypeID, int resourceSubTypeID, int baseID ): Gets the priority of the plans for the given breakdown. 

[(float )] aiGetResourceGathererPercentage( int resourceID, int rgpIndex ): Returns the resource gatherer percentage for the given resource. 

[(float )] aiGetResourceGathererPercentageWeight( int rgpIndex ): Returns the RGP weight. 

[(long  )] aiGetScore(int playerID): returns the score for the given player. 

[(bool  )] aiGetWallRadius(int buildingID): returns the wall radius for the specified building's colony. 

[(bool  )] aiGetWaterMap(): Tells us if the AI thinks this is a water map or not. 

[(int   )] aiGetWorldDifficulty( void ): Returns the world difficulty level. 

[(string)] aiGetWorldDifficultyName( int level ): Returns the name of the level. 

[(int   )] aiGoalGetIDByIndex( int goalType, int goalState, bool active, int index ): Returns the ID of matching goal. 

[(int   )] aiGoalGetNumber( int goalType, int goalState, bool active ): Returns the number of matching goals. 

[(bool  )] aiHCCardsBuyCard(int cardIndex): Buy this card now 

[(bool  )] aiHCCardsCanIBuyThisCard(int deckIndex, int cardIndex): Can I buy this card now? 

[(long  )] aiHCCardsFindBestCard(int cardType, int levelPref, int resourcePref): Get the best card using the optional cardtype and optional resourcePreference 

[(long  )] aiHCCardsGetCardAgePrereq(int cardIndex): For this cardIndex, get the age prereq. 

[(long  )] aiHCCardsGetCardCount(): For this cardIndex, get the CardCount, -1 is Infinite. 

[(long  )] aiHCCardsGetCardLevel(int cardIndex): For this cardIndex, get the age prereq. 

[(long  )] aiHCCardsGetCardTechID(): For this cardIndex, get the TechID. 

[(long  )] aiHCCardsGetCardUnitCount(): For this cardIndex, get the UnitCount. 

[(long  )] aiHCCardsGetCardUnitType(): For this cardIndex, get the UnitType. 

[(long  )] aiHCCardsGetTotal(): Returns the number of cards in the Current HC. 

[(bool  )] aiHCCardsIsCardBought(int cardIndex): Has the cardindex been bought yet? 

[(bool  )] aiHCDeckActivate( long deckIndex ): Makes the deckIndex the current active HC deck. 

[(long  )] aiHCDeckAddCardToDeck( long deckIndex, long cardIndex): Adds the card given to the givenHC Deck. 

[(bool  )] aiHCDeckCanPlayCard( long cardIndex ): Can we play this card from the given deck? 

[(bool  )] aiHCDeckCardGetCardCount( long deskIndex, long cardIndex ): Gets how many cards of this type we can send. -1 mean infinite. 

[(bool  )] aiHCDeckCreate( string ): Create a new HC Deck with the given name. 

[(long  )] aiHCDeckGetCardAgePrereq( long deckIndex, long cardIndex ): For this card, get the age prereq 

[(long  )] aiHCDeckGetCardLevel( long deckIndex, long cardIndex ): For this card, get the level 

[(long  )] aiHCDeckGetCardTechID( long deckIndex, long cardIndex ): For this card, get the techID 

[(long  )] aiHCDeckGetCardUnitCount( long deckIndex, long cardIndex ): For this card, get the unit Count 

[(long  )] aiHCDeckGetCardUnitType( long deckIndex, long cardIndex ): For this card, get the unitType 

[(long  )] aiHCDeckGetNumberCards( long deckIndex): Returns the number of cards in the Current HC Deck. 

[(bool  )] aiHCDeckPlayCard( long cardIndex ): play this card. 

[(long  )] aiHCGetNumberDecks(): Returns the number of decks in the Current HC. 

[(bool  )] aiIsKOTHAllowed(): Returns true if a King of the Hill victory is possible in this game type. 

[(bool  )] aiIsMapType(string -see 3 constants at right-):Is this a certain maptype or not. (AIFishingUseful, AITransportRequired, AITransportUseful) 

[(bool  )] aiIsMonopolyAllowed(): Returns true if a trade monopoly is possible in this game type. 

[(bool  )] aiIsMultiplayer(): returns true, if this is a multiplayer game. 

[(bool  )] aiIsRelicCaptureAllowed(): Returns true if a relic capture victory is possible in this game type. 

[(int   )] aiIsTeamKOTH(int teamID): Returns true if this team is king of the hill. 

[(void  )] aiNormalizeResourceGathererPercentages( int rgpIndex ): Normalizes all of the resource gatherer percentages to 1.0. 

[(void  )] aiNormalizeResourceGathererPercentageWeights( void ): Normalizes all of the resource gatherer percentages weights to 1.0. 

[(int   )] aiNumberUnassignedUnits( int typeID ): Returns the number of unassigned units of the given type. 

[(int   )] aiNumberUnassignedUnitsByGoal( int goalID ): Returns the number of unassigned units based on the goal's unit type(s). 

[(int   )] aiPersonalityCreatePlayerHistory( void ): Creates are player history for the given playername. 

[(bool  )] aiPersonalityGetDidIWinLastGameVS(int playerHistoryIndex) 

[(int   )] aiPersonalityGetGameFirstAttackTime(int playerHistoryIndex, int gameIndex): Returns the 1st attacktime from the gameIndex game. 

[(float )] aiPersonalityGetGameResource(int playerHistoryIndex, int gameIndex, int resourceID): Returns the given resource from the gameIndex game. If gameIndex is -1, this will return the avg of all games played. 

[(int   )] aiPersonalityGetGameUnitCount(int playerHistoryIndex, int gameIndex, int unitType): Returns the unit count from the gameIndex game. If gameIndex is -1, this will return the avg of all games played. 

[(int   )] aiPersonalityGetNumberPlayerHistories( void ): Returns the number of player's in the Personality's history. 

[(int   )] aiPersonalityGetPlayerGamesPlayed(int playerHistoryIndex, int playerRelation): Returns the number of games played against/with the given the playerHistoryIndex. 

[(int   )] aiPersonalityGetPlayerHistoryIndex( string searchPlayerName ): Returns a playerHistoryIndex if this personality has played searchPlayerName before. 

[(string)] aiPersonalityGetPlayerHistoryName( int index ): Returns the name of the index'th player in the Personality's history. 

[(float )] aiPersonalityGetPlayerUserVar( int playerHistoryIndex, string userVarName ): Returns the user value, given the playerHistoryIndex and the userVarName. 

[(float )] aiPersonalityGetRushBoom( void ): Returns the rush boom scale for this ai. 

[(int   )] aiPersonalityGetTotalGameWins(int playerHistoryIndex, int playerRelation): Returns the total games the given player has won against this AI 

[(bool  )] aiPersonalityResetPlayerHistory( int playerHistoryIndex ): Resets the given player history. 

[(bool  )] aiPersonalitySetPlayerUserVar( int playerHistoryIndex, string userVarName, float val ): sets the value, given the playerHistoryIndex, userVarName (max 255 chars), and value. 

[(bool  )] aiPlanAddUnit( int planID, int unitID ): Adds a unit to the plan. 

[(bool  )] aiPlanAddUnitType( int planID, int unitTypeID, int numberNeed, int numberWant, int numberMax ): Adds a unit type to the plan. 

[(bool  )] aiPlanAddUserVariableBool( int planID, int planVariableIndex, string name, int numberValues ): Adds the variable to the given plan. 

[(bool  )] aiPlanAddUserVariableFloat( int planID, int planVariableIndex, string name, int numberValues ): Adds the variable to the given plan. 

[(bool  )] aiPlanAddUserVariableInt( int planID, int planVariableIndex, string name, int numberValues ): Adds the variable to the given plan. 

[(bool  )] aiPlanAddUserVariableString( int planID, int planVariableIndex, string name, int numberValues ): Adds the variable to the given plan. 

[(bool  )] aiPlanAddUserVariableVector( int planID, int planVariableIndex, string name, int numberValues ): Adds the variable to the given plan. 

[(bool  )] aiPlanAddWaypoint( int planID, vector waypoint ): Adds the waypoint to the given plan. 

[(int   )] aiPlanCreate( string planName, int typeName ): Creates a plan of the given name and type. 

[(bool  )] aiPlanDestroy( int planID ): Destroys the given plan. 

[(bool  )] aiPlanDestroyByName( string name ): Destroys the plan of the given name. 

[(bool  )] aiPlanGetActive( int planID ): Gets the active-ness of the given plan. 

[(int   )] aiPlanGetActualPriority( int planID ): Returns the priority of the given plan. 

[(bool  )] aiPlanGetAllowUnderAttackResponse( int planID ): Gets the UA response-ness of the given plan. 

[(bool  )] aiPlanGetAttack( int planID ): Gets the attack flag of the given plan. 

[(int   )] aiPlanGetBaseID( int planID): gets the plan's base id. 

[(int   )] aiPlanGetDesiredPriority( int planID ): Returns the priority of the given plan. 

[(bool  )] aiPlanGetEconomy( int planID ): Gets the economy flag of the given plan. 

[(int   )] aiPlanGetEscrowID( int planID ): Gets the escrow for the plan. 

[(int   )] aiPlanGetID( string name ): Returns the ID of the plan with the given name. 

[(int   )] aiPlanGetIDByActiveIndex( int activeIndex ): Returns the ID of the plan with the given active index. 

[(int   )] aiPlanGetIDByIndex( int planType, int planState, bool active, int index ): Returns the ID of matching plan. 

[(int   )] aiPlanGetIDByTypeAndVariableType( int planType, int varType, int varID, bool active ): Returns the ID of the plan with the given parms. 

[(int   )] aiPlanGetIDSubStr( string searchStr ): Returns the ID of the first plan containing the given string in its name. 

[(vector)] aiPlanGetInitialPosition( int planID ): Returns the initial positon that was set for this plan. 

[(vector)] aiPlanGetLocation( int planID ): Returns the location for this plan. 

[(bool  )] aiPlanGetMilitary( int planID ): Gets the military flag of the given plan. 

[(string)] aiPlanGetName( int planID ): Returns the name of the given plan. 

[(bool  )] aiPlanGetNoMoreUnits( int planID ): Gets the noMoreUnits-ness of the given plan. 

[(int   )] aiPlanGetNumber( int planType, int planState, bool active ): Returns the number of matching plans. 

[(int   )] aiPlanGetNumberUnits( int planID, int unitTypeID ): Returns the number of units currently assigned in the given plan. 

[(int   )] aiPlanGetNumberUserVariableValues( int planID, int planVariableIndex ): Returns the number of values for this variable index. 

[(int   )] aiPlanGetNumberVariableValues( int planID, int planVariableIndex ): Returns the number of values for this variable index. 

[(bool  )] aiPlanGetOrphan( int planID ): Gets the orphan-ness of the given plan. 

[(int   )] aiPlanGetState( int planID ): Returns the state of the given plan. 

[(int   )] aiPlanGetType( int planID ): Returns the type of the given plan. 

[(float )] aiPlanGetUnitCost(int planID, bool considerHitPoints): gets total aiCost of plan's units, weighted for HP if requested. 

[(int   )] aiPlanGetUnitStance( int planID ): Gets the unit stance of the given plan. 

[(bool  )] aiPlanGetUserVariableBool( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(float )] aiPlanGetUserVariableFloat( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(int   )] aiPlanGetUserVariableInt( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(string)] aiPlanGetUserVariableString( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(vector)] aiPlanGetUserVariableVector( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(bool  )] aiPlanGetVariableBool( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(float )] aiPlanGetVariableFloat( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(int   )] aiPlanGetVariableInt( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(string)] aiPlanGetVariableString( int planID, int planVariableIndex ): Gets the given variable of the given plan. 

[(vector)] aiPlanGetVariableVector( int planID, int planVariableIndex, int valueIndex ): Gets the given variable of the given plan. 

[(bool  )] aiPlanRemoveUserVariable( int planID, int planVariableIndex ): Removes the user variable. 

[(bool  )] aiPlanRemoveUserVariables( int planID ): Removes all of the user variables from the given plan. 

[(bool  )] aiPlanRemoveUserVariableValue( int planID, int planVariableIndex, int variableIndex ): Removes the index-th value of the user variable. 

[(bool  )] aiPlanRemoveVariableValue( int planID, int planVariableIndex, int variableIndex ): Removes the index-th value of the variable. 

[(bool  )] aiPlanSetActive( int planID, bool active ): Sets active on/off for the given plan. 

[(bool  )] aiPlanSetAllowUnderAttackResponse( int planID, bool uAR ): Sets under attack response on/off for the given plan. 

[(bool  )] aiPlanSetAttack( int planID, bool v ): Sets attack flag on/off for the given plan. 

[(bool  )] aiPlanSetBaseID( int planID, int baseID ): sets the plan's base id. 

[(bool  )] aiPlanSetDesiredPriority( int planID, int priority ): Sets the priority of the given plan. 

[(bool  )] aiPlanSetEconomy( int planID, bool v ): Sets economy on/off for the given plan. 

[(bool  )] aiPlanSetEscrowID( int planID, int escrowID ): Sets the escrow for the plan. 

[(bool  )] aiPlanSetEventHandler( int planID, int eventType, string handlerName ): Sets event handler function for the given plan and event. 

[(void  )] aiPlanSetInitialPosition( int planID, vector initialPosition ): Sets the initial positon for this plan. 

[(bool  )] aiPlanSetMilitary( int planID, bool v ): Sets military on/off for the given plan. 

[(bool  )] aiPlanSetNoMoreUnits( int planID, bool v ): Sets noMoreUnits on/off for the given plan. 

[(bool  )] aiPlanSetNumberUserVariableValues( int planID, int planVariableIndex, int numberValues, bool clearCurrentValues ): Sets the number of values for this variable. 

[(bool  )] aiPlanSetNumberVariableValues( int planID, int planVariableIndex, int numberValues, bool clearCurrentValues ): Sets the number of values for this variable. 

[(bool  )] aiPlanSetOrphan( int planID, bool orphan ): Sets orphan on/off for the given plan. 

[(bool  )] aiPlanSetRequiresAllNeedUnits( int planID, bool rANU ): Sets 'requiresAllNeedUnits' on/off for the given plan. 

[(bool  )] aiPlanSetUnitStance( int planID, int stance ): Sets unit stance for the given plan. 

[(bool  )] aiPlanSetUserVariableBool( int planID, int planVariableIndex, int valueIndex, bool value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetUserVariableFloat( int planID, int planVariableIndex, int valueIndex, float value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetUserVariableInt( int planID, int planVariableIndex, int valueIndex, int value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetUserVariableString( int planID, int planVariableIndex, int valueIndex, string value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetUserVariableVector( int planID, int planVariableIndex, int valueIndex, vector value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetVariableBool( int planID, int planVariableIndex, int valueIndex, bool value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetVariableFloat( int planID, int planVariableIndex, int valueIndex, float value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetVariableInt( int planID, int planVariableIndex, int valueIndex, int value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetVariableString( int planID, int planVariableIndex, int valueIndex, string value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetVariableVector( int planID, int planVariableIndex, int valueIndex, vector value ): Sets the given variable of the given plan. 

[(bool  )] aiPlanSetWaypoints( int planID, int pathID ): Sets the waypoints of the given plan to the waypoints of the given path. 

[(bool  )] aiPopulatePoliticianList(): Call this to make the AI fill out what Politicians are available. 

[(void  )] aiQueueAutoSavegame( int saveNumber ): Queues the auto savegame. 

[(int   )] aiRandInt( int max ): Returns a random number (mod'ed by max if provided). 

[(vector)] aiRandLocation( void ): Returns a random location guaranteed to be on the map. 

[(void  )] aiRandSetSeed( int seed ): Sets the seed of the random number generator. 

[(bool  )] aiRansomExplorer(int explorerID, int escrowID, int sourceBuildingID): ransoms the specified explorer using funds from the specified escrow account and spawns it from the specified building. 

[(bool  )] aiReadyForTradeMonopoly(): Returns true if the monopoly command can be given now.  Does not check cost. 

[(bool  )] aiRemoveResourceBreakdown( int resourceTypeID, int resourceSubTypeID, int baseID ): Removes the given breakdown. 

[(void  )] aiResign(): reigns the current player.. 

[(bool  )] aiResourceIsLocked(int resourceID): Is this Escrow resource locked. 

[(void  )] aiResourceLock(int resourceID): Prevent a resource from being spent by the AI. 

[(void  )] aiResourceUnlock(int resourceID): Allow a resource to be spent by the AI. 

[(bool  )] aiSellResourceOnMarket( int resourceID): sells (+100) the given resource. 

[(void  )] aiSendChatToAllies( string chatString ): CP AI chat to allies. 

[(void  )] aiSendChatToEnemies( string chatString ): CP AI chat to enemies. 

[(void  )] aiSendChatToEveryone( string chatString ): CP AI chat to everyone. 

[(void  )] aiSet( string filename, int playerID ): Sets playerID's AI to the given filename. 

[(void  )] aiSetAllowBuildings( bool v ): Sets allow buildings on/off. 

[(void  )] aiSetAttackResponseDistance( float v ): Set the attack response distance. 

[(void  )] aiSetAutoFarmEscrowID( int escrowID ): Sets the auto Farm escrow ID. 

[(void  )] aiSetAutoGatherEscrowID( int escrowID ): Sets the auto gather escrow ID. 

[(bool  )] aiSetAutoGatherMilitaryUnits( bool v ): Turns auto gathering of military units at bases on/off. 

[(void  )] aiSetDefaultStance( int defaultStance ): Sets your default stance for all of your units. 

[(void  )] aiSetEconomyPercentage( float v ): Set the economy priority percentage. 

[(void  )] aiSetEconomyPop( int v ): Set the script-defined economy pop for this player. 

[(bool  )] aiSetExploreDangerThreshold( float value): sets the ai's Explore Danger Threshold value. 

[(void  )] aiSetFarmLimit( int limit ): Sets the per plan farm build limit. 

[(bool  )] aiSetHandler( string handlerFunctionName, int type ): Sets the handler for given type of event. 

[(bool  )] aiSetHCGatherPoint( vector point ): Sets the HCGP. 

[(void  )] aiSetMaxLOSProtoUnitLimit(int limit): sets the limit for how many LOS Protounits the AI can build 

[(void  )] aiSetMilitaryPercentage( float v ): Set the military priority percentage. 

[(void  )] aiSetMilitaryPop( int v ): Set the script-defined military pop for this player. 

[(void  )] aiSetMinArmySize(long v): sets the min number of units in an attack army. 

[(void  )] aiSetMinNumberNeedForGatheringAggressvies(long v): sets the min number of needed units to gather aggressive animals. 

[(void  )] aiSetMinNumberWantForGatheringAggressives(long v): sets the min number of wanted units to gather aggressive animals. 

[(void  )] aiSetMostHatedPlayerID( int v ): Sets the script-defined most hated player ID for this player. 

[(void  )] aiSetOpportunityLocation(  int opportunityID, vector location ): sets the location for this opp. 

[(void  )] aiSetOpportunityRadius(  int opportunityID, float radius ): sets the radius for this opp. 

[(bool  )] aiSetOpportunityScore(  long oppID, long permission, float affordable, float classscore, float instance, float total ): sets the score for this opp. 

[(void  )] aiSetOpportunityTargetID(  int opportunityID, int targetType ): sets the target id for this opp. 

[(void  )] aiSetOpportunityTargetType(  int opportunityID, int targetType ): sets the target type for this opp. 

[(void  )] aiSetPauseAllAgeUpgrades(bool v): sets the pause all age upgrades flag in the AI. 

[(void  )] aiSetPoliticianChoice(int age, int puid): Sets the scripts choice for the AgeX Politician. 

[(void  )] aiSetRandomMap(bool v): Sets the RM bool in the AI. 

[(bool  )] aiSetResourceBreakdown( int resourceTypeID, int resourceSubTypeID, int numberPlans, int planPriority, float percentage, int baseID ): Sets a subtype breakdown for a resource. 

[(void  )] aiSetResourceGathererPercentage( int resourceID, float value, bool normalize, int rgpIndex ): Sets the resource gatherer percentage for the given resource (if normalized is true, the percentages will be normalized to 1.0). 

[(void  )] aiSetResourceGathererPercentageWeight( int rgpIndex, float weight ): Sets the RGP weight. 

[(void  )] aiSetWaterMap( bool v): Tells the AI if this is a water map or not. 

[(void  )] aiSetWorldDifficulty( int v ): Sets the world difficulty level. 

[(void  )] aiSwitchMainBase(int newBaseID, bool force): switch the newBaseID to be the main base. 

[(bool  )] aiTaskUnitBuild( int unitID, int buildingTypeID, vector position ): Does a lightweight (no plan) build tasking of the given unit to build the given building. 

[(bool  )] aiTaskUnitDelete( int unitID ): Deletes the given unit. 

[(bool  )] aiTaskUnitMove( int unitID, vector position ): Does a lightweight (no plan) move tasking of the given unit to the given location. 

[(bool  )] aiTaskUnitResearch( int unitID, int techID ): Does a lightweight (no plan) research tasking of the given unit for the given tech ID. 

[(bool  )] aiTaskUnitSpecialPower( int unitID, int powerID, vector position ): Does a lightweight (no plan) research tasking of the given unit for the given special power. 

[(bool  )] aiTaskUnitTrain( int unitID, int unitTypeID ): Does a lightweight (no plan) train tasking of the given unit for the given target unit type. 

[(bool  )] aiTaskUnitWork( int unitID, int targetUnitID ): Does a lightweight (no plan) work tasking of the given unit on the given target unit. 

[(bool  )] aiTreatyActive(): checks whether the given player has a treaty. 

[(bool  )] aiTribute( int playerID, int resourceID, float amount ): Tributes the given player. 

[(int   )] aiUnitGetTactic(int unitID): gets the specified unit's current tactic. 

[(bool  )] aiUnitSetTactic(int unitID, int tacticID): sets the specified tactic on the specified unit.