What is the best way to add information to a building's description text?

Galgus

Emperor
Joined
Aug 22, 2012
Messages
1,705
In a mod I've been working on several buildings have bonus yields from virtue kickers as well as normal yields and quest bonuses, and I'm not sure how to display all of this.

Currently everything works, but the virtue kicker bonuses are not displayed at all.

I was thinking of giving the buildings Help text, but I'm worried that it would not work alongside the quest yield changes.

Is Help text the answer to this, and if so what do I put in it?

Does Help text fully replace the normal description, or do I only input that which it does not display?
 
Help text is displayed in addition to all the normal info in the tooltip, as a line of text below the yields. E.g. the Trade Depot's help text says "Allows Trade Routes to be established from this City and provides 1 free Trade Route slot."

Short of writing an edited version of InfoTooltipInclude.lua, there is no way I know of to replace the auto-calculated yields in a building tooltip, but you could add a help text saying something like "will yield an extra 1 Energy if you have Virtue X".
 
Yeah, easiest way is to edit the Help-Text. It's also the method that has the greatest compatibility with other mods (aside from Mods that edit the Help-Texts as well), as only one mod at a time can replace InfoTooltipInclude.lua - I'd argue that that option is best left to interface mods unless you are working on a mod that is going to support only limited or no compatibility at all with other mods anyway. However, Help-Texts are static, so that's the one problem I see.

Another (and in my opinion the best) alternative would be to use Machiavelli's Policies grant perks & buildings-Mod (or just manually adding perks yourself) and instead of using the direct method of adding yields just granting a Perk that then adds yields to the buildings you want. This indirect method does correctly show and update the yields in the building tooltips without having to rely on "if X then Y"-texts in the help-tag.
 
I'll use that method then, though I may also add Help text so players can see how it works and what the count is currently.

Thanks for the help, both of you.
 
Yeah, easiest way is to edit the Help-Text. It's also the method that has the greatest compatibility with other mods (aside from Mods that edit the Help-Texts as well), as only one mod at a time can replace InfoTooltipInclude.lua - I'd argue that that option is best left to interface mods unless you are working on a mod that is going to support only limited or no compatibility at all with other mods anyway. However, Help-Texts are static, so that's the one problem I see.

Another (and in my opinion the best) alternative would be to use Machiavelli's Policies grant perks & buildings-Mod (or just manually adding perks yourself) and instead of using the direct method of adding yields just granting a Perk that then adds yields to the buildings you want. This indirect method does correctly show and update the yields in the building tooltips without having to rely on "if X then Y"-texts in the help-tag.

Actually I have one more question: how do you add help text to an existing building?

The game seems to have a quirk where it only displays one affinity requirement for buildings that have more than one, and it seems like a way to remedy it.

Not really necessary in the context of the mod since the requirement that does show and the description makes the other requirement obvious, but it would be more ideal if everything displayed correctly.
 
Code:
<GameData>
	<Buildings>
		<Update>
			<Where Type="BUILDING_RELIC"/>
			<Set Help="Limited: 1"/>
		</Update>
	</Buildings>
<GameData>
 
Is the "Limited: 1" bit the part to replace with whatever help text is desired?
 
Yep. You can of course enter a TXT_KEY instead of plain text if you want to do it properly.
 
Do you know where I should look to find the color they use in the affinity text?

To make the affinity requirement text fit in I need it to have the proper colors.

I know how to color text on a basic level, but I don't know those specific commands.
 
Colors are defined in:
Sid Meier's Civilization Beyond Earth\assets\DLC\Expansion1\Gameplay\XML\Interface\CivBEColors.xml

COLOR_PURITY_AFFINITY
COLOR_SUPREMACY_AFFINITY
COLOR_HARMONY_AFFINITY
 
Back
Top Bottom