How are UU's added?

Agent_23

Chieftain
Joined
Dec 4, 2008
Messages
20
Location
England
Hi, i've been debating the idea lately about creating a new mod, so i finally got some free time and decided to start one without realising the ambition i have for one is going to take me some time Anyway, pretty much up to grasps with alot of the XML writing, already adding my leaderheads, units e.t.c.
But the reason why its going to take me some time is that i want to create a mod where each civ have there own unique units i.e Royal Marines for United Kingdom e.t.c
The problem that is laying down on me is that - Which XML files need changing for the UU to be added??
So far i've Tried Civilisationinfos.xml (of course with a z in the game, but i'm english here ) and unitinfos.xml plus adding English in front of just about every tag i can find where Royal Marines is needed to add as a unit.
Now the unit has been added just fine. But civ doesn't like adding it as a UU :mad: Does anyone have any ideas of the files to use?
Would be a big help coz i'm on a roll on my mod at the moment and hopefully i can post it sometime in the future :D
 
Assuming you've already added your new unit to UnitInfos.xml, in CivilizationInfos.xml, there's a tag called Units. Let's take England's redcoat as an example:

<Units>
<Unit>
<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
<UnitType>UNIT_ENGLISH_REDCOAT</UnitType>
</Unit>
</Units>

All you need to do is repeat the Unit tag inside the Units tag, changing UNIT_ENGLISH_REDCOAT to your new unit's name, and UNITCLASS_RIFLEMAN to whichever unitclass it replaces.

Questions?
 
Here's my XML so far:

<Units>
<Unit>
<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
<UnitType>UNIT_ENGLISH_REDCOAT</UnitType>
</Unit
<Unit>
<UnitClassType>UNITCLASS_MARINE</UnitClassType>
<UnitType>UNIT_ENGLISH_ROYAL_MARINES</UnitType>
</Unit>
</Units>

So i'm way ahead of you on that one, plus obviously i added the unit in the appropriate XML files. But still no luck once the mod is loaded up. Since says only 1 UU being Redcoat. Please dont tell me you can only have 1 UU, that would be a little linear so i doubt that very much.
 
<UnitInfo>
<Class>UNITCLASS_MARINE</Class>
<Type>UNIT_ENGLISH_ROYAL_MARINES</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_GUN</Combat>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_ENGLISH_ROYAL_MARINES</Description>
<Civilopedia>TXT_KEY_UNIT_ENGLISH_ROYAL_MARINES_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_ENGLISH_ROYAL_MARINES_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>

(missed the emiddle, too much 4 here)

<EarlyArtDefineTag>ART_DEF_UNIT_ENGLISH_ROYAL_MARINES</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<Button>Art/Interface/Buttons/Units/Marine.dds</Button>

Thats the unitinfos
 
That was me rushing to get the thread on, just checked that one, thanks for pointing it out. I'll Just have to go back and check each XML file again. Just thought maybe i was missing an XML file i should be including the UU's in. Thanks anyway
 
Good luck on your mod, but remember: it is a lot of work and can get really frustrating at times. If your making big changes, keep a few backcopies of previous versions of your mod in case something happens, like catastrophic failure.

Other than that, NikNaks is right.
 
Thanks, already finding it frustrating but i'm going to stick at it as downloaded and played a few mods from here in the past and thought i'd give something back. And i have a couple of backup's, but thanks for the advice. Hopefully should get alot done over the xmas holidays
 
Back
Top Bottom