Restoring units removed by UUs

Serenity42

Chieftain
Joined
Jul 16, 2008
Messages
58
In short: I'm trying to rig things such that -

1. Americans can build Marines (formerly supplanted by the SEAL UU)
2. Americans can still build SEALS
3. Nobody else can build SEALS

So, effectively, I'm just trying to enable Marines for construction by the Americans.

Awhile back, someone else tried the same thing, but try as I might, I couldn't get it to work. The primary problem is that when it comes to XML, I'm a real dummy. :(

If someone could take the time to explain how to do this in XML-idiot-words, I'd be very grateful. I just need explicit directions around XML because I get lost very easily.

Thanks everyone.
 
Open UnitClassInfos. Find the entry for UNITCLASS_MARINE.

Look closely at all of the things you see in the file, you'll notice that there is a pattern and indentation ranking which groups things together. You want to copy the entire group which has UNITCLASS_MARINE and paste it right after itself, then change all the _MARINE stuff to be _SEAL instead.


Now open UnitInfos. Search for UNIT_SEAL and you'll see that on the line right next to where you find <Type>UNIT_SEAL</Type> will be a line that says UNITCLASS_MARINE. You want to change that to now be UNITCLASS_SEAL.


Finally, open CivilizationInfos and search for UNIT_SEAL. It is grouped with UNITCLASS_MARINE. You want to remove this group completely.


At this point EVERYONE can now build marines and seals. If you want to keep other civilizations from building seals, then you'll have to do a fair amount more editing in CivilizationInfos to have everyone else list NONE for UNITCLASS_SEAL in a grouping just like what you deleted.
 
I've never actually tried this but could it work with the cantrain python function (as I've never used in a UU situation, but saying they cantrain unitclass marine once you have the right techs might let them build both)
 
At this point EVERYONE can now build marines and seals. If you want to keep other civilizations from building seals, then you'll have to do a fair amount more editing in CivilizationInfos to have everyone else list NONE for UNITCLASS_SEAL in a grouping just like what you deleted.

Or, for a quicker alternative, make a UNITCLASS_UU, put the default unit to NONE, put the unit class for all UUs to UNITCLASS_UU, and in CivilizationInfos put for each civ it's appropriate UU as a replacement for UNITCLASS_UU (I hope that makes sense). This will work well if you plan to do it for more. I would also recommend adding to the cost of them, or something similar, so the civs will make the regular units.
 
I had run across mention somewhere that the AI doesn't handle a default unit of NONE very nicely, so I tried to avoid that suggestion. I do not recall it for certain though, and it was before 3.17 so could be solved if it ever was an issue.
 
Well, that's what I get for not testing it first and thinking of it off the top of my head :p. If it works for you, Serenity, good. If it doesn't, sorry.
 
Top Bottom