//------------------------------------------------------------------- // 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 //------------------------------------------------------------------- // for anything defined in SetCampaignDefaults, if needed, override it here void OverrideCampaignDefaults() { btStrengthATK = 2.5; // 0.0 - 4.0, weak attack strength to hardcore attack strength btStrengthDEF = 0.0; // 0.0 - 4.0, weak defense strength to hardcore defense strength btStrengthECO = 0.0; // 0.0 - 4.0, weak economy strength to economy attack strength btRushBoom = -1.0; // -1.0 = max rush, 1.0 = max boom } //------------------------------------------------------------------- // for anything calculated in CalculateCampaignSettings, if needed, override it here void OverrideCampaignSettings() { } //------------------------------------------------------------------- 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..."); } //------------------------------------------------------------------- // custom preferences to favor specific enemy cav units by age void setUnitPickerPreference(int upID = -1) { // Add the main unit lines if (upID < 0) { return; } // Bias us towards nothing. This way our buildOrder choices will by chosen. kbUnitPickSetPreferenceFactor(upID, cUnitTypeAbstractInfantry, 0.0); kbUnitPickSetPreferenceFactor(upID, cUnitTypeAbstractArtillery, 0.0); kbUnitPickSetPreferenceFactor(upID, cUnitTypeAbstractCavalry, 0.0); kbUnitPickSetPreferenceFactor(upID, cUnitTypeAbstractArcher, 0.0); switch (kbGetAge()) { case cAge1: { break; } case cAge2: { kbUnitPickSetPreferenceFactor(gLandUnitPicker, cUnitTypeGrCavSarissophoroi, 0.8); break; } case cAge3: { kbUnitPickSetPreferenceFactor(gLandUnitPicker, cUnitTypeGrCavSarissophoroi, 0.8); kbUnitPickSetPreferenceFactor(gLandUnitPicker, cUnitTypeGrArcPeltast, 0.6); break; } case cAge4: { break; } } }