Quick Modding Questions Thread

@isenchine
My corporations is showing correct, you can download RECONSTRUCTION from here and you will see that tga are same in that version and in this new (in new i just add several new bonuses and change number of bonuses for corporations)
I fix iTGAIndex and now CORP_1 start with iTGAIndex=0 and etc.

AND IT'S WORK !!! Thank you @isenchine and @Nightinggale
the problem was because my iTGAIndex start from 8th corporation, not from first.

Please see image:
Spoiler :

29KfHUf.jpg

 
I forget to ask, how many bonuses i can add in my mod ?
Current is 72 bonuses in mod.
Not counting issues with getChar(), the hard limit is 32k (16 bit signed int). Since the char needs to fit in 16 bit as well, the limit is more like 23k. However odds are that you would need to mod CvGameTextMgr::assignFontIds() to store bonuses after symbols if you want to go into extremes like that.

I don't know of any limitations with an unmodded dll. The dll itself has no real limitations other than what I mentioned, but the display code is in the exe and particularly the billboard code could act funny if pushed too far.

My guess is that you shouldn't worry about limits and just add. As long as xml and the tgas match, it should be ok in any non-extreme case. If not, then I expect to hear from you :lol:

Generally speaking, I believe the performance issue regarding looping the info arrays to be the biggest concern with way too big xml files. That and the memory used to store graphics for all those info classes.
 
Not counting issues with getChar(), the hard limit is 32k (16 bit signed int). Since the char needs to fit in 16 bit as well, the limit is more like 23k. However odds are that you would need to mod CvGameTextMgr::assignFontIds() to store bonuses after symbols if you want to go into extremes like that.

I don't know of any limitations with an unmodded dll. The dll itself has no real limitations other than what I mentioned, but the display code is in the exe and particularly the billboard code could act funny if pushed too far.

My guess is that you shouldn't worry about limits and just add. As long as xml and the tgas match, it should be ok in any non-extreme case. If not, then I expect to hear from you :lol:

Generally speaking, I believe the performance issue regarding looping the info arrays to be the biggest concern with way too big xml files. That and the memory used to store graphics for all those info classes.

Thank you again ! :)
 
I don't know about limits but there are definitely some quirks when altering the Gamefont files without a modded DLL. The main issue is that the way Python and the DLL reads the index seems to be different. I haven't worked out the exact pattern but adding any old number of new items will often cause the citybar icons to be offset, like Zlatko experienced. You have to experiment a bit to get the right number of items, especially if you've added or extended rows.

For example, my mod has 18 religions and 14 corporations, but I had to add an extra 3 'placeholder' corporations to avoid any index offsets. I recently went to add 3 new resources to my mod, but found I needed to add a 4th as well to get everything to line up.

Bit of trial and error but Asaf's Gamefont Editor makes it so much quicker and easier.
 
I don't know of any limitations with an unmodded dll. The dll itself has no real limitations other than what I mentioned, but the display code is in the exe and particularly the billboard code could act funny if pushed too far.

The limit in the unmodded dll is 74 resources. Go over that and it messes up all the other icons and can effect the text as well.

I also recommend the great benefits of using Asaf's Gamefont Editor
 
Just in case others are following this ... I once isolated the dll changes to use expanded gamefont files and uploaded them here. None of the original work is mine, I just extracted them, but they may be useful to someone.
 
I forget to ask, how many bonuses i can add in my mod ?
Current is 72 bonuses in mod.

Looking at your tga files, you already have 92 pre-placed bonuses. Knowing that the WoC component is in use in several Mods since years, it is safe to assume that it is coded so that you can use all of them without problems and this without touching the tga files. Beyond that, as Xyth said, it is a question of experimentation.

As everyone else, I can only recommend Asaf's tool if you ever want to change the tga files. Before, it was a nightmare to deal with them. Now, it is easy, particularly if you open two instances of the tool and just copy/paste from one to the other.

Two more things:
1) you can safely put your weapons back to index 75
2) as the bonuses are placed last in the tga files, they won't mess up the other stuff.
 
@ALL
Thank you again.
For now i don't plan to touch any tga, i think on adding new icons for bonuses, for now i will use existing from my tga, example BONUS_LATINUM which represent BONUS_GOLD on another planet will have font index for gold and that is <FontButtonIndex>23</FontButtonIndex>.
I have to make 3 - 5 new planets, and i must add about 23 bonuses per planet, between 69 and 115 bonuses (total), and for now i will add font index like for BONUS_LATINUM, but one day if i want to add new 115 bonuses in tga files, that will be an interesting story.
 
1. How do I alter the civics of K-mod? The rules here don't seem to apply; there is no CIV4GameTextInfos_Objects.xml as far as I can see.

2. How do I change the images of techs/civics? I want to take some from another mod.
 
Civics are found under xml/civilizations/civicinfos.xml

I can't remember what the text file is called, but if you do a find in files in notepad++ of the kmod text folder for TEXT_KEY_CIVIC you should find them easy enough.

to change a button, you need to change the button tag path in the tech or civic entry.
 
Civics are found under xml/civilizations/civicinfos.xml

I can't remember what the text file is called, but if you do a find in files in notepad++ of the kmod text folder for TEXT_KEY_CIVIC you should find them easy enough.

You mean in xml/GameInfo, not civilizations, because that's where it was (civilizations doesn't exist). I get error messages telling me that the file is incorrect, so I assume there's something else I need to edit.

to change a button, you need to change the button tag path in the tech or civic entry.

What if I don't have the graphic? How do I transfer a graphic from a mod?
 
You mean in xml/GameInfo, not civilizations, because that's where it was (civilizations doesn't exist). I get error messages telling me that the file is incorrect, so I assume there's something else I need to edit.



What if I don't have the graphic? How do I transfer a graphic from a mod?

If you are adding a civic group then you also need to edit CIV4CivicOptionInfos.XML

You just copy the graphic into your mod. If the graphic is in FPK files you will need PakBuild to extract the files into a folder somewhere and then copy them. Warning PakBuild says it has finished way before it actually has.
 
Thanks for the answers. EDIT: Never mind, I asked a dumb question that was in the official modding guide.

What determines the order civics are listed in? I want to put caste system above serfdom.
 
You need to change the description. The description is a TXT_KEY, which mean you have to find the Text xml file with the key in question. Notepad++ can help search multiple files. Remember that the vanilla files are used if there isn't a file with the same name in the mod, which can be annoying when searching for a specific string.

Note: I have seen people writing the name directly in description and avoid the Text xml. It works, but it makes the mod impossible to translate, which is why I can't recommend it. Even mods you don't plan to translate might be translated by other people in the future.
 
Three more questions that have cropped up while working:

1. How do you get a general percentage penalty/boost for all cities? I know this has been done, but I don't see how.

2. How do you get multiple prereq technologies for a civic? Is it even possible?

3. Suppose I wanted a civic to boost production in the capital by 50%, but decrease it in all other cities by 25%. I don't think there's an option for "every city besides the capital;" just all cities. So should I raise production in the capital by 75%, to cancel it out? How are the numbers calculated?
 
Isn't question one answered by question three?

Question two; impossible, unless K-Mod added this in.

Question three; I think so, but I'm unsure how conclusive the experiments I did were.

This would, if correctly, lead to +20% culture in the capital, and -10% culture in all cities. A similar thing can be done with (Capital)YieldModifiers.
 
Back
Top Bottom