Quick Modding Questions Thread

Okay so what I did was working from stolenrays atomic bomb modcomp (see clanky4's link above). You basically want to merge everything from in there:
- copy all the unit art and art defines XML
- copy the unit XML or make up your own if you want. The important part is for the animation to work, bSuicide needs to be 0 and iAirCombat needs to be any non-zero value (-1 unless you also want the unit to do air combat).
- copy the two new effect entries in CIV4EffectInfos.xml (EFFECT_JETFIGHTER_NUKE and EFFECT_JETFIGHTER_NUKE_EXPLODE) or if your mod does not otherwise add its own effects so far, outright copy the entire file.
- merge in the DLL changes included in the CvUnit.cpp file (search for "Dale" to find them). The crucial part here is what comes after the "// nuke entity mission" comment, i.e. the special case for a unit with non-zero air combat strength. You can merge in the others too if you want.

Against my initial assumptions, this only works if you recompile the DLL with these changes. I assume the animations are tied to the bombard air mission for the nuclear bomber unit art, so you need to change the code so that mission is triggered when you order a nuke strike.

I didn't need to do anything else with these effects, I guess they are already referenced by the unit animations in some arcane way. The trick was to trigger the correct mission they are associated with.
 
Okay, thanks. I don't think it's XML, but then again I don't think it's the dds... :wallbash: But yeah i'll definitely try switching them out :)

EDIT: I just tried what you said, (switching out the .dds) and the icon in-game wasn't small. So it's definitely the dds.

I'm wondering if anyone could help me? I'm attaching the dds (in a zip) and if anyone could find out the problem, i'd be much obliged :lol:

Thanks!

EDIT 2: I have compared my dds to others, and I see no difference (i also compared the alpha channel) but I have no idea why mine is different. Please help me! :wallbash:
Since your file is 6kb large instead of the usual 5kb, my guess would be that you saved the button with MIP maps (which are basically lower-pixel versions of the images). In Civ4, these are useful for textures, but not for buttons. Maybe check if dxtbmp has a "No MIP maps" option or something like that.
 
Question.
You know how apperance of a Farm changes from ancient to medieval to modern as you progress?
Or Mine for example?
I can see where actual files are stored, but I can't seem to find xml reference of how it is controlled?
Where do I tell the game when to switch from one art file to another?

I want to make Workshop to progress in similar way so I need to know how farm progression works.

Thank You!
 
Hello,

For my scenario/mod WW II December 1941 https://forums.civfanatics.com/resources/ww-ii-december-1941.23250/ i was adding resources. But at a certain point my graphics were suddenly messed up. Unhealthy icon apearing next to unit strenght for example and many other things like that. After a long search i found out it was the last added resource. If i deleted it everything turned normal. It wasn't anything with the art file. I did tests with proven resources. My guess is that the list is simply full displayed in civilopedia. It can display 48. The 49th gives trouble.
Anybody have an idea how to add more resources?
 
Most likely you messed up your Assets/Res/Fonts/GameFont.tga file (both of them). They need to match the xml layout (unless you mod the DLL to do otherwise). It use padding, meaning you can experience being able to add more stuff just fine and then suddenly it overflows from the padding and change the offset of the rest of the file. The symbols (like unit strength) are the last, meaning they break if the DLL and the file disagrees on indexes.

I highly recommend using GameFontEditor if you need to modify this file, though to my knowledge it can't actually add more blocks, meaning you might be forced to use something else to do that.
 
How do I mod resources? like let's say I want the gold resource to give me 20+ gold a turn, how do I do that?

Or the Hamlet, to have it give me 5+ a turn
 
Unmined gold? You can edit the base yields of resources in Assets/XML/Terrain/CIV4BonusInfos.xml.

Hamlet and all other improvements can be changed in Assets/XML/Terrain/CIV4ImprovementInfos.xml.
 
Unmined gold? You can edit the base yields of resources in Assets/XML/Terrain/CIV4BonusInfos.xml.

Hamlet and all other improvements can be changed in Assets/XML/Terrain/CIV4ImprovementInfos.xml.

Yes, and I actually figured out how, but... it's not working... I was hoping to see my + per turn go up or something.. I even built a mine on the Gold too.

Any suggestions?
 
Most likely you messed up your Assets/Res/Fonts/GameFont.tga file (both of them). They need to match the xml layout (unless you mod the DLL to do otherwise). It use padding, meaning you can experience being able to add more stuff just fine and then suddenly it overflows from the padding and change the offset of the rest of the file. The symbols (like unit strength) are the last, meaning they break if the DLL and the file disagrees on indexes.

I highly recommend using GameFontEditor if you need to modify this file, though to my knowledge it can't actually add more blocks, meaning you might be forced to use something else to do that.
Thank you Nightinggale, your reply sounds logic, i think that's what happened, altough i don't know what to with that info. I've looked at the file with the gamefonteditor but i really don't know what to do with it. But thank you for the quick reply!!:thumbsup:
 
is your city actually WORKING the mine?
Also keep in mind that all improvements produce COMMERCE and not gold, use the slider setting to determine how much commerce actually becomes gold.

Does this mean if a city produces gold that it will convert said commerce to gold if worked? so cities next to mines in my mod will be amazingly rich?

provided they work the slot*
 
Last edited:
Thank you Nightinggale, your reply sounds logic, i think that's what happened, altough i don't know what to with that info. I've looked at the file with the gamefonteditor but i really don't know what to do with it. But thank you for the quick reply!!:thumbsup:
When you add or remove anything, which has a char in GameFont, then you should use GameFontEditor to change the icons accordingly to make them appear in the same order. This means when you add resources to the end of the xml file, you find the location of the last resource with GameFontEditor and then you add icons to the right. Do note that it can import image files and that you can copy paste.

If you run out of blocks, then you need to close GameFontEditor and open with something, which supports editng tga files and preserves the alpha channel. Then copy a row of blocks and paste them to the right where you ran out, save and then open in GameFontEditor to continue editing. It's likely a good idea to add one "padding block" at a time, which I remember as being 16. This also matches 48 because 3*16 = 48.

Question to everybody: what is the easiest to use graphic editor in windows, which can be used to add blocks in GameFont?
 
Does this mean if a city produces gold that it will convert said commerce to gold if worked? so cities next to mines in my mod will be amazingly rich?

provided they work the slot*


Assuming that you have a city of population of 1. You go into the city and click and assign it to work the MINE tile.
Now your city producing whatever the mine is producing.
Now assuming your city has no +Gold % bonuses, set your Science/Gold slider to 100% Gold - you now will be converting 100% of your Commerce into Gold, which will be from Mine + City own Tile + Palace(if its the capital)
 
I want to try to swap out a unit's preset shield art (specifically a Heavy Swordsman/Crusader with a cross on it) with the shield that shows its owner's civ sigil (from a King unit I found here some time ago). It appears this is a matter of editing the relevant _Weapons_64.dds files, but my experience with DDSes is limited to buttons, and I have this feeling I'll screw it up.

Can anybody point me to the best tutorial for this? I don't seem to know the right terms to find it via Google. Or, if this is simpler than I think, you could explain it instead :D
 
I want to try to swap out a unit's preset shield art (specifically a Heavy Swordsman/Crusader with a cross on it) with the shield that shows its owner's civ sigil (from a King unit I found here some time ago). It appears this is a matter of editing the relevant _Weapons_64.dds files, but my experience with DDSes is limited to buttons, and I have this feeling I'll screw it up.

Can anybody point me to the best tutorial for this? I don't seem to know the right terms to find it via Google. Or, if this is simpler than I think, you could explain it instead :D
Looks like this tutorial might help.
 
Top Bottom