1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[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. Hmmm, I could swear I sent you a PM addressing the problem... Anyway, I'm gonna reply to your post in the unit's thread:
    1) Don't copy the kfm file (or any kf files) from the scout's folder. Instead in the xml, simply have the KFM tag point to the original location of the scout's kfm file, i.e. the same as the actual scout.

    2) To me it looks like the button is the wrong size. Check that the button's size is 64x64 pixels. If it is then the only thing I can think of is the button entry in xml, double check that it's correct - it should have a single path (not like default units that have a 2nd path pointing to the atlas) and no commas in front or at the end.

    3) When I sent you the PM I wasn't sure if that fire problem occurs in the game as well. I'm guessing you don't know though since the game freezes when the unit finishes building. So, first of all, I think the freeze occurs because you added kfm file to the unit's folder and referenced it instead of the original, hopefully the freeze will disappear when you fix that.
    When that happens check how the unit looks in game, it's possible that the problem occurs only in civilopedia, in which case it's not a big deal.

    If however, the in-game unit has the same problem then check the unit's folder, if it has only one NIF file then you'll have to ask the creator about the problem. However, if it has 2 NIF files, something like prodomoi.nif and prodomoi_fx.nif then it's possible one of them doesn't have a problem, so in the xml try pointing both NIF and SHADERNIF tags to the same file, hopefully one of them will work.

    4) As I said in 3) I think the game freezes because of that kfm file so it should be cleared by referencing the original one.

    Cheers
     
  2. 10lire

    10lire Prince

    Joined:
    Mar 5, 2003
    Messages:
    304
    Location:
    Milan, Italy, EU
    Thank you very much for your reply, White Rabbit! i had solved all these problems days ago (and the solutions were exactly those you have indicated! :thumbsup:), except for the position of the torch's fire as said at point 3 of my post in the unit's thread:
    and in the post #39 of this thread:
    Now i can play with this unit, and i can see that, in game, the fire is in the proper position; the problem is ONLY in the civilopedia (ok, i know, its a minor problem..). What is boring me is that i haven't find any such link, tag or graphic file for that fire. In the unit subfolder there is a 'torch.dds' file, but it is the graphic wooden skin of the TORCH, not of the FIRE... :confused:
     
  3. Mooseydoom

    Mooseydoom Chieftain

    Joined:
    Apr 16, 2007
    Messages:
    7
    I followed the guide step by step, didn't add anything too the "Spartan" folder I made, in the ArtDefines I changed the <NIF> too Art/Units/Spartan/espartano.nif, and left the rest leading too the Phalanx ones. I don't know what to do with all the other stuff in the Spartan folder. Thanks for any help.

    edit: nvm, got it, had to mess with the .nifs a bit
     
  4. Well I'm glad you figured it out (mind you, from your post it's not exactly clear what the problem is ;)) but in any case, you should always change both the NIF and NIFSHADER (or SHADERNIF) tags, even if the unit doesn't have the _fx version of the file. If that's the case then both those tags should point to the regular nif and if it's vice versa, i.e. the unit comes with only _fx file, then both those tags should point to the _fx file.
     
  5. Celtic Leader

    Celtic Leader Chieftain

    Joined:
    Jun 11, 2007
    Messages:
    9
    I gave myself my new unit in world builder and got three red blobs. they fight ok though, no errors occured. :crazyeye:
     
  6. Celtic Leader

    Celtic Leader Chieftain

    Joined:
    Jun 11, 2007
    Messages:
    9
    Never mind I didn't completely change everything.:blush: Thanks for the guide!
     
  7. Bospor

    Bospor Chieftain

    Joined:
    Jun 14, 2007
    Messages:
    43
    I kind of figured out how to change stats. I think I just figured out how to put a newly downloaded unit into the game. But now I have a question. I actually want to add a Norman Swordsman (downloaded from the net) into the game instead of the Maceman, BUT I only want it to replace a Russian maceman. How can I limit the availability of this new unit ONLY to the Russian civ?
     
  8. You'll need to treat it as a unique unit, even if it doesn't have unique stats. This means that you create this new unit just like you would any unit, so new unit type and art definition for it. Then in the civilizationsinfo xml file, find the entry for Russia and, using the cossack as the template, add this unit as UU for Russia that replaces maceman.
     
  9. Bospor

    Bospor Chieftain

    Joined:
    Jun 14, 2007
    Messages:
    43
    Thanks for your reply, I was wondering if anyone still hangs around this forum. One more thing that I didn't understand from the tut:blush: . Your tut explains how to add a unit into a game, but it can only be used from the world builder (at least so you say at the end of the tut). How can I add a new unit into the vanilla game? I want to use this new unit in the regular single player game.
     
  10. RTMMaverick

    RTMMaverick Chieftain

    Joined:
    Aug 6, 2007
    Messages:
    6
    Location:
    TENNESSEE
    Thanks for the tut. I know it takes time for you guys to offer this in-depth info. And it is appreciated. While I want to "jump in" and start something, I'm gonna brush up on all of this and start slow.

    Thanks a million!!
     
  11. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    Hi guys... I've done everything perfectly... except one tiny little thing.

    Background:
    I made a Celtic Swordsman that is a unique unit for the Celts. Removed their previous Celtic UU. I have every single related civ-pedia entry... and basically everything is golden. All cross-references are filled in, and I can produce them just as I should... except... there are pink blobs instead of what I put in.

    I am trying to use Danrell's beautiful Teutonic Swordsman for this mod. I changed the directory he had to Celts_Swordsman... and renamed all the files there-in with CeltsSwordsmanxxxx.xxx Whereas before he had all the file names starting with LightSwordsmanxxx.xxx

    I'm not playing this as a mod. I put all my modded stuff in the customassets directory. So maybe the renamed files are messing it up? or maybe I plunked it down in the wrong directory? Right now it's in \\Beyond the Sword\CustomAssets\Units\

    Thanks for the help!
     
  12. You can't rename the DDS or the KF/KFM files, only NIFs, and even that's not recommended unless you know what you're doing. Use the original files of the unit as they are, and when you have that working then, if you really want, you can rename the NIFs and change the references to them in the XML files, however I don't see a reason why you'd need to do that.
     
  13. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    Thanks I got it :)
     
  14. yatta77

    yatta77 Emperor

    Joined:
    Mar 22, 2006
    Messages:
    1,041
    Hi. Sorry for bothering you, but I want to ask if you do you know if there's an issue with Bts? Because if I create a mod and add a unit getting the animations the way you say it works fine in vanilla but trying to do so in Bts something weird happens... The unit looks like it is supposed to look if it's active, but... as soon as it is not active (you select another unit) it transforms in the unit you picked the animation from! It might be a problem about the flavored unit added in BtS? Any Idea about? If so please tell me. Thanks.
    (If you want me to post my files let me know).
     
  15. redpoint

    redpoint Chieftain

    Joined:
    Aug 15, 2007
    Messages:
    1
    edit

    I see, yatta experienced the same problem, so I don't have to write it all again. I hope someone can answer this question.

    edit
    Maybe I should add that this problem only occurs with units that doesn't have own .kfm files. Those which have, like the UN Modern Armour, work just fine.
     
  16. KrugerPritz

    KrugerPritz King

    Joined:
    Aug 23, 2005
    Messages:
    784
    Location:
    Venezia - Italia
    I haven't read if anyone already asked it I'm interested in the modular adding units... when i add new civilizations in modular way, and want to add flavour new units in the standard civilizations, can i follow this tut, or i have to chreate aqmodule also for the standard civilization?
     
  17. @yatta77, @redpoint: Do you guys have the "Freeze Animations" option on? If you do then you'll need to disable it, that's the reason why that bug occurs. If you don't then I'm really not sure what the problem is and would have to look at the individual units.

    @KrugerPritz: To be honest I have yet to really look into the whole modular modding thing so I can't tell you for sure. However, I imagine that the XML files involved (unitdefine, artdefine, civinfo) could be modular, the only thing you might need to look out for is for conflicts with existing units.

    Oh and Kruger, could you please remove, if you don't mind, the quote of my entire first post from your post, it takes up a lot of space and serves little purpose. Thanks. :)
     
  18. Laurencius

    Laurencius Just a tourist.

    Joined:
    Apr 26, 2007
    Messages:
    106
    Gender:
    Male
    Location:
    Slobovia
    Hi.

    On a BTS mod, I am trying to add an Ashigaru Spearman for the Japanese to replace the Spearman. I believe I followed the steps and went into the Civilizations file to add it as a UU for the Japanese. The new unit appears in World Builder, but when I play normally, Japan still builds the regular asian spearman.

    What am I missing or doing wrong? Thanks.
     
  19. KrugerPritz

    KrugerPritz King

    Joined:
    Aug 23, 2005
    Messages:
    784
    Location:
    Venezia - Italia
  20. yatta77

    yatta77 Emperor

    Joined:
    Mar 22, 2006
    Messages:
    1,041
    You're a genius! I would never guess that myself... :D Thanks man! :goodjob:
    I confirm that the frozen animation option activated is the reason of the problem I was taking about few posts above, and I confirm that this happens in BtS and not in Vanilla Civ IV.
     

Share This Page