Announcement

Collapse
No announcement yet.

MedMod deletion of old units

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

  • MedMod deletion of old units

    Ey everybody,

    Is there a way to turn off the automatic deletion of some units for the human players ?
    I agree it is a good way of forcing the AI to make new fresh units, but I hate to see all my production going up in the mist, just because I happen to be at a certain period in time.

    OK, I agree that having musketeers and field gunners in 1970 is not really up to date or modern , but hey, I am not 'that' far behind in the game. The AI is not having anything better than me (so prob he will be without ANY units now aswell, just like me).

    And another thing. If this trigger is deleting obsolete units, why does it let me build them again afterwards ????? It just deleted all my musketeers and field gunners, but I can still build them now.

    For one thing, I prefer to keep my old units. OK, spearmen in the 20th century would be tooo much, but musketeers ??? They are still usefull to fight with ! I prefer having them killed in a fight instead of seeing all my production points going up in the mist.

    Hm ...

  • #2
    Hm, am a little further in the game now.

    What did I just see ? Am walking around in the AI's fields and there are pikemen running around, grouped with cavalry ...

    How is that possible ? Thought they had been deleted ????
    Or did the AI started building his old units again ?

    Is it supposed to be like this ?

    Comment


    • #3
      Your timeline might be screwed up or something, I dunno, that's kind of odd. In any case, the deletions occur in a fixed year, so if everyone is behind in tech in one of those years, all the units of a certain type will be deleted, even if they are still buildable. The idea of this feature is that the deleted units so old-fashioned that you can't build them anymore anyway, but if you're playing in a type of game when tech is going slow (small map, lots of war, easy difficulty level?), it might not work out quite so well. I think Cradle's approach of upgrading units is better anyway, or at least that this feature should be made tech-dependent, not time-dependent. But you'll have to ask Wes about that, I just do whatever he tells me to do...

      Anyway, to disable the feature for humans is easy. Go into the file MM2_SLC_Wouter.slc and replace section 7 ("7. Slavery Code --> Disband Code") with the section below:

      edit: I'll put the code in a seperate post because it screws up the layout of the post but it's too much work for me to fix it properly.
      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

      Comment


      • #4
        Code:
        ///////////////////////////////
        ////   7. Slavery Code    //// //// --> Disband code ////
        /////////////////////////////
        
        // old Description: Kill all units with slaving capabilities when era of slaves is over
        // new Description: Kill all units that are too old
        
        HandleEvent(BeginTurn) 'MM2_EndOfSlavery' post {
        unit_t	tmpUnit;
        int_t	i;
        int_t	j;
         	if (g.year == 300 || 400 || 475 || 550) {	// if year is disband year
         		for (i = 0; i < 32; i = i + 1) {	// cycle through civs
        			if (!IsHumanPlayer(i)) {	// only for AIs, not for humans
        	 			player[0] = i;
        	 			for (j = 0; j < player[0].units; j = j + 1) {	// cycle though units
        					GetUnitByIndex(i, j, tmpUnit);
        					if (g.year == 300) {	// disband ancient units
        						if (	   tmpUnit.type == UnitDB(UNIT_WARRIOR)
        							|| tmpUnit.type == UnitDB(UNIT_SPEARMAN)
        							|| tmpUnit.type == UnitDB(UNIT_SWORDSMAN)
        							|| tmpUnit.type == UnitDB(UNIT_ARCHER)
        							|| tmpUnit.type == UnitDB(UNIT_CHARIOT)
        							|| tmpUnit.type == UnitDB(UNIT_LIGHT_CAVALRY)
        						) {
        		 					KillUnit(tmpUnit);		// kill it
        		 				}
        					} elseif (g.year == 400) {	// disband classical units (& ancient elites)
        						if (	   tmpUnit.type == UnitDB(UNIT_PHALANX)
        		 					|| tmpUnit.type == UnitDB(UNIT_HEAVY_SWORDSMAN)
        		 					|| tmpUnit.type == UnitDB(UNIT_BOWMAN)
        		 					|| tmpUnit.type == UnitDB(UNIT_CATAPULT)
        		 					|| tmpUnit.type == UnitDB(UNIT_MOUNTED_ARCHER)
        		 					|| tmpUnit.type == UnitDB(UNIT_HEAVY_CAVALRY)
        		 					|| tmpUnit.type == UnitDB(UNIT_ZULU_WARRIOR)
        		 					|| tmpUnit.type == UnitDB(UNIT_JAVELINEER)
        		 					|| tmpUnit.type == UnitDB(UNIT_ELEPHANT)
        		 					|| tmpUnit.type == UnitDB(UNIT_BANDIT_HORSEMAN)
        		 					|| tmpUnit.type == UnitDB(UNIT_CORACLE)
        		 					|| tmpUnit.type == UnitDB(UNIT_TRIREME)
        						) {
        							KillUnit(tmpUnit);		// kill it
        						}
        					} elseif (g.year == 475) {	// disband medieval units (& classical elites)
        						if (	   tmpUnit.type == UnitDB(UNIT_FYRDMAN)
        							|| tmpUnit.type == UnitDB(UNIT_PIKEMEN)
        		 					|| tmpUnit.type == UnitDB(UNIT_SIEGE_ENGINE)
        		 					|| tmpUnit.type == UnitDB(UNIT_HORSE_ARCHER)
        		 					|| tmpUnit.type == UnitDB(UNIT_KNIGHT)
        		 					|| tmpUnit.type == UnitDB(UNIT_HOPLITE)
        		 					|| tmpUnit.type == UnitDB(UNIT_LEGION)
        		 					|| tmpUnit.type == UnitDB(UNIT_FIRE_TRIREME)
        		 					|| tmpUnit.type == UnitDB(UNIT_CATAMARAN)
        						) {
        							KillUnit(tmpUnit);		// kill it
        						}
        					} elseif (g.year == 550) {	// disband renaissance units (& medieval elites)
        						if (	   tmpUnit.type == UnitDB(UNIT_MUSKETEER)
        							|| tmpUnit.type == UnitDB(UNIT_INFANTRYMAN)
        		 					|| tmpUnit.type == UnitDB(UNIT_CULVERIN)
        		 					|| tmpUnit.type == UnitDB(UNIT_CANNON)
        		 					|| tmpUnit.type == UnitDB(UNIT_CAVALRY)
        		 					|| tmpUnit.type == UnitDB(UNIT_BERSERKER)
        		 					|| tmpUnit.type == UnitDB(UNIT_SAMURAI)
        		 					|| tmpUnit.type == UnitDB(UNIT_LONGBOWMAN)
        		 					|| tmpUnit.type == UnitDB(UNIT_NOMADIC_HORSEMAN)
        		 					|| tmpUnit.type == UnitDB(UNIT_LONGSHIP)
        		 					|| tmpUnit.type == UnitDB(UNIT_COG)
        						) {
        							KillUnit(tmpUnit);		// kill it
        						}
        					}
        				}	// in all other years do nothing do nothing
        			}
         		}
         	}
        }
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #5
          Grin, sounds really easy yeah.

          Tnx for the code, will copy/paste it in there and try it out again in my next game.

          Strange thing is: I am playing on a huge map, there is no war going on and setting is on medium.

          Hm, guess we were a little too slow to have musketeers in the 20th century instead of riflemen. Hadn't even invented flight yet.

          Maybe, I'll have to try out cradle one time. )

          Comment

          Working...