Problems Adding Flavour New Units

Dark_Jedi06

"Deus ex Machina."
Joined
Jul 19, 2006
Messages
1,451
I'm having several mysterious problems with adding new units, specifically adding them by means of Civ4UnitArtStyleTypeInfos.xml. I use the same process for each unit, yet some end up with a few strange problems:

-the unit doesn't show up on the interface in the lower left corner by its stats
-the unit doesn't have a button and can't be selected in a stack
-for bombers and fighters sometimes missions and commands aren't displayed
-some units don't have a Civilopedia page, but some do

These problems make no sense to me. :confused: Especially with the Civilopedia pages...I'm not pointing to a new unit, just different art for an existing unit. I'm sure everything is correct in the appropriate XML files. I haven't been able to find the answers elsewhere so help would be much appreciated. :)
 
These problems normaly occure, if both .nif and .kfm don't have the standard civ name of the original unit and the names of both don't match each other.
Hmm...you seem to have the right of it, however I'm not sure how to fix this problem? I tried renaming both the NIF and KFM and it didn't work (the ones that the XML points to), would have to rename all of the NIF and KF files as well?
 
You can't rename those files without causing trouble!!! If you do so you must also edit the kfm file and point to the renamed kf-files in it.

But if you have done everything right there is no need to do so.
 
You can't rename those files without causing trouble!!! If you do so you must also edit the kfm file and point to the renamed kf-files in it.

But if you have done everything right there is no need to do so.

But I have done everything right? :think: I can't seem to figure out how to solve this problem...the XML files I've edited are error free and the units show up "fine" in game, albeit some of them with these pesky problems.

I looked at similar mods, this doesn't happen with Varietas Delectat yet he uses the same methods?
 
Hmm...you seem to have the right of it, however I'm not sure how to fix this problem? I tried renaming both the NIF and KFM and it didn't work (the ones that the XML points to), would have to rename all of the NIF and KF files as well?

Normally there are max. 2 wrong named .nif files, the one you name in the XML files, nothing more. If you've renamed them to the original civ name, then everything should be fine.

Could you maybe show us an example entry and maybe a screenshot of the unit folder?
 
But I have done everything right? :think: I can't seem to figure out how to solve this problem...the XML files I've edited are error free and the units show up "fine" in game, albeit some of them with these pesky problems.

I looked at similar mods, this doesn't happen with Varietas Delectat yet he uses the same methods?

Maybe you did make a mistake? My experience is that a lot of errors are the result of little mistakes, like typing one letter wrong, and such. Sometimes it is also one of the hardest types of errors to pinpoint, but maybe if you post your files here someone will be able to find the error for you (if there are any).
 
Okay, here's an excerpt from the CIV4ArtDefines_Unit.xml for a replacement swordsman for Japan. The civilopedia entry doesn't work, he doesn't show up in the interface and his icon doesn't show up in a stack (no button)...but everything else works, meaning the unit itself and its animations:

Code:
<UnitArtInfo>
			<Type>ART_DEF_UNIT_SWORDSMAN_JAPANESE</Type>
			<Button>,Art/Interface/Buttons/Units/Swordsman.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,4,5</Button>
			<fScale>0.44</fScale>
			<fInterfaceScale>1.0</fInterfaceScale>
			<bActAsLand>0</bActAsLand>
			<bActAsAir>0</bActAsAir>
			<NIF>Art/Units/Swordsman_Japan/Swordsman.nif</NIF>
			<KFM>Art/Units/Swordsman_Japan/japanesesamurai.kfm</KFM>
			<SHADERNIF>Art/Units/Swordsman_Japan/Swordsman.nif</SHADERNIF>
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.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>

And a corresponding screenshot of my Assets > Art > Units folder:

Spoiler :


Hopefully someone can see the problem, thanks for your input so far! :)
 
I think, i've been a bit unclear.
The .kfm name has to match the .nif name.
Try to rename either the japanesesamurai.kfm to swordman.kfm or the nifs to japanesesamurai (i have no idea, which is here the "right" name, because both are standard civ names; you could look at the .kfm with a text editor to find out the right name).
 
I think, i've been a bit unclear.
The .kfm name has to match the .nif name.
Try to rename either the japanesesamurai.kfm to swordman.kfm or the nifs to japanesesamurai (i have no idea, which is here the "right" name, because both are standard civ names; you could look at the .kfm with a text editor to find out the right name).

Brilliant! I understand now. Thank you very much, problem solved! :goodjob:
 
Back
Top Bottom