• Civilization 7 has been announced. For more info please check the forum here .

Quick Modding Questions Thread

I think you have to replace instead of delete
But what do I replace then, considering I don't want there to be a RegionalRange of any sort?
 
Have you tried putting in 0?

I strongly suspect that wouldn't be a complete solution. For example, if you were to become suzerain of Mexico City, wouldn't the range then become 3?
 
I'm trying to create a civ Unique Ability which renders units/improvements immune to some weather effects. I'm trying to model this after Russia's "Mother Russia" trait. I can't find anywhere in the base/DLC files where this is actually accomplished!

Can someone please point me towards the file/code location where Mother Russia is granted blizzard immunity for units?

Thanks!
 
I'm trying to create a civ Unique Ability which renders units/improvements immune to some weather effects. I'm trying to model this after Russia's "Mother Russia" trait. I can't find anywhere in the base/DLC files where this is actually accomplished!

Can someone please point me towards the file/code location where Mother Russia is granted blizzard immunity for units?

Thanks!
DLC/Expansion2/Data > Expansion2_Civilizations.xml
Search TRAIT_CIVILIZATION_MOTHER_RUSSIA. There's modifier TRAIT_BLIZZARD_PREVENTION_SIGNIFICANT plus 3 more.
Same file contains code to prevent specific random event, you'd have to look elsewhere for all possible keywords other than the Blizzard.
 
DLC/Expansion2/Data > Expansion2_Civilizations.xml
Search TRAIT_CIVILIZATION_MOTHER_RUSSIA. There's modifier TRAIT_BLIZZARD_PREVENTION_SIGNIFICANT plus 3 more.
Same file contains code to prevent specific random event, you'd have to look elsewhere for all possible keywords other than the Blizzard.
Thank you! I don't know how I missed that!
 
I'm tinkering with starting mod writing and was try to give the seastead an additional adjacency as practice. I wasn't able to, but the other part of the mod works (giving settlers more movement). Can anybody spot the issue, I haven't been able to get any other improvement adjacencies working either, so I think the tables I'm updating might be wrong. Here's a paste bin

EDIT: I got the adjacency to show up in civlopedia and when I go to place the seastead in the tooltip, but it won't show up on the map, and doesn't affect my income. Here is a screenshot of the completed improvement, and here is a screenshot of the improvement placement tooltip.
 
Last edited:
I'm tinkering with starting mod writing and was try to give the seastead an additional adjacency as practice. I wasn't able to, but the other part of the mod works (giving settlers more movement). Can anybody spot the issue, I haven't been able to get any other improvement adjacencies working either, so I think the tables I'm updating might be wrong. Here's a paste bin

EDIT: I got the adjacency to show up in civlopedia and when I go to place the seastead in the tooltip, but it won't show up on the map, and doesn't affect my income. Here is a screenshot of the completed improvement, and here is a screenshot of the improvement placement tooltip.
For an improvement to have a type of yield it must be listed under <Improvement_YieldChanges> first. Offshore wind farm normally only produces production.

<Row ImprovementType="IMPROVEMENT_OFFSHORE_WIND_FARM" YieldType="YIELD_PRODUCTION" YieldChange="2"/>

you need to add Gold. Since you don't want it to add gold unless there is a adjacency you set it to 0.

<Improvement_YieldChanges>
<Row ImprovementType="IMPROVEMENT_OFFSHORE_WIND_FARM" YieldType="YIELD_GOLD" YieldChange="0"/>
</Improvement_YieldChanges>
 
Also I have a question. Has anyone been able to use the artwork from the Kublaikhan_Vietnam pack for custom districts? Been trying to use the Preserve art to create a Japanese Holy site (its basically a Shinto shrine complete with Torii) but nothing I try works. I've been able to get custom districts to use the art of other unique districts from earlier expansions. I've already added

<Element>
<name text="KublaiKhan_Vietnam"/>
<id text="dd994412-6240-4685-afcf-d34e11336b83"/>
</Element>

To the dependencies list in the art.xml file and done all the normal steps that usually work.

Final Edit: Solution found here: https://forums.civfanatics.com/threads/re-using-district-artdefs.667646/#post-16596790 Modbuddy deletes any entries in your Artdefs that are not found in the SDK when you hit "build". Nothing from the Frontier Pass is in the SDK. You have to manually copy paste your Landmark and District artdefs from your modbuddy folder to Civs mod folder and overwrite the borked artdefs that Modbuddy made.
 
Last edited:
ULTRL3`NBVZL1`X$VG]I_}F.png
我在Seastead
的基础上创建了一个改进的设施 ,模型使用了 Seastead,但是在陆地上工作时模型会沉入地下。如何在编辑器中调整模型的高度?(这段是我使用翻译软件,我的英文不是很好)

Moderator Action: We are an English language forum, please provide translations in your post. leif

03`BEW53V$%(ZVSJK@F5GA0.png
 
Last edited by a moderator:
Hey everyone, I'm trying to create a Civ Ability that grants resistance to natural disasters, the same as Liang's "Reinforced Materials" promotion but applied to all player cities. I'm struggling to get the modifier to attach to the player cities. (REINFORCED_INFRASTRUCTURE_PREVENET_STRUCTURAL_DAMAGE, and no that's not a typo, it's spelled that way in the game files :p)
Assigning the modifier directly to the Trait for the Civ isn't working, and neither did going through an intermediate MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER modifier. Anybody have any hints?


If it helps, here's what I've tried so far

--Trait I'm creating
INSERT INTO Traits
(TraitType, Name, Description)
VALUES ('TRAIT_CIVILIZATION_NATURAL_STRENGTH', 'LOC_TRAIT_CIVILIZATION_NATURAL_STRENGTH_NAME', 'LOC_TRAIT_CIVILIZATION_NATURAL_STRENGTH_DESC');

-- Attaching modifier to trait
INSERT INTO TraitModifiers
(TraitType, ModifierId)
VALUES ('TRAIT_CIVILIZATION_NATURAL_STRENGTH', 'TRAIT_STRENGTH_PREVENT_STRUCTURAL_DAMAGE_ATTACH');

-- creating attachment modifier
INSERT INTO Modifiers
(ModifierId, ModifierType)
VALUES ('TRAIT_STRENGTH_PREVENT_STRUCTURAL_DAMAGE_ATTACH' ,'MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER');

-- arguments for attachment modifier
INSERT INTO ModifierArguments
(ModifierId, Name, Type, Value)
VALUES ('TRAIT_STRENGTH_PREVENT_STRUCTURAL_DAMAGE_ATTACH', 'ModifierID', 'ARGTYPE_IDENTITY', 'REINFORCED_INFRASTRUCTURE_PREVENET_STRUCTURAL_DAMAGE');

Let me know if this should be asked elsewhere :)
 
Hey everyone, I'm trying to create a Civ Ability that grants resistance to natural disasters, the same as Liang's "Reinforced Materials" promotion but applied to all player cities. I'm struggling to get the modifier to attach to the player cities. (REINFORCED_INFRASTRUCTURE_PREVENET_STRUCTURAL_DAMAGE, and no that's not a typo, it's spelled that way in the game files :p)
Assigning the modifier directly to the Trait for the Civ isn't working, and neither did going through an intermediate MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER modifier. Anybody have any hints?


If it helps, here's what I've tried so far

--Trait I'm creating
INSERT INTO Traits
(TraitType, Name, Description)
VALUES ('TRAIT_CIVILIZATION_NATURAL_STRENGTH', 'LOC_TRAIT_CIVILIZATION_NATURAL_STRENGTH_NAME', 'LOC_TRAIT_CIVILIZATION_NATURAL_STRENGTH_DESC');

-- Attaching modifier to trait
INSERT INTO TraitModifiers
(TraitType, ModifierId)
VALUES ('TRAIT_CIVILIZATION_NATURAL_STRENGTH', 'TRAIT_STRENGTH_PREVENT_STRUCTURAL_DAMAGE_ATTACH');

-- creating attachment modifier
INSERT INTO Modifiers
(ModifierId, ModifierType)
VALUES ('TRAIT_STRENGTH_PREVENT_STRUCTURAL_DAMAGE_ATTACH' ,'MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER');

-- arguments for attachment modifier
INSERT INTO ModifierArguments
(ModifierId, Name, Type, Value)
VALUES ('TRAIT_STRENGTH_PREVENT_STRUCTURAL_DAMAGE_ATTACH', 'ModifierID', 'ARGTYPE_IDENTITY', 'REINFORCED_INFRASTRUCTURE_PREVENET_STRUCTURAL_DAMAGE');

Let me know if this should be asked elsewhere :)
The issue is that the modifier you are using in modifiers as defined here:
<Row>
<ModifierType>MODIFIER_GOVERNOR_ADJUST_PREVENET_STRUCTURAL_DAMAGE</ModifierType>
<CollectionType>COLLECTION_OWNER</CollectionType>
<EffectType>EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE</EffectType>
</Row>

Is set to Collection Owner. Most modifiers set that way only work when attached to a something else that can "own" the modifier, like a building or unit. In order to apply this effect to all of your cities with just one modifier, you will need to created a new modifier but with CollectionType set to "COLLECTION_PLAYER_CITIES". So that the EffectType is applied to your cities, instead of to a undefined "Owner". Here you go put this in your mod should work.

<DynamicModifiers>
<Row>
<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_PREVENT_STRUCTURAL_DAMAGE</ModifierType>
<CollectionType>COLLECTION_PLAYER_CITIES</CollectionType>
<EffectType>EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE</EffectType>
</Row>
</DynamicModifiers>
 
The issue is that the modifier you are using in modifiers as defined here:
<Row>
<ModifierType>MODIFIER_GOVERNOR_ADJUST_PREVENET_STRUCTURAL_DAMAGE</ModifierType>
<CollectionType>COLLECTION_OWNER</CollectionType>
<EffectType>EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE</EffectType>
</Row>

Is set to Collection Owner. Most modifiers set that way only work when attached to a something else that can "own" the modifier, like a building or unit. In order to apply this effect to all of your cities with just one modifier, you will need to created a new modifier but with CollectionType set to "COLLECTION_PLAYER_CITIES". So that the EffectType is applied to your cities, instead of to a undefined "Owner". Here you go put this in your mod should work.

<DynamicModifiers>
<Row>
<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_PREVENT_STRUCTURAL_DAMAGE</ModifierType>
<CollectionType>COLLECTION_PLAYER_CITIES</CollectionType>
<EffectType>EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE</EffectType>
</Row>
</DynamicModifiers>
Thanks so much for this!

For whatever reason I can't get it working, testing it using the soothsayer. However, making a similar modifier for the Reyna promotion that allows you to buy districts works fine with COLLECTION_PLAYER_CITIES - so either there's some other CollectionType that needs to be used for EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE, or that particular EffectType requires the governor at a more fundamental level...?
 
Thanks so much for this!

For whatever reason I can't get it working, testing it using the soothsayer. However, making a similar modifier for the Reyna promotion that allows you to buy districts works fine with COLLECTION_PLAYER_CITIES - so either there's some other CollectionType that needs to be used for EFFECT_ADJUST_PREVENT_STRUCTURAL_DAMAGE, or that particular EffectType requires the governor at a more fundamental level...?
Not sure, been feeling poorly lately so can't really test it. If Player cities doesn't work Idk. You could possibly take the MODIFIER_GOVERNOR_ADJUST_PREVENET_STRUCTURAL_DAMAGE and give it to a city building like a unique monument. That could work though I understand if that's not a option if you have something else in mind for the UI.
 
Top Bottom