Multiple units using same Unit Class?

Mellian

.......
Joined
May 16, 2002
Messages
74
Location
Montreal, Quebec, Canada
For some reason, I remember from before that you could have multiple units using the same unit class. Yes, special civ specific units do that, but what if separate options to be built or/and upgrade?

I was thinking of this...

Unitclass_infantry
- Default: Unit_Infantry
- Upgrade Option: Unit_ATInfantry
- Upgrade Option: Unit_SAMInfantry
- Upgrade Option: Unit_APInfantry

etc, while some units also available separately to be built, like the Romans having the option of being able to either build regular Swordsman or/and Praetorians?

When looking at UnitInfos and UnitClassInfos, there is a class for practically every unit apart from special units...with specialunitinfos confusing the matter even more.

Thank you for any clarification help.
 
Any specific civilization can only have one unit type for a unit class, except when it has no type for the class. Different civs can have different unit types for the same class. This is how UUs work.

Example in regular BtS:
Most civs get UNIT_SWORDSMAN for UNITCLASS_SWORDSMAN. But...
Aztecs get UNIT_AZTEC_JAGUAR
Celts get UNIT_CELTIC_GALLIC_WARRIOR
Romans get UNIT_ROME_PRAETORIAN
That is it. Each civ gets one type for the class.
 
Any specific civilization can only have one unit type for a unit class, except when it has no type for the class. Different civs can have different unit types for the same class. This is how UUs work.

Example in regular BtS:
Most civs get UNIT_SWORDSMAN for UNITCLASS_SWORDSMAN. But...
Aztecs get UNIT_AZTEC_JAGUAR
Celts get UNIT_CELTIC_GALLIC_WARRIOR
Romans get UNIT_ROME_PRAETORIAN
That is it. Each civ gets one type for the class.

If you make say a UNIT_RUSSIAN_SPECIAL FORCES unit and make it UNITCLASS_SPECIAL_FORCES and then in the civilizationinfos.xml put UNIT_MARINE and under it UNIT_RUSSIAN_SPECIAL_FORCES, you can build both the sp. forces and the marine I'm pretty sure. At least that is what happened with my Iran Iraq war Mod in v1.0
 
Unless the DLL has been modified, it is not possible to have more than one unit type for a specific unit class since the CvCivilizationInfo::getCivilizationUnits() function is passed a unit class and returns a single unit type value (and the mapping that the CvCivilizationInfo stores the data in is just an array of integers, providing a one to one mapping). This is the function that is called to find out what unit type a specific civilization type can build for the specified unit class.
 
Top Bottom