//============================================================================== /* C:\work\Spartan\main\age4\age4-dev\age4w\ai\CORE\Age2_EconBoom_Hardcore.xs This file is auto-generated. Edits will be lost when the file is regenerated. */ //============================================================================== include "aiHeader.xs"; // Gets global vars, function forward declarations include "aiUtil.xs"; // Misc. shared AI utility functions include "aiEcon.xs"; // All of the AI's econ functionality include "aiMilitary.xs"; // All of the AI's military functionality include "aiNavy.xs"; // All of the AI's naval functionality include "aiEventHandlers.xs"; // Event handler methods for the AI include "aiMain.xs"; // The bulk of the AI extern int villagerQuery = -1; rule moveVillagers active minInterval 5 { if(xsGetTime() < 60000) { return; } if(villagerQuery == -1) { villagerQuery = kbUnitQueryCreate("Villager Query"); kbUnitQuerySetPlayerID(villagerQuery, cMyID); kbUnitQuerySetUnitType(villagerQuery, cUnitTypeUnitTypeVillager1); kbUnitQuerySetState(villagerQuery, cUnitStateAlive); } kbUnitQueryResetResults(villagerQuery); int vilCount = kbUnitQueryExecute(villagerQuery); int house = getUnit(kbFindBuilding(cUnitTypeUnitTypeBldgHouse), cMyID, cUnitStateAlive); aiEcho("VILLAGER COUNT " + vilCount); if(vilCount < 1) return; vector spot = kbUnitGetPosition(house); spot = xsVectorSetX(spot, xsVectorGetX(spot) - 3); spot = xsVectorSetZ(spot, xsVectorGetZ(spot) + 3); for(i = 0; < vilCount) { // get the first one int ID = kbUnitQueryGetResult(villagerQuery, i); aiTaskUnitMove(ID, spot); } } //============================================================================== /* preInit() This function is called in main() before any of the normal initialization happens. Use it to override default values of variables as needed for personality or scenario effects. */ //============================================================================== void preInit(void) { aiEcho("preInit() starting."); btRushBoom = 1; btTargetAge1ArmyCount = 6; btTargetAge2ArmyCount = 7; btTargetAge3ArmyCount = 8; btTargetAge4ArmyCount = 10; btAttackGroups = 2; btMilitaryCap = 30; cvNumTowers = 0; btTargetAge1VilCount = 15; btTargetAge4VilCount = 64; cvMaxAge = 2 - 1; gAttackMissionInterval = 140 * 1000; gDefendMissionInterval = 10 * 1000; btBiasInf = aiGetInfantryBias(); btBiasCav = aiGetCavalryBias(); btBiasArcher = aiGetArcherBias(); btBiasArt = aiGetSiegeBias(); btBaselineHandicap = aiGetEconHandicap() + 1; // We add one since the tool's range is -1 to 1, and we use the value as a multiplier. btBiasNavy = aiGetNavyBias(); btRevealEnemyBases = aiGetOKToAutoReveal(); cvOkToBuild = false; cvOkToAttack = aiGetOKToAttack(); cvOkToTrainArmy = aiGetOKToTrainArmy(); cvOkToTrainNavy = aiGetOKToTrainNavy(); cvOkToFish = aiGetOKToFish(); cvOkToResign = aiGetOKToResign(); cvOkToExplore = false; cvOKToResearchEcon = aiGetOKToResearchEcon(); cvOKToResearchMilitary = aiGetOKToResearchMilitary(); } //============================================================================== /* postInit() This function is called in main() after the normal initialization is complete. Use it to override settings and decisions made by the startup logic. */ //============================================================================== void postInit(void) { aiEcho("postInit() starting."); }