Announcement

Collapse
No announcement yet.

Can Obsolete Units be Upgraded?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can Obsolete Units be Upgraded?

    After not playing it over almost two years I've decided to load up the various gameplay improvement mods and try it again. However I've got a bunch of obsolete units now and I can't find the damn game manual nor can I find any information in the in game Great Library on how to upgrade a unit. Actually neither obsolete nor upgrades are mentioned in the GL.

    I have a vague recollection of obsolete units being bad to keep around (extra upkeep fee or something like that) in CTP but I could be wrong, after all it's been two years.

    Is there a way to upgrade units or is disbanding them your only option? Also is there a copy of the manual somewhere I can download?
    For the light of a candle to be seen, it must be taken to a dark place. -- UKLG

  • #2
    Nope, you cant upgrade units, atleast not in basic game.
    The Chuck Norris military unit was not used in the game Civilization 4, because a single Chuck Norris could defeat the entire combined nations of the world in one turn.
    - Chuck Norris Facts

    Comment


    • #3
      Darn I was hoping there was some weird way of doing it, after all these are the guys who chose to use ! for save game instead of the usual cntrl-S pretty much all other windows programs use.
      For the light of a candle to be seen, it must be taken to a dark place. -- UKLG

      Comment


      • #4
        nice avatar you got armiture
        Baal: "You dare mock me ?"
        O'Neill: "Baal, c'mon, you should know ... Of course I dare mock you."

        Comment


        • #5
          Try to download Wes W MedMod 4.13 and take a look at the slic-code, which are used for auto-upgrade of the garrisons (or militia units as they are called).

          Some of the code comes here:

          // This trigger kills all Hoplites, Fyrdmen, Arquebusiers, Musketeers, Riflemen and Machine Gunners and puts a Plasmatica in every (non-space)city (so units outside cities are destroyed)
          trigger 'UpgradeMilitiaToPlasmatica' when (player.1 && discovery.type == 191) { // cybernetics
          i = 0;
          while (i < player.1.totalunits) { // loop through all units
          SetUnitByIndex(1, player.1, i);
          if (unit.type == UnitType("UNIT_HOPLITE_MILITIA") || unit.type == UnitType("UNIT_FYRDMAN_MILITIA") || unit.type == UnitType("UNIT_ARQUEBUSIER_MILITIA") || unit.type == UnitType("UNIT_MUSKETEERS_MILITIA") || unit.type == UnitType("UNIT_RIFLEMEN_MILITIA") || unit.type == UnitType("UNIT_MACHINE_GUNNER_MILITIA")) {
          KillUnit(unit);
          } else {
          i = i + 1;
          }
          }
          i = 0;
          while (i < player.1.cities) { // loop through all cities
          SetCityByIndex(1, player.1, i);
          if (TerrainType(city.location) != 13) {
          if (city.population <= 8) {
          number = 1;
          } elseif (city.population <= 16) {
          number = 2;
          } elseif (city.population <= 24) {
          number = 3;
          } else { // if (city.population > 24) {
          number = 4;
          }
          while (number > 0) {
          CreateUnit(player.1, UnitType("UNIT_PLASMATICA_MILITIA"), city.location, 0, militiaunit);
          SetOrder(1,4); // Fortify unit
          AddOrder(militiaunit, city.location);
          number = number - 1;
          }
          i = i + 1;
          }
          }
          }
          // end MILITIA triggers code

          You will find the whole thing at the end of the script.slc file in the gamedata subfolder in the Medpack4 folder when you have installed/unpacked the scenario.

          You might be able to use this for a mod of you own.
          First they ignore you. Then they laugh at you. Then they fight you. Then you win.

          Gandhi

          Comment


          • #6
            Well, that code is rather specific for militia units, but it can with some effort be adapted for generic unit upgrading:

            Code:
            TypeLocation upgradeloc; // only need to define this once
            
            // create one trigger for every upgrade (Warrior to Samurai, Hoplite to Pikeman, Cavalry to Tank, etc)
            trigger 'UpgradeWarriorToSamurai' when (player.1 && discovery.type == 6) {
            		// activate at advance 6th advance from advance.txt (start counting at 0): jurisprudence
            	i = 0;
            	while (i < player.1.totalunits) {	// loop through all units
            		SetUnitByIndex(1, player.1, i);
            		if (unit.type == UnitType("UNIT_WARRIOR")) {	// if unit is obsolete
            			upgradeloc = unit.location;
            			KillUnit(unit);		// kill obsolete unite
            			CreateUnit(player.1, UnitType("UNIT_SAMURAI"), upgradeloc, 0);	// and create a replacement
            		} else {			// if unit isn't obsolete
            			i = i + 1;		// go to the next unit
            		}
            	}
            }
            Note that this code is untested, but in theory it should upgrade all Warriors to Samurai when Jurisprudence is invented. If you add similar triggers for all upgrades you'd like to see, it should work -- providing there are no unexpected bugs (I know in CtP2 there's a problem with advances obtained from goody huts, don't know how that works out in CtP1).

            To add new triggers, simply copy the existing one and replace the 6 from "discovery.type == 6" with the appropriate number and UNIT_WARRIOR and UNIT_SAMURAI with the appropriate units. Oh, and make sure every trigger has a unique name ('UpgradeWarriorToSamurai' in this example: it can be anything, as long as it's unique).
            Last edited by Locutus; November 26, 2003, 05:06.
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment

            Working...
            X