Possible for modifier argument to be scaled by game pace?

TC_

Chieftain
Joined
Jul 8, 2017
Messages
77
Row>
<ModifierId>EXAMPLE_MODIFIER</ModifierId>
<Name>YieldType</Name>
<Value>YIELD_GOLD</Value>
</Row>
<Row>
<ModifierId>EXAMPLE_MODIFIER</ModifierId>
<Name>Amount</Name>
<Value>4</Value>
</Row>

Does anyone know of a way to change <Value>4</Value> to something like 4*GamePaceScale? Where it'll grant 4 in standard pace, 6 in epic, etc?

Thanks in advance
 
Use ScaleByGameSpeed in the ModifierArguments table. Below is an example of a burst of Culture from my Combined Tweaks mod that scales according to GameSpeed.

Code:
-- Give Sumeria a burst of Culture
INSERT INTO Modifiers
    (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId)
VALUES    ('QUO_SUMERIA_FREE_STARTING_CULTURE', 'MODIFIER_PLAYER_GRANT_YIELD', 1, 1, NULL, NULL) ;


INSERT INTO ModifierArguments
    (ModifierId,             Name,             Type,             Value,         Extra,     SecondExtra)
VALUES    ('QUO_SUMERIA_FREE_STARTING_CULTURE',     'Amount',     'ScaleByGameSpeed',     '20',        NULL,     NULL),
    ('QUO_SUMERIA_FREE_STARTING_CULTURE',     'YieldType',     'ARGTYPE_IDENTITY',     'YIELD_CULTURE',    NULL,     NULL)  ;


INSERT INTO TraitModifiers
    (TraitType,             ModifierID)
VALUES    ('TRAIT_CIVILIZATION_FIRST_CIVILIZATION',    'QUO_SUMERIA_FREE_STARTING_CULTURE')  ;
 
Perfect, tyvm. Do you have an example of the usage for of the extra parameters in arguments?
 
Perfect, tyvm. Do you have an example of the usage for of the extra parameters in arguments?


I've never used them, but I wrote a couple quick queries to check.

ModfierArguments.SecondExtra is used only 3 times:

  • BARBARIAN_CAMP_GOLD_SCALING
  • LOW_DIFFICULTY_COMBAT_SCALING
  • LOW_DIFFICULTY_UNIT_XP_SCALING

For all 3 of these, it is set to a value of 'DIFFICULTY_PRINCE.'


The Extra column is used 212 times total (when DLCs are included). It is deployed to various uses for modifiers of these types:

  • MODIFIER_PLAYER_ADJUST_CIVIC_BOOST
  • MODIFIER_PLAYER_ADJUST_TECHNOLOGY_BOOST
  • MODIFIER_PLAYER_GRANT_RANDOM_TECHNOLOGY
  • MODIFIER_PLAYER_DIPLOMACY_RANDOM
  • MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER
  • MODIFIER_PLAYER_ADJUST_GOLD_DISPERSAL
  • MODIFIER_PLAYER_UNITS_ADJUST_COMBAT_DIFFICULTY
  • MODIFIER_PLAYER_UNITS_ADJUST_UNIT_EXPERIENCE_MODIFIER
  • MODIFIER_PLAYER_GRANT_RANDOM_TECHNOLOGY_BOOST_ON_NEW_ERA
  • MODIFIER_PLAYER_GRANT_RANDOM_CIVIC_BOOST_ON_NEW_ERA
  • MODIFIER_PLAYER_CITIES_ADJUST_UNIT_TAG_ERA_PRODUCTION
  • MODIFIER_PLAYER_ADJUST_IMPROVEMENT_PILLAGE
  • MODIFIER_PLAYER_ADJUST_DISTRICT_PILLAGE
 
By the way here are the three "types" of ModifierArgument the game seems to accept:

  • ARGTYPE_IDENTITY - Use the value unmodified
  • ScaleByGameSpeed - Adjust the value based on game speed
  • LinearScaleFromDefaultHandicap - Adjust the value up or down based on the difficulty selected

The final one I've not worked with much since it is rare, although you see it used for some stuff like Barbarians spawn distances and the random "First impression" diplomacy modifier.
 
If you've got a SQL tool like SQLite Studio you can always write a query to find out how a field is being used. For example:

Code:
SELECT DISTINCT Type FROM ModifierArguments


That will provide you a distinct list of every use of a field in the database and is how I was able to generate a quick list of possible values.


You can also write code like this to find more info about how stuff is being used (the highlighted code is the code being run in this instance):

upload_2017-8-23_21-39-35.png
 
Top Bottom