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

Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,953
    Gender:
    Male
    Location:
    House of Hades
    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.
     
  2. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    thank you! I will try to put that into good use ;)
     
    Leoreth likes this.
  3. SaibotLieh

    SaibotLieh Emperor

    Joined:
    Sep 25, 2009
    Messages:
    1,524
    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.
     
  4. MoltenMan

    MoltenMan Chieftain

    Joined:
    May 12, 2017
    Messages:
    11
    Gender:
    Male
    Thanks! That was it!
     
  5. SaibotLieh

    SaibotLieh Emperor

    Joined:
    Sep 25, 2009
    Messages:
    1,524
  6. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    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!
     
  7. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,884
    Location:
    The city of the original vlaai
    PlotLSystem.xml

    Search for the improvements and look at the <Attribute Class="Era"> tag. An ! means excluding that era.
     
  8. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    thank you so much! I will try digging into it ;) That file is a nightmare ;)
     
    Leoreth likes this.
  9. skyfire

    skyfire Prince

    Joined:
    Jan 25, 2009
    Messages:
    313
    Location:
    Leeuwarden, Holland
    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?
     
  10. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,561
    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.
     
  11. Elite

    Elite Comrade

    Joined:
    Aug 10, 2006
    Messages:
    423
    Location:
    somewhere
    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
     
  12. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,953
    Gender:
    Male
    Location:
    House of Hades
    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.
     
  13. Elite

    Elite Comrade

    Joined:
    Aug 10, 2006
    Messages:
    423
    Location:
    somewhere
    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?
     
  14. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    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.
     
  15. skyfire

    skyfire Prince

    Joined:
    Jan 25, 2009
    Messages:
    313
    Location:
    Leeuwarden, Holland
    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:
     
  16. Elite

    Elite Comrade

    Joined:
    Aug 10, 2006
    Messages:
    423
    Location:
    somewhere
    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: Jun 14, 2017
  17. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,561
    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?
     
    skyfire likes this.
  18. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608

    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)
     
  19. Herostratus

    Herostratus Grim Harbinger of Things to Come

    Joined:
    Jul 24, 2009
    Messages:
    116
    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
     
  20. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,953
    Gender:
    Male
    Location:
    House of Hades
    Looks like this tutorial might help.
     

Share This Page