home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 8 (DVD) / XENIADVD08.iso / Fragzone / Files / AOM_MiniCampaign.exe / AI / mc01p2.xs < prev    next >
Encoding:
Text File  |  2003-01-15  |  2.0 KB  |  70 lines

  1. include "aomMKcv.xs";      // The control variable definitions
  2. include "aomMKai.xs";      // The whole AI complex
  3. include "aomMKcvFuncs.xs";      // Control Variable set functions.
  4.  
  5. void setParameters(void)   // This function is called from main() before init() is run.
  6. {
  7.    aiEcho("Set Parameters:");
  8.  
  9.    cvOkToResign = false;   // Prohibit resignation
  10.    cvDoAutoSaves = false;
  11. //   if (aiGetWorldDifficulty() < cDifficultyHard)
  12.     cvMaxAge = cAge3;    // Limit the CP to age 3 on Easy, Med.
  13.     cvOkToChat = false;
  14.    cvOkToAttack = false;   // In setParameters(), it's OK to set these directly instead of using the setOkToAttack(false) function.
  15.    aiEcho("    Setting cvOkToAttack to false.");
  16.  
  17. }
  18.  
  19.  
  20. void setOverrides(void)    // This function is called from main() after init() is run.  Use it to 
  21.                            // override any initial settings done in the main scripts.
  22. {
  23.    aiEcho("Set Overrides:");
  24.    aiEcho("    Setting Personality to Default.");
  25.    aiSetPersonality("default");     // Turn off rush/boominess
  26.    // gGathererTypeID = cUnitTypeDwarf;
  27.    // gWaterMap = true;    // Set this true if the AI needs to consider using transports on this non-random map.
  28.    // aiSetAllowBuildings(false);   // Prevents building construction?
  29.     int killMe = aiPlanGetIDByIndex( cPlanHerd, -1, true, 0 );
  30.     aiEcho("Killing herdable plan "+killMe);
  31.     aiPlanDestroy(killMe);
  32.     if(aiGetWorldDifficulty() == cDifficultyEasy)
  33.         gHardEconomyPopCap = 20;
  34.     if(aiGetWorldDifficulty() == cDifficultyModerate)
  35.         gHardEconomyPopCap = 20;
  36.  
  37.  
  38. }
  39.  
  40.  
  41. void attackFunc(int on = 1)
  42. {
  43.     aiEcho("    attackFunc running, parameter "+on);
  44.     if (on == 1)
  45.     {
  46.         setOkToAttack(true);
  47.     }
  48.     else
  49.     {
  50.         setOkToAttack(false);
  51.     }
  52. }
  53.  
  54.  
  55. void ageUpFunc(int unused = 0)
  56. {
  57.     aiEcho("    ageUpFunc running.");
  58.     setMaxAge(cAge4);
  59. }
  60.  
  61.  
  62. rule ageUpAlert      // Let this CP know that it starts in age 2 (cAge2)
  63. active
  64. {
  65.    if (xsGetTime() < 20000)
  66.       return;
  67.  
  68.    age2Handler();
  69.    xsDisableSelf();
  70. }