Quick Modding Questions Thread

How do I make a modifier that gives +2 oil for every oil resource? I tried to find out by following england's trait but I can't find out anymore past what their trait is called in game
Try the effect EFFECT_ADJUST_CITY_EXTRA_ACCUMULATION_SPECIFIC_RESOURCE.
Its arguments are ResourceType and Amount.
 
I'm trying to modify the Governors, but for some reason I can't seem to change the text of their abilities at all. I can change text for a lot of different things and know how to add text for new things, so I am assuming Governors read text from a different location than usual. Anyone know where that would be?
 
I'm trying to modify the Governors, but for some reason I can't seem to change the text of their abilities at all. I can change text for a lot of different things and know how to add text for new things, so I am assuming Governors read text from a different location than usual. Anyone know where that would be?

You mean the file? It's Expansion1_InGameText.xml under DLC\Expansion1\Text\en_US
(or Expansion2\Text\en_US if you have GS)
 
UpdateText Action-Types accept LoadOrder specification, and as far as any testing I have ever done they also properly implement the LoadOrder settting for the action.

It is quite possible that the changes you are making to the Governor Texts are being implemented by your mod and then over-written when Gathering Storm loads. Or else your changes are not being implemented at all if you are using an Update command because at the time the Update executes the text LOC_SOMETHING for the various Governors haven't yet been added to the localization Database. Updates that are attempting to alter something that has not yet been added to a database do not generate errors in any log, nor cause errors in game execution, they just have no effect because there is no "match" to the "Where" clause of the Update at the instant the Update is applied.
 
You mean the file? It's Expansion1_InGameText.xml under DLC\Expansion1\Text\en_US
(or Expansion2\Text\en_US if you have GS)

Yeah, that's where I'm looking. Thanks for the answer though!

UpdateText Action-Types accept LoadOrder specification, and as far as any testing I have ever done they also properly implement the LoadOrder settting for the action.

It is quite possible that the changes you are making to the Governor Texts are being implemented by your mod and then over-written when Gathering Storm loads. Or else your changes are not being implemented at all if you are using an Update command because at the time the Update executes the text LOC_SOMETHING for the various Governors haven't yet been added to the localization Database. Updates that are attempting to alter something that has not yet been added to a database do not generate errors in any log, nor cause errors in game execution, they just have no effect because there is no "match" to the "Where" clause of the Update at the instant the Update is applied.

Aha! Yes I forgot to include dependency on Gathering Storm in this one, so it is probably being overwritten (or never applied) by GS loading *after* my mod. Thanks! If this doesn't solve it I'll be back =)
 
Nope, that didn't do it either. Some of the text I've changed has worked, so it isn't like the whole file is borked. I've added dependencies to Gathering Storm and Rise & Fall and neither helped. The file is being loaded as an InGame Action, so it should definitely be loaded after everything else, and this is the only mod I have running.

None of my changes to Governor text are working (not in the Civilopedia, on the Governor screen, or on the promotion selection screen). I've also got changes to the following improvements:

  • (working) Fort: LOC_IMPROVEMENT_FORT_DESCRIPTION
  • (working) Roman Fort: LOC_IMPROVEMENT_ROMAN_FORT_DESCRIPTION
  • (not working) Great Wall: LOC_IMPROVEMENT_GREAT_WALL_EXPANSION2_DESCRIPTION (but this is the correct localized text, as it gets loaded in the game with the "cannot be destroyed by natural disasters" part they added in GS)
  • (not working) Granada and Alcazar: LOC_LEADER_TRAIT_GRANADA_EXPANSION2_DESCRIPTION and LOC_IMPROVEMENT_ALCAZAR_EXPANSION2_DESCRIPTION (not even getting loaded unmodded, as the 50% science from appeal isn't in the text)
  • (not working) Pa: LOC_IMPROVEMENT_MAORI_PA_DESCRIPTION
Is the problem that not all of these are in <LocalizedText> ? Doesn't the <EnglishText> get loaded in to be the <LocalizedText> or something (since I'm working in English)?
 
If your action has no LoadOrder setting then there is no guaranteed relationship as to when your code will load relative to other code. All a dependancy does is require that the DLC (or other mod) is enabled but does not in and of itself force Load Order.

Even though I have a Dependancy to another mod of mine whose code I am re-writing I still need load order settings to ensure the relative order in which the various actions actually implement their code
Code:
  <Dependencies>
    <Mod id="46f68baa-7457-4c80-b88d-53da67a4b38d" title="LeeS' Buildings Are Fun" />
  </Dependencies>
  <InGameActions>
    <UpdateDatabase id="UpdateBAF_Buildings">
      <Properties>
        <LoadOrder>150</LoadOrder>
      </Properties>
      <File priority="23">XML/BuildingAdjustments.xml</File>
    </UpdateDatabase>
    <UpdateText id="TextUpdates">
      <Properties>
        <LoadOrder>150</LoadOrder>
      </Properties>
      <File>XML/TextUpdates.xml</File>
    </UpdateText>
  </InGameActions>
  <Files>
    <File>XML/BuildingAdjustments.xml</File>
    <File>XML/TextUpdates.xml</File>
  </Files>
A LoadOrder setting of about "150" should ensure that your text update Action loads after any being done by Gathering Storm or Rise and Fall.

But there are still wierd issues with regard to updating tag-keys that stem from the game's <BaseGameText> "table": these are all rolled into <LocalizedText> with a Language="en_US" value as part of a "post-processing" series of SQL commands. This might also be your problem. The work-around is to redirect entirely the "Tag" name that a game-element is pointed towards. For example:
Code:
<GameData>
	<Buildings>
		<Update>
			<Where BuildingType="BUILDING_NATIONAL_MILITARY_ACADEMY_LRS" />
			<Set Name="LOC_CHEESEBURGER_FACTORY" />
		</Update>
	</Buildings>
</GameData>
 
^This solved my text issue, thanks! However, now I have a question that it more involved relating to governors. Promotions seem to be assigned a Column and Level, which I imagine determines their placement in the UI. However, changing these values seems to do nothing. For example:

Code:
    <GovernorPromotions>
        <Update>
            <Where GovernorPromotionType="GOVERNOR_PROMOTION_PARKS_RECREATION"/>
            <Set Level="2"/>
        </Update>
        <Update>
            <Where GovernorPromotionType="GOVERNOR_PROMOTION_PARKS_RECREATION"/>
            <Set Column="2"/>
        </Update>
    </GovernorPromotions>
    <GovernorPromotionPrereqs>
        <Delete GovernorPromotionType="GOVERNOR_PROMOTION_PARKS_RECREATION"/>
        <Row GovernorPromotionType="GOVERNOR_PROMOTION_PARKS_RECREATION" PrereqGovernorPromotion="GOVERNOR_PROMOTION_AQUACULTURE"/>
    </GovernorPromotionPrereqs>

should, I assume, move Parks and Recreation to the Water Works slot for Liang. When I do the same type of code to also move Water Works to the Parks and Recreation slot, nothing happens. In fact, more than nothing happens, because something is getting messed up. It also stops my edits to the Water Works and Parks and Recreation promotion texts from being displayed, though all other promotion text edits I've made are working.

Any idea how to make this work, or should I just swap all of the contents of each promotion, change their names and descriptions, and call it a day?
 
I can only guess. Maybe there's already a promotion in slot (2,2)? Maybe there are two promotions in other slot in level 2, so a third promotion cannot be added? Maybe level 3 cannot be empty? If all of those are wrong, probably the promotions are hard-coded in some way, so they cannot be moved.
 
Maybe there's already a promotion in slot (2,2)?
There is, but I've swapped that one to be in this one's slot.

Maybe there are two promotions in other slot in level 2, so a third promotion cannot be added?
Not the case, but good idea.
Maybe level 3 cannot be empty?
I swap the other promotion into level 3 in some code I did not post.

If all of those are wrong, probably the promotions are hard-coded in some way, so they cannot be moved.
This is what I assumed, but then why go through the effort of reading in any info from these xml tables at all? They bothered to make the tables, they must be editable somehow...
 
As I mentioned on that thread an ImprovementModifier is needed.

I don't happen to have an example on hand, though, of how the modifier would need to be structured. Well, I do now because I Frankensteined some code together from modifiers I had in some of my personal mods.

The ModifierType would need to be MODIFIER_SINGLE_PLOT_ADJUST_PLOT_YIELDS I would think.

Untested but I would think this should do:
Code:
<GameData>
	<Modifiers>
		<Row>
			<ModifierId>FARM_WHEAT_PRODUCTION_EXAMPLE</ModifierId>
			<ModifierType>MODIFIER_SINGLE_PLOT_ADJUST_PLOT_YIELDS</ModifierType>
			<SubjectRequirementSetId>RESOURCE_IS_WHEAT_EXAMPLE</SubjectRequirementSetId>
		</Row>
	</Modifiers>
	<ModifierArguments>
		<Row>
			<ModifierId>FARM_WHEAT_PRODUCTION_EXAMPLE</ModifierId>
			<Name>YieldType</Name>
			<Value>YIELD_PRODUCTION</Value>
		</Row>
		<Row>
			<ModifierId>FARM_WHEAT_PRODUCTION_EXAMPLE</ModifierId>
			<Name>Amount</Name>
			<Value>1</Value>
		</Row>
	</ModifierArguments>
	<Requirements>
		<Row>
			<RequirementId>REQUIRES_WHEAT_IN_PLOT_EXAMPLE</RequirementId>
			<RequirementType>REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES</RequirementType>
		</Row>
	</Requirements>
	<RequirementArguments>
		<Row>
			<RequirementId>REQUIRES_WHEAT_IN_PLOT_EXAMPLE</RequirementId>
			<Name>ResourceType</Name>
			<Value>RESOURCE_WHEAT</Value>
		</Row>
	</RequirementArguments>
	<RequirementSets>
		<Row>
			<RequirementSetId>RESOURCE_IS_WHEAT_EXAMPLE</RequirementSetId>
			<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
		</Row>
	</RequirementSets>
	<RequirementSetRequirements>
		<Row>
			<RequirementSetId>RESOURCE_IS_WHEAT_EXAMPLE</RequirementSetId>
			<RequirementId>REQUIRES_WHEAT_IN_PLOT_EXAMPLE</RequirementId>
		</Row>
	</RequirementSetRequirements>
	<ImprovementModifiers>
		<Row>
			<ImprovementType>IMPROVEMENT_FARM</ImprovementType>
			<ModifierId>FARM_WHEAT_PRODUCTION_EXAMPLE</ModifierId>
		</Row>
	</ImprovementModifiers>
</GameData>
So if you wanted a Farm to add +1 Production to both Wheat and Rice you'd need one modifier for each resource, or you'd have to use the "REQUIREMENTSET_TEST_ANY" and add an additional RequirementId for Rice to the "RESOURCE_IS_WHEAT_EXAMPLE" RequirementSetId. There is probably a simpler way to specify "any" resource for a specified Improvement-Type instead of listing each valid resource for a given improvement, but I haven't looked into that.
 
Last edited:
As I mentioned on that thread an ImprovementModifier is needed.

I don't happen to have an example on hand, though, of how the modifier would need to be structured. Well, I do now because I Frankensteined some code together from modifiers I had in some of my personal mods.

The ModifierType would need to be MODIFIER_SINGLE_PLOT_ADJUST_PLOT_YIELDS I would think.

Untested but I would think this should do:
Code:
<GameData>
    <Modifiers>
        <Row>
            <ModifierId>FARM_WHEAT_PRODUCTION_EXAMPLE</ModifierId>
            <ModifierType>MODIFIER_SINGLE_PLOT_ADJUST_PLOT_YIELDS</ModifierType>
            <SubjectRequirementSetId>RESOURCE_IS_WHEAT_EXAMPLE</SubjectRequirementSetId>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>FARM_WHEAT_PRODUCTION_EXAMPLE</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_PRODUCTION</Value>
        </Row>
        <Row>
            <ModifierId>FARM_WHEAT_PRODUCTION_EXAMPLE</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
    </ModifierArguments>
    <Requirements>
        <Row>
            <RequirementId>REQUIRES_WHEAT_IN_PLOT_EXAMPLE</RequirementId>
            <RequirementType>REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES</RequirementType>
        </Row>
    </Requirements>
    <RequirementArguments>
        <Row>
            <RequirementId>REQUIRES_WHEAT_IN_PLOT_EXAMPLE</RequirementId>
            <Name>ResourceType</Name>
            <Value>RESOURCE_WHEAT</Value>
        </Row>
    </RequirementArguments>
    <RequirementSets>
        <Row>
            <RequirementSetId>RESOURCE_IS_WHEAT_EXAMPLE</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>RESOURCE_IS_WHEAT_EXAMPLE</RequirementSetId>
            <RequirementId>REQUIRES_WHEAT_IN_PLOT_EXAMPLE</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <ImprovementModifiers>
        <Row>
            <ImprovementType>IMPROVEMENT_FARM</ImprovementType>
            <ModifierId>FARM_WHEAT_PRODUCTION_EXAMPLE</ModifierId>
        </Row>
    </ImprovementModifiers>
</GameData>
So if you wanted a Farm to add +1 Production to both Wheat and Rice you'd need one modifier for each resource, or you'd have to use the "REQUIREMENTSET_TEST_ANY" and add an additional RequirementId for Rice to the "RESOURCE_IS_WHEAT_EXAMPLE" RequirementSetId. There is probably a simpler way to specify "any" resource for a specified Improvement-Type instead of listing each valid resource for a given improvement, but I haven't looked into that.
Just a quick question. What is the difference between "REQUIREMENTSET_TEST_ANY" and "REQUIREMENTSET_TEST_ALL"?
 
If there are two or more different Requirements added to a single Requirement Set, then REQUIREMENTSET_TEST_ALL means that the conditions of all of those Requirements must be met. REQUIREMENTSET_TEST_ANY means that only the conditions for one of the Requirements added to a single Requirement Set need to be met.

So if a Requirement for Wheat and a second Requirement for Rice being on the plot are added to the example Requirement Set, REQUIREMENTSET_TEST_ANY will implement in both types of Plot Resources, whereas REQUIREMENTSET_TEST_ALL would not under any circumstances implement the effect because no plot can have both Wheat and Rice on it.
 
Does anyone know if there is a document somewhere that explains what each of the Global Parameters do? I'm trying to change some of them but I can't always notice a change...
 
Not as yet.

I assume some are like some of the <Defines> were for Civ5 -- only read-in by the game when a new game was started and afterwards not alterable for that play-through / series of saved games. And as in Civ5, some of the global parameters are calculation exponent settings, so are not always easily apparent that they were changed.

There may be some global parameters that only do anything when playing Vanilla, for example, but no longer have any effect when playing RaF or GS.
 
I'm trying to use the World Builder for VI. My game starts and when I view the Great People panel it says that all of the Great People "have already been earned".

I can't earn any Great People (for example, building Stonehenge doesn't result in a Great Prophet unit being created)

How do I fix this?

Thanks!!
 
Are you going to the Advanced Start Menu when you start a game using the map ?

In Vanilla it was necessary to set the World Size in the Advanced Start Menu even though it seemed logical the game should have "understood" the size of the map based on its actual grid-size. I haven't used a custom-made WorldBuilder map in RaF and GS so I am not sure if this is the issue anymore -- but when I used premade Worldbuilder maps and made this selection in the Advanced Start Menu I never had the Great People problem other people often had.
 
Is there a simple way to force each civ to use city names in the order they appear in whatever magical file they draw them from, rather than randomly assigning a name from the list when a new city is founded?
 
Does anyone know what this attribute in GlobalParameters does?
Code:
COMBAT_CITY_RANGED_DAMAGE_THRESHOLD
It's defined with value 50, but I haven't been able to discern what it does.
 
Back
Top Bottom