GUIDE: Adding new units

Im confused, I have BTS and I dont understand what files I have to edit, are they the ones in the main assets folder or the ones in the BTS/assets folder?.................. and where do I put the new unit folder? in BTS/customassets folder?
 
Anybody already wrote about it, maybe, but is many enteries here... :(

Know anybody:
If I choose trait Aggressive, have new units Combat I promotion to start.
New units what I added to my mod have not this promotion after training.
Where is error, please :please:

not every unit gets the Combat I promo under the Aggressive trait. if your new unit is not melee or gunpowder it wont have it. so you would either have to make the new unit fit one of those ( melee or gun ) or add your new unitclass to the list, under the Aggressive trait, of classes that get the promo
 
Does anyone know, in the unitinfos file, under <unitmeshgroups> - what is the difference between <igroupsize> and <iRequired>??? I gather that igroupsize gives the number of units present in a formation, but what does irequired do?
 
I' m trying to mod BTS for days now, much more difficult than vanilla i think. Ok, there is a very strange thing happening over here. I want to add 8 units total. Some of them are just flavor units, some are new unit classes, some are UUs.

Everything is fine, the units can be built in the game with no problem but as soon as i enter industrial age, the game crashes. I talked about it with Wolfshanze and he said:

Actually a crash when entering the Industrial era is usually related to a fault in the XML code.

Specifically, one or more units in the Civ4UnitArtStyleTypeInfos.xml more then likely has a bad/wrong command line (possibly typo) pointing to a wrong or incorrect graphic for a "LateAge" unit... the transition from Reinassance to Industrial Age triggers a graphic change of units in-game, and one wrong line in the Civ4UnitArtStyleTypeInfos.xml can make the game unstable and CTD.

I had accidently introduced such an error in an earlier version of my mod and only realized later what the problem was (I narrowed the problem down to four trouble-making units and their XML tags). The problem is easily solved if you can find the trouble-maker(s).

This can and does happen in other mods as well... the problem you describe sounds exactly like the situation I encountered and solved.

In other words... it's probably an XML error in the Civ4UnitArtStyleTypeInfos.xml file.


He was right. I tested the game in WB adding all techs up to the industrial age. Then, if i double-click a city, the game zooms out but the cityscreen won't show. A few turns later, it crashes.

I deleted every single custom unit. The problem dissapeared!

I really don't know what i'm doing wrong. I have implemented much more difficult things in my mod than units. My mod is based on Dale's DCM. Initially, i thought that dcm was causing this but no.

Here is an example of how i do things in the most popular case:

CIV4UnitInfos.xml

<UnitInfo>
<Class>UNITCLASS_MODERN_ARMOR</Class>
<Type>UNIT_T90</Type>
.

.
<UnitMeshGroup>
<iRequired>1</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_T90</EarlyArtDefineTag>
</UnitMeshGroup>

In CIV4ArtDefines_Unit.xml:


<UnitArtInfo>
<Type>ART_DEF_UNIT_T90</Type>
<Button>Art/Interface/Buttons/Units/64px-T90.dds</Button>
<fScale>0.45</fScale>
<fInterfaceScale>0.9</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/T90/T-84 Animated.nif</NIF>
<KFM>Art/Units/T90/T-8 Animated.kfm</KFM>
<SHADERNIF>Art/Units/T90/T-84 Animated.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/ModernArmorShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP elvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<iDamageStates>4</iDamageStates>
<TrailDefinition>
<Texture>Art/Shared/tanktread.dds</Texture>
<fWidth>0.8</fWidth>
<fLength>180.0</fLength>
<fTaper>0.0</fTaper>
<fFadeStartTime>0.2</fFadeStartTime>
<fFadeFalloff>0.35</fFadeFalloff>
</TrailDefinition>
<fBattleDistance>0.5</fBattleDistance>
<fRangedDeathTime>0.12</fRangedDeathTime>
<bActAsRanged>1</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIQUE_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop>LOOPSTEP_MOD_ARMOUR</AudioRunTypeLoop>
<AudioRunTypeEnd>ENDSTEP_MOD_ARMOUR</AudioRunTypeEnd>
</AudioRunSounds>
<SelectionSound>AS3D_UN_MOD_ARMOUR_HEAL</SelectionSound>
<ActionSound>AS3D_UN_MOD_ARMOUR_HEAL</ActionSound>
</UnitArtInfo>

We want this unit unique to the Russians so:

In CIV4CivilizationInfos.xml:

<Unit>
<UnitClassType>UNITCLASS_MODERN_ARMOR</UnitClassType>
<UnitType>UNIT_T90</UnitType>
</Unit>

For some other units, i use default Buttons. That's the only thing i might not do from the tutorial. Oh, and the Civilopedia texts aren't ready yet. If this is solved out, we'll see.

Any ideas? I would be grateful to anybody.
 
well i did everything exactly how it says to do it in this guide to make a unit and now my game wont even launch up. its not even giving me an xml error it just gives me an error and says it needs to close.
 
@jtxhorns
Are you using BtS?, things are a little different with the expansion


@seitan2102
Your code looks good to me, except this:
Code:
 <NIF>Art/Units/T90/T-84 Animated.nif</NIF>
 <KFM>Art/Units/T90/T-8 Animated.kfm</KFM> <<---- HERE
 
yea im using bts and im also trying to put it in a mod, which might also be the problem. i would hate to undo everything that i did if there only needs to be 1 or 2 things that i need to fix because i really do want this unit in my game.
 
well i went ahead and just put everything back to normal and now my game runs fine. im not going to try and make a new unit until i can find something that explains how to do it for bts. i wasnt aware that this wouldnt work for bts.
 
i have found that it is a lot easier to just replace a unit then it is to actually add a new one. so i think ill just do that and save some headache :confused:
 
@jtxhorns
You should post some code for us to help.
(and post it in code tags please ;))

@seitan2102
BtS is a little different, here is an example of mine, it uses modular loading, perhaps it can help you:
Pathfinder
 
seitan2102

I think Wolfshanze means that just as you have <EarlyArtDefineTag>ART_DEF_UNIT_T90</EarlyArtDefineTag>, you also need to have <LateArtDefineTag>ART_DEF_UNIT_T90</LateArtDefineTag>, I don't recall the exact syntax, but look for other units with this dual art definition, and you'll see what he means. Did you edit Civ4UnitArtStyleTypeInfos.xml as well?
 
he i was wondering if anyone knows how to edit the cultural graphics for the units. i have a lot of unit graphics that i want to put in.
 
Hello all!

I've been adding some units to my game as UU for the Zulus from here and am having a problem with the Knight. The other five units I have added all work fine. The problem (which I have seen mentioned but no solutions) is that there are no command buttons for the knight. If another unit was selected before focus passes to the knight then the knight has the same buttons as the previous unit. They don't work if the knight cannot perform the action, like building a city.

I have traced the problem to CIV4ArtDefines_Unit.xml or maybe the NIF file. Here is the code I have which is a direct copy of the normal knight with some path modifications:


Code:
<UnitArtInfo>
	<Type>ART_DEF_UNIT_ZULU_KNIGHT</Type>
	<Button>,Art/Interface/Buttons/Units/Knight.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,8,1</Button>
	<fScale>0.42</fScale>
	<fInterfaceScale>0.9</fInterfaceScale>
	<bActAsLand>0</bActAsLand>
	<bActAsAir>0</bActAsAir>
	<NIF>Art/Units/Zulu Knight/Knight.nif</NIF>
	<KFM>Art/Units/Zulu Knight/heavycavalry.kfm</KFM>
	<SHADERNIF>Art/Units/Zulu Knight/Knight.nif</SHADERNIF>
	<ShadowDef>
		<ShadowNIF>Art/Units/01_UnitShadows/HorseShadow.nif</ShadowNIF>
		<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
		<fShadowScale>1.0</fShadowScale>
	</ShadowDef>
	<fBattleDistance>0.35</fBattleDistance>
	<fRangedDeathTime>0.31</fRangedDeathTime>
	<bActAsRanged>0</bActAsRanged>
	<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
	<AudioRunSounds>
		<AudioRunTypeLoop/>
		<AudioRunTypeEnd/>
	</AudioRunSounds>
</UnitArtInfo>

All of the folders are pointing to the right areas as the unit shows in game just fine. If I change the NIF tag back to the original knight then it works just fine, kinda defeating the whole point, but still fine. :crazyeye:

I have tried starting from scratch with just the new knight as the only new unit, but the problem persists. Does anyone have a suggestion for this?

Thanks in advance,

-Greymalkin2k

edit: Using Civ4:BtS v3.13 <-- might be helpful information! :blush:
 
Hey i just got bts and i was wondering if im suppose to get the XML files from

Civ4/assets/XML

or

Civ4/BTS/assets/XML
 
Iv done this lessone twice and never got anything but xml errors. Are you sure you peeps are getting results or is it me???
 
Back
Top Bottom