home *** CD-ROM | disk | FTP | other *** search
-
- // This file contains change functions to be called for each control variable. Simple ones simply change the value.
- // More complex ones do some minor surgery to make sure the running script deals with the change properly.
-
- // Functions are listed in alphabetic order
-
- // cvMaxAge setting function.
- void setMaxAge(int age = cAge4)
- {
- cvMaxAge = age;
-
- if (kbGetAge() >= age) // We're there or beyond, turn off the age upgrades
- {
- aiSetPauseAllAgeUpgrades(true);
- aiEcho("Suspending age upgrades");
- }
- else
- { // We're not at that age yet, turn off the pause if it was already set
- if (aiGetPauseAllAgeUpgrades(true))
- {
- aiEcho("Enabling age upgrades");
- aiSetPauseAllAgeUpgrades(false);
- }
- }
- }
-
-
- // cvOkToAttack set function. Use this to set the variable at any time other than the initial setParameters() function.
- void setOkToAttack(bool value = true)
- {
- cvOkToAttack = value;
-
- if (value == true) // We've decided to fight after all
- {
- aiEcho("cvOkToAttack is now true.");
- if (gLandAttackGoalID >= 0) // We have an attack plan
- aiPlanSetVariableBool(gLandAttackGoalID, cGoalPlanIdleAttack, 0, false); // Permit attacks
- if (gRushGoalID >= 0) // We have a rush attack plan
- aiPlanSetVariableBool(gRushGoalID, cGoalPlanIdleAttack, 0, false); // Authorize the rush
- }
- else // We're tired of fighting
- {
- aiEcho("cvOkToAttack is now false.");
- if (gLandAttackGoalID >= 0) // We have an attack plan
- aiPlanSetVariableBool(gLandAttackGoalID, cGoalPlanIdleAttack, 0, true); // Prevent attacks
- if (gRushGoalID >= 0) // We have a rush attack plan
- aiPlanSetVariableBool(gRushGoalID, cGoalPlanIdleAttack, 0, true); // Prevent rush
- }
- }
-
-
-
- // cvOkToTrainArmy set function. Use this to set the variable at any time other than the initial setParameters() function.
- void setOkToTrainArmy(bool value = true)
- {
- // Content TBD
- }
-
-
-
- void setOkToResign(bool value = true)
- {
- if (value == true)
- xsEnableRule("ShouldIResign");
- // If false, the rule will automatically shut itself off.
- }
-
-
-
- // cvOkToTrainGatherers set function. Use this to set the variable at any time other than the initial setParameters() function.
- void setOkToTrainGatherers(bool value = true)
- {
- // Content TBD
- }
-
-