[TUT] Adding newly created units to Civ4 in 6 "easy" steps

Discussion in 'Civ4 - Modding Tutorials & Reference' started by Rabbit, White, Jul 5, 2006.

  1. ArdRaeiss

    ArdRaeiss Chieftain

    Joined:
    Jan 11, 2004
    Messages:
    84
    Location:
    Russia, Saint-Petersburg
    Can you add part about adding custom button for unit? It's very simple - you just need modify the Art/Interface/Buttons/Unit_Resource_Atlas.dds and edit CIV4UnitInfos.xml. But my english is not good enough to write guide :(
     
  2. Chazcon

    Chazcon Prince

    Joined:
    Feb 16, 2006
    Messages:
    475
    Location:
    Left Coast
    Thanks Ard, I'll try that too.

    Some units only come with a ,dds file - when I open it with a viewer it's obviously a skin - but if I try to point to it in my ArtDefines, the unit doesn't show up in game - the <NIF> and <ShaderNIF> tags will only accept a .nif file (sounds obvious, I know)

    So when I download someone's new unit, and it is in a .dds format, does this mean I must create a .nif file using this skin, myself?

    Thanks for contributing to my education /grin
     
  3. ArdRaeiss

    ArdRaeiss Chieftain

    Joined:
    Jan 11, 2004
    Messages:
    84
    Location:
    Russia, Saint-Petersburg
    This is skin for existing unit. You must:
    1) Create new unit directory.
    2) Copy the original unit nif and dds files into this dir.
    3) Copy new skin to that dir(owerwrite old files).
    4) In CIV4ArtDefines_Unit.xml point to the <UNIT>.nif and <UNIT>_fx.nif in the new dir. Point in XML to original kfm.

    And, YES, you can create new unit using existing skin :)

    As for ingame icons - the easyest way is to place icon dds file to the unit dir(or specially created icons dir) and point in CIV4UnitInfos.xml to this file:
    <Button>Art/Interface/Buttons/Units/G4M3.dds</Button> - in this example the icon for G4M3 placed in special icons directory.
     
  4. Chazcon

    Chazcon Prince

    Joined:
    Feb 16, 2006
    Messages:
    475
    Location:
    Left Coast
    Ok makes sense, thanks, and the original unit .nif's are in the .fpk files I need to unpack?
     
  5. ArdRaeiss

    ArdRaeiss Chieftain

    Joined:
    Jan 11, 2004
    Messages:
    84
    Location:
    Russia, Saint-Petersburg
    Yes. Unpack, make new dir, place to this dir.
     
  6. HecticHermit

    HecticHermit Chieftain

    Joined:
    Nov 21, 2006
    Messages:
    19
    just a question I have look through some of the Nif tutorials and Blender Import/export tutorials....Is it possible to make a completely new unit...if I know how to model/animate?
     
  7. Chazcon

    Chazcon Prince

    Joined:
    Feb 16, 2006
    Messages:
    475
    Location:
    Left Coast
    Hmm if you knew how...why would you ask that question?
     
  8. HecticHermit

    HecticHermit Chieftain

    Joined:
    Nov 21, 2006
    Messages:
    19
    It means that I have been using Blender for about 2 years but thats still kinda new to the world of animation,my personal guess, usually 5-6 years would be ready to make modern game models,
     
  9. seady

    seady Prince

    Joined:
    Aug 30, 2006
    Messages:
    582
    Location:
    Sydney
    I'm going crazy with frustration. I'm so close but no cigar. For the purposes of this, please don't suggest i buy stuff as an answer to problems, i don't have the cash, and if it can't be done with freeware, i can't do it and that's that. I've been told i need an MD node, but i see models like the zepellin one in the genetic era that don't use them, and from i can see, i haven't really done too much different to what was done there. I'm totally new to animation except i did 2D work about 12 years ago and don't recall it beyond vague memories.

    Macs are good, static is bad, bitmaps can be ludicrously large and marketing guys are morons. Ok, that was those years summarised.

    I can't find anything about how to create kfm with blender so maybe it can't be done. If so, i guess a static unit is bearable. I'd love to make my unit 'swim' though.

    I have a nif i made in blender that seems fine in nifskope. It will not showup in civ, however.

    Spoiler :


    I get the dreaded red globe of death. I'm using the art defines below. Can anyone tell me:
    1. what I am doing wrong?
    2. How to make a shader nif using blender or similar freeware program
    3. Do we have the ability to make kfm files or are they proprietary?

    :thanx: :thanx: :thanx:

    Spoiler :
    Code:
    		<UnitArtInfo>
    			<Type>ART_DEF_UNIT_SEASTAR</Type>
    			<fScale>0.9</fScale>
    			<fInterfaceScale>0.3</fInterfaceScale>
    			<NIF>Art/Units/seastar/seastar.nif</NIF>
    			<KFM>Art/Units/seastar/Submarine.kfm</KFM>
    			<SHADERNIF>Art/Units/seastar/seastar.nif</SHADERNIF>
    			<ShadowDef>
    				<ShadowNIF>Art/Units/01_UnitShadows/BattleshipShadow.nif</ShadowNIF>
    				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
    				<fShadowScale>0.001</fShadowScale>
    			</ShadowDef>
    			<TrailDefinition>
    				<Texture>Art/Shared/water_ship_wake.dds</Texture>
    				<fWidth>1</fWidth>
    				<fLength>190.0</fLength>
    				<fTaper>1</fTaper>
    				<fFadeStartTime>.2</fFadeStartTime>
    				<fFadeFalloff>0.35</fFadeFalloff>
    			</TrailDefinition>
    			<fBattleDistance>0.35</fBattleDistance>
    			<fRangedDeathTime>0.31</fRangedDeathTime>
    			<bSmoothMove>1</bSmoothMove>
    			<fAngleInterpRate>720.0</fAngleInterpRate>
    			<fExchangeAngle>25.0</fExchangeAngle>
    			<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>
    
     
  10. The local blender expert is C. Roland so you should ask him about that. You might also check out this tutorial he wrote (though it doesn't cover animations, I don't think).

    The zeppelin doesn't use MD node because it doesn't have animations (I think you already figured that out). Though the lack of MD node also means that it won't properly support team colors.

    As for your starfish - first thing I would do is call the submarine KFM file from its original location. You do not need to copy the animation file into the new units' folder unless you modified the KF files using Hex editor. It is perfectly fine to reference the KFM files from its original location. And in fact, in most cases, doing this (copying) actually screws things up (don't ask me why). So, try that, if that doesn't work, my best guess is that you're forgetting something on export.

    As I said I'm not familiar with Blender, but double check that you're using the proper material. Make sure that you have the textures assigned to the correct material attributes.

    Finally, if all fails go back to basics - follow that blender tutorial and make a cube (or whatever is used there) work in game. If you can do that then go from there.

    Hope this helps.

    Cheers
    WR
     
  11. Halidon55

    Halidon55 Prime

    Joined:
    Apr 9, 2003
    Messages:
    89
    I followed this tut to the letter and everything seems to be working in the game, except with my formation and promotion buttons. These are not appearing with my new unit. Is there something more I need to do besides adding my unit to the formationInfo.xml file? Has anyone else run into this problem?
     
  12. Portus

    Portus Warlord

    Joined:
    May 17, 2005
    Messages:
    121
    Tanks for the tutorial
    Lets see, i pretend a machinegunner with tha apearence of infantry model, so i have to replce the <NIF> and <SHADERNIF> of MG for the ones of infantry, OR replace the KFM of infantry by the one of MG. is that correct?

    Tanks
     
  13. juni_be_good

    juni_be_good Black mage

    Joined:
    Jun 26, 2005
    Messages:
    115
    Location:
    Caen, France
    I have exactly the same problem. I already added many units in mods and never add this problem, but now, this happen with two different units :crazyeye: My units are air units, I think it may have something to do with it (because as far as I remember, it is the first time I use an air unit in a mod, and because I think that the distance between the unit and the ground may be of some importance). I took a look at 3D sounds scripts, but the only solution I can find is lowering the volume, but that would affect all units, even those which are working well currently.

    Any idea ? :mischief:
     
  14. Sorry for the very late reply, I lost track of this thread, anyway...

    When there are problems with promotion buttons that points to a serious bug with the unit. Double check the artdefines file, make sure you're not using unnecessary animation files. Also, there are a few units floating around, including couple of mine, that are a bit tricky to setup, i.e. if you go by this tutorial they probably won't work, however, at least on my side, I always provide the additional necessary instructions on how to set them up. Send me a PM if you still can't resolve the issue, with more detailed description of the problem.

    Actually either will work, technically. However there are 2 issues here - 1) It's possible that these units are not compatible enough for you to simply replace the animation or the model of one and have it work correctly. You might have to do some work on the unit in the NIF viewer. There are tutorials on that in my sig. 2) Even if the animations themselves translate well from one unit to another, you still have the issue of the weapon. The machine gunner animation requires a weapon that has a tripod that opens up when the unit sets up to shoot. If you simply replace infantry's animation with MG's or MG's model with infantry's then you'll get an odd looking attack animation. You will at the very least need to give MG's weapon to infantry unit.

    I'm gonna have to take a close look at that, but the only time I ever encountered this problem (Which only happened once) was due to a badly exported unit from max, i.e. it was problem with the unit itself, the way it was exported, not the xml files. See if the creators of these units know something about it. Incidentally, are these units mine? :)
     
  15. juni_be_good

    juni_be_good Black mage

    Joined:
    Jun 26, 2005
    Messages:
    115
    Location:
    Caen, France
    No they aren't. I will ask their creators. thanks for the answer ;)
     
  16. Californio

    Californio Beast

    Joined:
    Nov 24, 2006
    Messages:
    71
    Location:
    Sweet Cali!
    I'm just about finished with my first scenario, but im having trouble with World Builder, if I change a units name and save it, but try to reload later, the name changes back! Any help?
     
  17. Chose

    Chose King

    Joined:
    May 26, 2005
    Messages:
    669
    Location:
    USA
    When i copy the files from the civ 4/assets/xml. They are some kind of link to the internet, and my browser says they page cant be displayed. Does anyone know what to do
     
  18. Uncle_Joe

    Uncle_Joe Prince

    Joined:
    Sep 9, 2005
    Messages:
    481
    If you are trying to open it to edit it, dont just click it open...right click on it, select 'open with' and choose a text editor (like Wordpad or something).

    That should let you open it and edit it without issue.
     
  19. 10lire

    10lire Prince

    Joined:
    Mar 5, 2003
    Messages:
    304
    Location:
    Milan, Italy, EU
    I have a problem adding this unit (link to the thread). It's a scout with the skin of the Prodromoi unit from the Alexander scenario and a torch instead the axe. All works well, but the unit's picture in the civilopedia shows the fire of the torch on the ground, near the feet of the unit, and not on the top of the torch:



    I don't understand HOW that fire is generated (Something in the unit's .nif files? A tag I forgot to insert in a .xml file?) and WHY it isn't properly placed..

    Thank you in advance for your help :)
     
  20. 10lire

    10lire Prince

    Joined:
    Mar 5, 2003
    Messages:
    304
    Location:
    Milan, Italy, EU
    :aargh: THAT FIRE!! [pissed]

    Can you help me? I haven't find suggestions in the forum!
     

Share This Page