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

  • Thread starter Thread starter Rabbit, White
  • Start date Start date
:aargh: THAT FIRE!! [pissed]

Can you help me? I haven't find suggestions in the forum!
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:
I'm trying to add my first unit; I followed the guide in this thread: http://forums.civfanatics.com/showthread.php?t=139721 but I have some problems and questions:


1) I noticed that there is no .kfm file in both the zips (the one with the sword and the other with the torch); i don't know what that file does, but it is necessary because you must enter its path in 'CIV4ArtDefines_Unit.xml' in the <KFM> tag. I have copied the standard scout .kfm file in my mod subfolder 'Assets\art\units\mediterranean_scout\'; i don't know if this method works well because the game freezes (see point 4).


2) I'm using the torch version and I have problems with the button:
a. In 'Scout_ROMAN (with torch).zip' there isn't the button with the torch, but the button with axe;
b. I copied the button with the sword from the other zip; this button appears "out of focus" in game; look here and compare this picture with the first picture in post #1:

buttonoutfocusbq1.jpg


c. the button in the technology screen is NOT "zoomed"; look here:



I don't know if it depends by the settings in the file 'CIV4UnitInfos.xml', in which i have written:


instead of:

(note the commas)


3) The unit has a strange posture in the civilopedia screen (and in the city screen..); moreover the fire of the torch is in a very strange position; compare this picture with the first picture in post #8:




4) The game freezes (not crash!) when my city has completed to building the unit. It can't manage some strange graphic problems.

I don't know if these problems are technical or related to this unit.. I decided to post in this thread first.. I apologize if my questions are more proper in a technical support thread than in a creation/customitation thread..

By the way thanks in advance.
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
 
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

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:
10lire said:
[...]the fire of the torch is in a very strange position[...]
and in the post #39 of this thread:
10lire said:
[...]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[...]

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:
 
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
 
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
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.
 
I gave myself my new unit in world builder and got three red blobs. they fight ok though, no errors occured. :crazyeye:
 
Never mind I didn't completely change everything.:blush: Thanks for the guide!
 
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?
 
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?
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.
 
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.
 
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!
 
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!
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.
 
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).
 
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.
 
@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. :)
 
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.
 
@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.
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.
 
Back
Top Bottom