GUIDE: Adding new units

Ok I followed another guide that I found first, then stumbled upon this one and I have created a simple mod (which I plan on expanding) to remake the american civil war. I have added some of the needed countries, leaders, and units without much problem... Even have the buttons and civlopedia working. :) But I have ran across a problem which I'm not sure about so I figured maybe somebody could answer my semi-noobish question...

To start off I made confederacy and union civs, added leaders, and 1 UU just to get things started. Everything appears ok in civlopedia, and even works in game, but I'm having serious problems getting the units to animate correctly.

In the civlopedia animated picture and in-game the unit stands with his hands out and doesn't animate.

I used somebody's skin job for union and confederate infantry, and I placed both in seperate folders named union_rifleman and confederate_rifleman respectively. The skin pack that I downloaded did not include a KFM file so I basically just copied the rifleman animations and replaced only the files which looked replaceable.

Code:
               <UnitArtInfo>
			[B]<Type>ART_DEF_UNIT_UNIONINFANTRY</Type>[/B]
			<fScale>0.44</fScale>
			<fInterfaceScale>1.0</fInterfaceScale>
			[B]<NIF>Art/Units/Union_Infantry/american_rifleman.nif</NIF>[/B]
			<KFM>Art/Units/Rifleman/Rifleman.kfm</KFM>
			[B]<SHADERNIF>Art/Units/Union_Infantry/american_rifleman_fx.nif</SHADERNIF>[/B]
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
				<fShadowScale>0.9</fShadowScale>
			</ShadowDef>
			<fBattleDistance>0.35</fBattleDistance>
			<fRangedDeathTime>0.05</fRangedDeathTime>
			<bActAsRanged>1</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop/>
				<AudioRunTypeEnd/>
			</AudioRunSounds>
		</UnitArtInfo>
		<UnitArtInfo>
			[B]<Type>ART_DEF_UNIT_CONFEDERATEINFANTRY</Type>[/B]
			<fScale>0.44</fScale>
			<fInterfaceScale>1.0</fInterfaceScale>
			[B]<NIF>Art/Units/Confederate_Infantry/confederate_rifleman.nif</NIF>[/B]
			<KFM>Art/Units/Rifleman/Rifleman.kfm</KFM>
			[B]<SHADERNIF>Art/Units/Confederate_Infantry/confederate_rifleman_fx.nif</SHADERNIF>[/B]
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
				<fShadowScale>0.9</fShadowScale>
			</ShadowDef>
			<fBattleDistance>0.35</fBattleDistance>
			<fRangedDeathTime>0.05</fRangedDeathTime>
			<bActAsRanged>1</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop/>
				<AudioRunTypeEnd/>
			</AudioRunSounds>
		</UnitArtInfo>

Anything in bold I changed and anything not in bold is from the original rifleman UnitArtInfo. Any file represented here is present and in the correct folder... I dont really know anything about animation though so I'm kinda lost.

Really everything about the unit works fine except the animation... I'm sure i goofed something up in here, or need an extra file or something... I tried copying the rifleman.kfm and putting in the corresponding folder in my mod and changed file path, but that didn't help either. Thanks ahead of time ;)
 
you mean the american_rifleman.nif, ect.? or the rifleman.kfm?

Im trying to just use the normal rifleman animation.
 
well after numerous test I think the source on the american_rifleman.nif, ect. are whats wrong.... I copied the original rifleman and put that into my UnitArtInfo and the animation worked fine, but was the original rifleman skin, of course ;).

Then I put the unpacked rifleman art into the correct folder, reassign folder structure so everything leads to that in the UnitArtInfo, again it works fine but still the original rifleman skin.

Then I try changing, 1 at a time the <NIF> and <SHADERNIF> tags to the new skin... Both of them did the same thing, resulting in a rifleman with the correct skin, but arms pointing up and out, and no animation.

Then I copied all the original rifleman art and place them in the Union_Infantry folder, and rename the american_rifleman.nif to Rifleman.nif, and same for the FX.nif, and still same thing.

I guess I need to learn to skin, because I'm pretty sure these skins are the problem.

Here is the confederate one, the problem is the same for both, the kfm in there is just a copy from the original rifleman kfm.

EDIT: LOL i feel like a moron... the thing uses infantry animations, not rifleman :D

problem resolved :)
 
ive added a English longbow but it comes ups as [IMAGE 1]what have i done wrong also when ever i mod TXT_KEY annoys me in promotions.
 

Attachments

  • Civ4ScreenShot0075.JPG
    Civ4ScreenShot0075.JPG
    116.8 KB · Views: 139
ive added a English longbow but it comes ups as [IMAGE 1]what have i done wrong also when ever i mod TXT_KEY annoys me in promotions.



TXT_KEY is in the text XML file:

CIV4GameText_Civilopedia_Units.xml

follow the format to add in the text information

hope that helps;)


P.S. also CIV4GameTextInfos_Objects.xml defines alot of unit names also :goodjob:
 
TXT_KEY is in the text XML file:

CIV4GameText_Civilopedia_Units.xml

follow the format to add in the text information

hope that helps;)


P.S. also CIV4GameTextInfos_Objects.xml defines alot of unit names also :goodjob:

is it the same for warlords for i can't find "CIV4GameText_Civilopedia_Units.xml" :blush:
 
it is not the same for warlords...

The text.xml is different from all the other xmls... It can be named anything you want.

Basically what you need to do is just include a new xml, with same format as other text.xml's, and put all your TEXT_KEY_UNIT's, TEXT_KEY_CIVILIZATIONS, TEXT_KEY_STRATEGY's, and TEXT_KEY_PEDIA's in there, everything that is new, will need new tags.

Put the aforementioned XML in the Assets\XML\Text folder of your mod.
 
can someone Help me with this problem..
just done the adding unique unit tutorial and have checked it over again and again and still the problem is there.. when i try to build my unique unit, it crashes just when i click the unique unit button

game just freezes
 
it is not the same for warlords...

The text.xml is different from all the other xmls... It can be named anything you want.

Basically what you need to do is just include a new xml, with same format as other text.xml's, and put all your TEXT_KEY_UNIT's, TEXT_KEY_CIVILIZATIONS, TEXT_KEY_STRATEGY's, and TEXT_KEY_PEDIA's in there, everything that is new, will need new tags.

Put the aforementioned XML in the Assets\XML\Text folder of your mod.

:huh: is it something to with CIV4gametext_new ?
 
can someone Help me with this problem..
just done the adding unique unit tutorial and have checked it over again and again and still the problem is there.. when i try to build my unique unit, it crashes just when i click the unique unit button

game just freezes
 
can someone Help me with this problem..
just done the adding unique unit tutorial and have checked it over again and again and still the problem is there.. when i try to build my unique unit, it crashes just when i click the unique unit button

game just freezes

usually that happens when your button image is the wrong size

64x64 is the correct size

and of course it's a dds file (but it doesnt need an alpha channel)

hope that helps ;)
 
it is not the same for warlords...

The text.xml is different from all the other xmls... It can be named anything you want.

Basically what you need to do is just include a new xml, with same format as other text.xml's, and put all your TEXT_KEY_UNIT's, TEXT_KEY_CIVILIZATIONS, TEXT_KEY_STRATEGY's, and TEXT_KEY_PEDIA's in there, everything that is new, will need new tags.

Put the aforementioned XML in the Assets\XML\Text folder of your mod.

:huh: is it something to with CIV4gametext_new ?


basically you can make a NEW file in the TEXT folder and CIV4 will read all the taglines files in the TEXT folder

this is the only time where the taglines (TXT_) doesnt have to be in a SPECIFIC file

therefore you can create a NEW file (easiest way is to copy an exsiting txt file and rename it... then edit/erase the taglines as needed :goodjob: ) and CIV4 will read the file...

just make sure that new file is in the text folder

CIV4 should read it regardless of the name

clear as mud :crazyeye:

hope that helps ;)

PS also take an existing mod and check out how they place (path/file/folder) the XML TEXT files in the folder.... then copy that path/folders/files in your mod and it should work :)
 
hey Reene, im using the standard marine button

are your taglines pointing to the correct button?

is the syntax correct?
 
yep i just copied the marine button and its showing in the city build screen but when i click it crashes. I left out the civilopedia part koz i want to do this in stages, do you think it matters if i left that bit out?
 
Hmm, I can't seem to find the Art0.fpk file. I'd appreciate it if someone could show me the path.

the patched version of 1.52 broke it down further

Assets0.fpk
Assets1.fpk
Assets2.fpk
Assets3.fpk

the path is:

Civilization4\Assets folder

hope that helps ;)
 
yep i just copied the marine button and its showing in the city build screen but when i click it crashes. I left out the civilopedia part koz i want to do this in stages, do you think it matters if i left that bit out?



did you match up the art taglines?

example:

Code:
		<UnitInfo>
			<Class>UNITCLASS_MARINE</Class>
			<Type>UNIT_MARINE</Type>
			<UniqueNames/>
			<Special>NONE</Special>
			<Capture>NONE</Capture>
			<Combat>UNITCOMBAT_GUN</Combat>
			<Domain>DOMAIN_LAND</Domain>
...
...
...
			<UnitMeshGroups>
				<iGroupSize>3</iGroupSize>
				<fMaxSpeed>1.75</fMaxSpeed>
				<iMeleeWaveSize>3</iMeleeWaveSize>
				<iRangedWaveSize>0</iRangedWaveSize>
				<UnitMeshGroup>
					<iRequired>3</iRequired>
					[COLOR="Blue"]<EarlyArtDefineTag>ART_DEF_UNIT_MARINE</EarlyArtDefineTag>
				</UnitMeshGroup>
			</UnitMeshGroups>
			<Button>,Art/Interface/Buttons/Units/Marine.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,3,7</Button>[/COLOR]
			<HotKey/>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<FreePromotions>
				<FreePromotion>
					<PromotionType>PROMOTION_AMPHIBIOUS</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
			</FreePromotions>
		</UnitInfo>
		<UnitInfo>

your UU should have that blue highlighted text in your UU entry of the CIV4UnitInfos.xml file


and your UU should change this:

Code:
		<UnitInfo>
			<Class>UNITCLASS_MARINE</Class>
			<Type>[COLOR="Blue"]UNIT_MARINE[/COLOR]</Type>
			<UniqueNames/>
			<Special>NONE</Special>


to this:


Code:
		<UnitInfo>
			<Class>UNITCLASS_MARINE</Class>
			<Type>[COLOR="Blue"]UNIT_YOURUUNAME<[/COLOR]/Type>
			<UniqueNames/>
			<Special>NONE</Special>


in the CIV4UnitInfos.xml file


sorry if this is redundant but Im trying to figure out what's wrong ;)
 
Back
Top Bottom