Trouble adding new units

Thomas P

Chieftain
Joined
May 12, 2006
Messages
10
Hello everybody,

I'm a new member of your community and I have got lots of problems with adding new units to Civ4. I liked Civ3 and I liked it to create mods. I never had any problems, but now...:confused:

Okay, here is my problem. At first I decided to add a mobile SAM and a mobile Artillery to the game. I found those units in a folder of the game. I integrated the units into the game without any problems. So I decided to add another unit - a nuclear-submarine. I made a copy of the standard sub and integrated it the same way into the game as "nuclear-submarine". Then I changed the rules of both subs. For example the standard needs oil and the nuclear sub needs uranium. Maybe interesting for you - I reduced the defencepower of the nuclear-sub to 50% in shallow water (TERRAIN_COAST). :D I created a new button and everything was still working fine.
So at last I had to change the layout. I decided to use the layout of the akula-sub, but it doesn't work. My nuclear sub still looks like the standard sub. What must I do to change the layout? I read all descriptions about adding units, but I don't get it.
I created, similar to mobile SAM and artillery (and they are working fine), a folder called NuclearSubmarine in assets/art/units/. But obviously I haven't got the right files in my folder.

Can anybody help me, please? Who can teach me how to copy and replace files the right way? Can anybody please send me a list of the needed files and their sources?

I'm using the 1.61 patch.

Thank you.

PS: (I hope it's "PS" in english :crazyeye: ) I'm very sorry for the bad english. And I'm sure I made hundreds of mistakes, but I hope you could get the message. Thanks.
 
Did you change all the necessary XML entries?

Things you need to have for a new unit graphic to show up:
- New unit definition in Civ4UnitInfos.xml (as I understand you've done that)
- The new unit needs to reference a new art definition in the <EarlyArtDefineTag> tag
- This new art definition needs to be created in the CIV4ArtDefines_Unit.xml file
- The new art definition must reference the new unit files in the <NIF> and <SHADERNIF> tags, and depending on the unit it might also need to reference the new animation file in the <KFM> tag.

If you're using snafusmith's akula submarine then you'll use the same animations as the regular submarine and so your new art definition would look something like this.
Code:
<UnitArtInfo>
	<Type>ART_DEF_UNIT_AKULA_SUBMARINE</Type>
	<fScale>0.55</fScale>
	<fInterfaceScale>1.3</fInterfaceScale>
	[B]<NIF>Art/Units/AkulaSubmarine/AkulaSubmarine.nif</NIF>[/B]
	<KFM>Art/Units/Submarine/Submarine.kfm</KFM>
	[B]<SHADERNIF>Art/Units/AkulaSubmarine/AkulaSubmarine_FX.nif</SHADERNIF>[/B]
	<ShadowDef>
		<ShadowNIF>Art/Units/01_UnitShadows/BattleshipShadow.nif</ShadowNIF>
		<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
		<fShadowScale>0.001</fShadowScale>
	</ShadowDef>
	<iDamageStates>4</iDamageStates>
	<fBattleDistance>0.55</fBattleDistance>
	<fRangedDeathTime>0.31</fRangedDeathTime>
	<bSmoothMove>1</bSmoothMove>
	<fAngleInterpRate>720.0</fAngleInterpRate>
	<bActAsRanged>0</bActAsRanged>
	<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
	<AudioRunSounds>
		<AudioRunTypeLoop>LOOPSTEP_SUBMARINE</AudioRunTypeLoop>
		<AudioRunTypeEnd>ENDSTEP_SUBMARINE</AudioRunTypeEnd>
	</AudioRunSounds>
	<SelectionSound>AS3D_UN_SUBMARINE_FORT</SelectionSound>
	<ActionSound>AS3D_UN_SUBMARINE_FORT</ActionSound>
</UnitArtInfo>
Of course the refences to "AkulaSubmarine" should be changed to whatever file names and locations you're using for the files.

Let me know if this helped.
 
So, when changing the art files, should a "AkulaSubmarine_FX" file be included in the downloaded package? or do you just plug in the standard "AkulaSubmarine.nif" file and add "_FX" to it?

Also, on the actual Akula thread it says " fScale to 0.65" does that mean change the <fScale> to .65? When I first tried modding this file, I did that. I'm also having an issue with the Akula file, so this thread applies to me as well
 
If the _fx file is not included then you simply put the regular version into the shadernif tag, i.e. <SHADERNIF>....../AkulaSubmarine.nif</SHADERNIF>. All it means is that the unit does not support team colors (as far I know at least :)).

The fScale is just the recommended scale by the author, so yeah just change the <fScale> to that value and see if you like how the unit scales in comparison to other units.
 
Back
Top Bottom