//------------------------------------------------------------------- // INCLUDES: //------------------------------------------------------------------- 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 include "aiCampaignCore.xs"; // The Core Campaign AI data and features //------------------------------------------------------------------- vector gRallyPoint = cInvalidVector; //------------------------------------------------------------------- void setRallyPointX(int x = -1) { gRallyPoint = xsVectorSetX(gRallyPoint, x); } //------------------------------------------------------------------- void setRallyPointZ(int z = -1) { gRallyPoint = xsVectorSetZ(gRallyPoint, z); } //------------------------------------------------------------------- rule setRallyPoint active minInterval 3 { if(gRallyPoint != cInvalidVector) { kbBaseSetMilitaryGatherPoint(cMyID, kbBaseGetMainID(cMyID), gRallyPoint); } xsDisableSelf(); } //------------------------------------------------------------------- // for anything defined in SetCampaignDefaults, if needed, override it here void OverrideCampaignDefaults() { cvOkToBuild = false; cvOkToTrainArmy = false; } //------------------------------------------------------------------- // for anything calculated in CalculateCampaignSettings, if needed, override it here void OverrideCampaignSettings() { // allow attacking right out the gate btMilitaryInAge1 = true; btRevealDelay = 0.0; btAttackDelay = 0.0; // override core combat params btAttackGroups = 1; btTargetAge1ArmyCount = 3 + (1.0 * btStrengthATK); // 1 group @ 5-9 btTargetAge2ArmyCount = 6 + (2.0 * btStrengthATK); // 1 group @ 7-15 btTargetAge3ArmyCount = 9 + (4.0 * btStrengthATK); // 1 group @ 11-27 btTargetAge4ArmyCount = 17 + (6.0 * btStrengthATK); // 1 group @ 19-43 // set additional BAM params gBAMAttackInterval = 90; gBAMGroupInterval = 10; gBAMAttackGroups = btAttackGroups; gBAMTargetAge1GroupSize = btTargetAge1ArmyCount; gBAMTargetAge2GroupSize = btTargetAge2ArmyCount; gBAMTargetAge3GroupSize = btTargetAge3ArmyCount; gBAMTargetAge4GroupSize = btTargetAge4ArmyCount; gBAMGroupSizeRampUp = gBAMAttackGroups * 3; gBAMEngageRadius = 30; } //------------------------------------------------------------------- void preInit(void) { aiEcho("preInit() Starting..."); // force defaults for all internal settings SetCampaignDefaults(); // Override Defaults // do this before any formula based settings are calculated // This allows each parent script to set the intended default overrides before anything is calculated OverrideCampaignDefaults(); // derive any settings from the defaults CalculateCampaignSettings(); // Override Campaign Settings // in some cases, it is valuable blow out even the calculated settings OverrideCampaignSettings(); // print everything out EchoCampaignSettings(); } //------------------------------------------------------------------- void postInit(void) { aiEcho("postInit() Starting..."); }