Creating a Leader Trait that spares conquered population/buildings...Confused

pokiehl

Moderator
Moderator
Joined
Mar 5, 2017
Messages
4,115
Hi guys, I have been using NycholusV's excellent modifier guide, but I'm stumped as to how to implement this. My plan is to modify Cyrus' leader trait to have no population loss upon conquest. The value is in GlobalParameters: CITY_POPULATION_LOSS_TO_CONQUEST_PERCENTAGE.

1. I know there is no dynamic modifier for this, so I set out to create one. First by adding the type.
INSERT INTO Types (Type, Kind) VALUES ('P_MODIFIER_CONQUERED_POP', 'KIND_MODIFIER')

2. I may be on the wrong track here, but the only effect I can find for population is EFFECT_ADJUST_CITY_POPULATION.
INSERT INTO DynamicModifiers (ModifierType, CollectionType, EffectType) VALUES ('P_MODIFIER_CONQUERED_POP', 'COLLECTION_OWNER', 'EFFECT_ADJUST_CITY_POPULATION')

3. Create the modifiers...

INSERT INTO Modifiers (ModifierId, ModifierType) VALUES ('P_CONQUERED_POP', 'P_MODIFIER_CONQUERED_POP')
INSERT INTO TraitModifiers (TraitType, ModifierID) VALUES ('FLYING_SQUADRON_TRAIT', 'P_CONQUERED_POP')

4. Arguments? Here I am totally confused. I can find no similar modifiers for what I'm trying to do.
INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES....

Any ideas? Is this doable without modifiers and I am totally overthinking it? I just want to make a change in GlobalParameters that applies to a single leader...
 
I don't know that this is doable with Modifiers.

EFFECT_ADJUST_CITY_POPULATION as far as I know is only used currently for giving the player free population, e.g. from a goody hut that provides +1 population. I dont think it has an impact on population loss when a city is captured. There may be a modifier type that does this, but this one wouldn't be it.

The ModifierArguments table is typically used to list any values that are tweakable.

A useful SQL query to know is this:

Code:
SELECT * FROM Modifiers
LEFT JOIN ModifierArguments on Modifiers.ModifierId = ModifierArguments.ModifierId

You can tack a WHERE statement on that to make it searchable for any field on either the Modifiers or ModifierArguments table.
 
Thank you isau! That query is really useful. I feared it wasn't possible... BTW Your SQLite tutorial is what got me into modding - I now have over a dozen (albeit simple) mods on Steam thanks to everything I learned reading that. So thank you for making that!

Do you see any way at all to link something to a city being captured? The only similar modifier in the game is for the conquistador, but they created a very specific effect that only applies to religious conversion of a captured city. All requirements I see reference occupation, razing, or liberating, but not capturing.
 
Thank you isau! That query is really useful. I feared it wasn't possible... BTW Your SQLite tutorial is what got me into modding - I now have over a dozen (albeit simple) mods on Steam thanks to everything I learned reading that. So thank you for making that!

Do you see any way at all to link something to a city being captured? The only similar modifier in the game is for the conquistador, but they created a very specific effect that only applies to religious conversion of a captured city. All requirements I see reference occupation, razing, or liberating, but not capturing.

I don't know that there is one other than the Global parameter. It might be possible to do it in a roundabout way by stealing from the Modifiers used for Australia's special ability that provides +production after certain kinds of city captures, if that allows you to change it to Food.

There may also be a way to trigger it based on a Requirement. I've never tried it.
 
Back
Top Bottom