I'm adding new produced bonus - but something is still missing

TheBirdMan

King
Joined
Jun 5, 2018
Messages
853
Location
Northwest Zealand, Denmark
And it's the part how to add the very small icons and give it the correct number.....

See I have this:

Spoiler Present :

1734243991395.png

1734244150669.png


As you might see, I have added "Flour" size 16*16px (changed from a bmp-screenshot, changed and saved as 64*64px using Gimp, later downscaled to 16x16px).
I have given it FontButtonIndexnumber <FontButtonIndex>451</FontButtonIndex>. Highest number used sofar is <FontButtonIndex>349</FontButtonIndex> used for Glassware - but I can see 50 more, which I do not know anything about.......

But how do I find/know/decide what the correct number for my Flour should be and/or where the 16*16px small icon should be placed? And what-else do I miss (there must be more)????
 
Last edited:
This is how I see the bonus (and building) now:

Spoiler Screenshots :

1734244932280.png

1734244868358.png


The Quern stone icon is borrowed from the mod CoM, the Bakery icon is most likely something you have added in the comming release (breadmaking.dds).
 
Told you the file is cursed. Basically, what you should do is add to it in the exact same order as you mention the resources in XML and pray everything goes ok, because the file is as easy to break as having one pixel not the exactly right colour. The small icon should be placed in the same place as large (mine all are in Interface/Buttons/Worldbuilder), and if your icon is called "aaa.dds", it should be called "aaa_x64.dds"
 
Thanks Walter. Found the place (using the unpacked comming version to see the exact file-structure). I'll use your way of naming - and do my best.
 
Seems like it is working - but not 100%. Not yet.

Spoiler bakery :

1734259389323.png


Now I have some small icons on the Bakery-buildingscreen - looks like it's the _x64 icons. Much better than before..... Next step wil be to add the 2 Icons I have ready to the TGA-file - and then see what happens next........
 
This Game Font Editor turned out to be quite "user friendly" - although I had some trouble at first figuring out how it actually works......
Spoiler GameFont_75.tga :

1734409726155.png


Last used values that I can "find" both in the file CIV4ArtDefines_Bonus.xml and on above is Glassware ( <FontButtonIndex>349</FontButtonIndex> ). Then we have 50 other icons that I don't know what are used for. I have therefore chosen to start with Beer ( value <FontButtonIndex>399</FontButtonIndex> ) and end with Flour ( <FontButtonIndex>402</FontButtonIndex> ) for the 3 new bonuses (I hope) I have ready.

Apart from the above, I'm quite unsure what the second file (GameFont.tga) will be used for - if it is used at all. It mostly looks like a rather unfinished and messy early version (but I could be wrong - that it is actually still used somewhere).
Spoiler GameFont.tga :

1734410604664.png

 
Afterwards, I'll just post what I have until now. Answers/hints are probably not that important right now, as I have read that the new version 3.7 is pre-released - if this is in a packed version, I'm sure I will not have time to work more on this for the next 6-8 weeks or more.......

Spoiler Bonuses :

Civ4ScreenShot0047.JPG

Civ4ScreenShot0048.JPG


I guess it's not all bad.
Spoiler Buildings :

Civ4ScreenShot0049.JPG

Civ4ScreenShot0050.JPG

Civ4ScreenShot0051.JPG


But here it turns out that there is a lack of connection between my bonus.dds and the file GameFont_75.tga. Possibly something with the numbering - I don't know yet.

In addition, there is something about the buildings. If I "borrow" a copy of an existing building (borrowed from the SVN unpacked version of RI 3.7 OR the packed version of RI 3.61) , it seems to work. But if I do the same with a building from e.g. CoM - then something is missing. Well, I'll have to look into that later - but good advice is greatly appreciated.
Spoiler Timber Yard :

Civ4ScreenShot0052.JPG


P.s.: I do know how to make the palisade larger - no problem here.
P.p.s.: I do not hope I have to "learn" something about Nif's too. In that case I think I'm going to limit myself and only use buildings from the existing RI-versions.
 
Last edited:
Time to take this up again.

I do just not understand the numbering of the bonuses. Take Glassware. It has this value: <FontButtonIndex>349</FontButtonIndex>. But when you look the GameFont_75.tga file itself - I can't find out where this value comes from.....

Spoiler GameFont_75.tga :

From the CIV4ArtDefinesBonus.xlm:
<BonusArtInfo>
<Type>ART_DEF_BONUS_FABRIC</Type>
<fScale>1.0</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<NIF>Art/Terrain/Resources/Iron/Iron.nif</NIF>
<KFM/>
<Button>Art/Interface/Buttons/WorldBuilder/fabric.dds</Button>
<FontButtonIndex>348</FontButtonIndex>
</BonusArtInfo>
<BonusArtInfo>
<Type>ART_DEF_BONUS_GLASSWARE</Type>
<fScale>1.0</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<NIF>Art/Terrain/Resources/Iron/Iron.nif</NIF>
<KFM/>
<Button>Art/Interface/Buttons/WorldBuilder/glassware.dds</Button>
<FontButtonIndex>349</FontButtonIndex>
</BonusArtInfo>
<!-- Not represented in GameFont files - keep at end -->
<BonusArtInfo>
<Type>ART_DEF_BONUS_OLIVES</Type>
<fScale>0.5</fScale>
<fInterfaceScale>1.6</fInterfaceScale>
<NIF>Art/Terrain/Resources/Olives/olives.nif</NIF>
<KFM/>
<Button>,Art/Interface/Buttons/WorldBuilder/Spices.dds,Art/Interface/Buttons/Warlords_Atlas_1.dds,1,14</Button>
<FontButtonIndex>65</FontButtonIndex>
</BonusArtInfo>

1740215613986.png


I'm surely misunderstanding something - but what?
 
Hmmm, then I just add dds files in the directory .....\assets\res\Fonts in the sizes 256x256, 64x64 and 16x16 - in this case with names like Wood_logs.dds, Wood_logs_x64.dds - and possibly completely un-needed Wood_logs_x16.dds. Then I'll find out the hard way if I still miss something.
 
Only regular and x64 needed, 128x128 and 64x64 respectively. And I guess you can put them in Assets/Res/Fonts if you point there, but normally they're in Assets/Art/Interface/Buttons/Worldbuilder
 
Thanks - then I will choose to have them in the Assets/Art/Interface/Buttons/Worldbuilder lib.
 
Well Walter. Seems like it works (already added to the new ver. 3.72). Now I "just" have to find some better freeware and/or royaltyfree icons and make them fit the existing design (if I'm able to do it - else, as long as it works, then.....).

Spoiler new building and new resource :

Civ4ScreenShot0158.JPG

Re-used the Workshop. A fine building to use as master....
Civ4ScreenShot0159.JPG



Thanks for your help.
 
Now that I also have access to charcoal, I would like if you could give a little advice:

Am I asking for trouble if I try to rename the terrain Bonus_Iron to Bonus_Iron_Ore? Somehow I'm afraid that this could give me some trouble.......

I know I just can make a new produceable bonus and call it Cast_Iron and then rename where its needed as below in the spoiler - but if I could rename the Iron, then that would be my "1st choice"......

Spoiler Forge: Iron to Cast_Iron :

<ConsumesBonuses>
<ConsumesBonus>
<BonusType>BONUS_CHARCOAL</BonusType>
<iBonusAmount>1</iBonusAmount>
</ConsumesBonus>
<ConsumesBonus>
<BonusType>BONUS_IRON</BonusType>
<iBonusAmount>1</iBonusAmount>
</ConsumesBonus>
</ConsumesBonuses>
<ProducesBonuses>
<ProducesBonus>
<BonusType>BONUS_CAST_IRON</BonusType>
<iBonusAmount>1</iBonusAmount>
</ProducesBonus>
</ProducesBonuses>
 
Renaming, as in changing the in-game name, is absolutely harmless, and can be done by changing the relevant TXT_KEY, or pointing to a new one - if what you're asking is whether you could get the current "Iron" resource to be called "Iron Ore" in-game.

If you're asking whether you can rename the tag (change BONUS_IRON to something else), I don't really know why you'd want to do that - the name of the tag has literally zero gameplay relevance. Sure, tags can be called anything (BONUS_IRON, BONUS_XYZ, SILLY_STRING, ASFTALSJFA1234) but changing an existing tag only makes sense in some extreme cases, as it's very tedious - you need to make absolutely sure that it isn't referenced anywhere else in the code (event triggers, units, etc.), and for no real practical result.
 
In-game I guess - but I'm not sure that is enough.....

On the attached screenshot, I have the mouse over an Wheat-bonus tile and the text in the lowerleft corner tells me I have none (0) wheat. What I want is, that if that tile was an Iron tile instead, it would show that the bonus was an Iron_Ore tile and that I would have none (0) Iron_ore. If that's also In-game only, then I think I can do it. Else I take the way I know I'm able to handle (new produceable bonus Iron_Ore).

Spoiler :

Civ4ScreenShot0166.JPG

 
Yes, you simply want to rename how the resource is called in-game. This is specified by TXT_KEY entries. All new TXT_KEY entries are kept in Assets/XML/Text (the actual file there is irrelevant, but I try to keep at least some vague order). Vanilla entries (such as "Iron" in your case) aren't in RI /Text folder as the game checks vanilla folders too, so no need to duplicate - but if you create a new TXT_KEY_BONUS_IRON entry there, it will override the vanilla (as vanilla entries are read first). BTW, from your screenshots, you should probably create TXT_KEY entries for all the new resources you've added too ;)

Alternatively, you can create a new TXT_KEY there (say, TXT_KEY_BONUS_IRON_ORE), and change the <Description> in BONUS_IRON to point to it instead. Again, whatever you do there, it's all pretty harmless as it only influences the in-game text.
 
Back
Top Bottom