How can i replace BtS units with fan made units

marioflag

History Addict
Joined
Oct 20, 2005
Messages
1,902
Location
Napoli, Italy
Seeing the units graphic forum i'm amazed how much good looking units there are.So i wonder how can i replace BtS units with fan made units; what i need to do?
I'm also particularly interested to know if i can replace units just for a specific civ instead of replacing unit for every civ in the game (for example can i use Kirov model submarine just for Russians instead of replacing old submarine model with Kirov for all civilizations, or using Hurricane just for English instead than applying it also to other civs?); if yes how can i do that?
 
Ask this in the C&C main forum this forum is for threads with units only. There must be tons of unit adding tuts by now. Please do a bit of looking before you post.
 
Seeing the units graphic forum i'm amazed how much good looking units there are.So i wonder how can i replace BtS units with fan made units; what i need to do?
I'm also particularly interested to know if i can replace units just for a specific civ instead of replacing unit for every civ in the game (for example can i use Kirov model submarine just for Russians instead of replacing old submarine model with Kirov for all civilizations, or using Hurricane just for English instead than applying it also to other civs?); if yes how can i do that?
If ALL you want to do is change an existing unit to a new look, go to this thread and skip directly to step-6. If you want to add a NEW unit using graphics found here, do all 6 steps.
 
Forgot to mention... if you want to make a nation-specific unit (like a Russian Submarine), you can do that too... put the unit entry into the CIV4UnitInfos.xml just like you would another nation-specific unit (use an example of any other nation-specific... essentially same class as the unit it replaces, but unique name), then you'll ALSO need to modify the CIV4CivilizationInfos.xml file to add the nation-specific unit into the game (if you don't do this, all nations can use the unit).
 
If you have BTS and just want to add these units for each civ replacing the default swordsman, pikeman, ect then this guide is probably best:

http://forums.civfanatics.com/showthread.php?t=229557

3.0 Unit Art Styles

There has been a lot of amazing work done creating new unit art for civilization 4. Many of these units have been implemented as “flavor” units, sharing identical stats but added to the game to vary the artwork of different civilizations. Unfortunately this requires a new unit to be added to the game, a swordsman (for example) that is a duplicate in every way except its art definition.

BtS allows us to define unit art types, similar to the building art types in warlords. With it you can have one unit definition but configure different civilizations to use different art for that unit. So the Greek scout can be made to look different than an Aztec scout without adding a new unit to the game.

There are 3 steps required to enable this.

3.1 Step 1: CIV4CivilizationsInfos.xml

In this file we need to define the civilizations Unit Art Style as follows:


Code:
<CivilizationInfo>
<Type>CIVILIZATION_AMERICA</Type>
<Description>TXT_KEY_CIV_AMERICA_DESC</Description>
<ShortDescription>TXT_KEY_CIV_AMERICA_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_AMERICA_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_AMERICA_PEDIA</Civilopedia>
<DefaultPlayerColor>PLAYERCOLOR_BLUE</DefaultPlayerColor>
<ArtDefineTag>ART_DEF_CIVILIZATION_AMERICA</ArtDefineTag>
<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
<UnitArtStyleType>UNIT_ARTSTYLE_EUROPEAN</UnitArtStyleType>This is very similar to the way city art styles were defined in warlords but added as a separate attribute so modders can use different unit and city building styles. A NONE value will cause the Civ to use all default Unit Art.

3.2 Step 2: CIV4UnitArtStyleTypeInfos.xml

This is a new XML file in BtS. It contains the definition for the Unit Art Style and allows a new unit art meshes to be used for a given unit. In the example below the ART_DEF_UNIT_ARCHER_EURASIAN is the Early art definition used for an Archer and ART_DEF_UNIT_ARCHER_EUROPEAN is used in the middle and late periods. The Archer like most units has only one UnitMesh as specified on its CIV4UnitInfos.xml element. But units can actually have any number of Meshes, the Settler units are the only Original game units to use more then one Mesh and to modify these simply list the replacement Meshes as <UnitMeshGroup> elements, they will be matched in the order with the CIV4UnitInfos meshes and replace it one for one, any number of Meshes can be present in a Unit and all can be substituted in this way.

Any Unit not given replacements for a StyleType will simply be defaulted to the Art from the UnitInfos.xml file and any individual ARTDEFs can be referenced any number of times and in as many different StyleTypes as desired allowing considerable sharing and creation of Styles which differ only at certain time periods to reflect cultures branching and merging.


Code:
<UnitArtStyleTypeInfo>
<Type>UNIT_ARTSTYLE_EUROPEAN</Type>
<StyleUnits>
<StyleUnit>
<UnitType>UNIT_ARCHER</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_ARCHER_EURASIAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_ARCHER_EUROPEAN</LateArtDefineTag>
<MiddleArtDefineTag> ART_DEF_UNIT_ARCHER_EUROPEAN </MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
<StyleUnit>
<UnitType>UNIT_SETTLER</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_SETTLER_MALE_EUROPEAN</EarlyArtDefineTag>
<LateArtDefineTag> ART_DEF_SETTLER_MALE_EUROPEAN </LateArtDefineTag>
<MiddleArtDefineTag> ART_DEF_SETTLER_MALE_EUROPEAN </MiddleArtDefineTag>
</UnitMeshGroup>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_SETTLER_FEMALE </EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_SETTLER_FEMALE </LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_SETTLER_FEMALE </MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
</StyleUnits>
</UnitArtStyleTypeInfo>

Step 3: CIV4ArtDefines_Unit.xml

Just as in Civ4 the Unit Art Information has to exist for the unit. But instead of using the default one assigned to that unit in the Civ4UnitInfos.xml (ART_DEF_UNIT_ARCHER for example) Unit Art Styles allowed us to use a alternate one such as this:


Code:
<UnitArtInfo>
<Type>ART_DEF_UNIT_ARCHER_EUROPEAN</Type>
<Button>,Art/Interface/Buttons/Units/Archer.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,4,1</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/Archer_European/Archer_European.nif</NIF>
<KFM>Art/Units/Archer_European/Archer.kfm</KFM>
<SHADERNIF>Art/Units/Archer_European/Archer_European_fx.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>0.85</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bActAsRanged>1</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>Note that the unit button graphic is defined on the UnitArtInfo, it is no longer set in the CIV4UnitInfos.xml file. This allows us to use different buttons for different unit art styles. This change will also require modders converting older mods to BtS to move all their button info into the art file.

By modifying the SDK you can create alternative types of StyleUnit logic with their own xml files and logic structures such as Units which show different Artwork based on how heavily they are damaged or the presense of specific Promotions.
 
Back
Top Bottom