Units replacing others

Murderologist

Warlord
Joined
Jul 14, 2014
Messages
162
I'm trying to locate where in the lines of code you find or edit where a Unit replaces another unit. For Example. Unit B becomes buildable after you research a technology. Unit B replaces Unit A and Unit A is no longer buildable. How do I make, edit, and or locate the file that's causing that switch. I want to be able to either continue to build Unit A OR make it so Unit B does not replace anything but is only added as being able to build it alongside Unit A. Any help would be appreciated. Thank you.
 
The column that makes units available once a technology is researched is PrereqTech. The one that makes unit not available anymore when a technology is researched is ObsoleteTech. Both belong to the Units table.

This means that, for each unit, you must choose the tech for both columns : if you do not fill the PrereqTech, the unit will never become available through tech (it can be made available through other methods), and if you do not fill the ObsoleteTech, the unit will never become obsolete through tech.
 
But the units are not going away because they become obsolete due to tech. Example. Research Tech Computers give all civs access to a new plane. Mongols however get a special plane that simply replaces the plane all the other civs got. How do i make the mongols receive the special plane and still have access to the vanilla. All of the units have the PREREQTECH to become available through research. None of them have the obsolete tech because none of the units become obsolete due to tech they are just replaced by other units.
 
You create a new UnitClass and make it so it has no DefaultUnit, and then you use the Civilization_UnitClassOverrides to make it so the Mongols have their unique plane available to them. Use SQLiteSpy for clearer information on the tables and columns.
 
Top Bottom