Incomplete requirements for modifiers:
Every engine static and dynamic modifier needs a modifier_type_definition entry in order to be applied by the game engine.
This includes dynamic modifiers for fully vanilla types. A somewhat common mistake is attempting to use a "vanilla" dynamic modifier that lacks a modifier type definition because PDX only added definitions and localization for the the dynamic modifier variants they used in vanilla content.
eg: goods_input_luxury_clothes_add looks like a 100% vanilla modifier, but vanilla doesn't have a type definition for it, so using it without adding a type definition to your mod is an error.
The prefix of the modifier type definition determines it's type, and propagation. Modifier types with an invalid prefix will generate a error.log entry, but will still appear in game, and can be used to display custom effects implemented elsewhere in script, so should be considered valid
(Tiger might not need to maintain a hard coded map of modifier names and types if it can just use the prefix)
Dynamic building modifiers don't have a prefix, they just look like they do because all the vanilla building definitions start with building_ if you name your building super_factory the modifiers for it look like super_factory_throughput_add not building_super_factory_throughput_add
Applying modifiers in places where they won't propagate to something they will apply to does nothing (and I'm 90% sure there's no error.log message about it, it just silently doesn't work).
eg: A modifier applied to a state which includes country type modifiers will do nothing.
It may be possible to validate modifier propagation to warn if a modifier won't do anything if we can figure out the structure of the modifier graph. I have a hunch that if you can draw a path from one scope to another following scope level iterators, the modifier will propagate.
ie: state type modifiers work when applied to power blocs because you can navigate from power_bloc scope to state scope with every_power_bloc_member -> every_scope_state
Modifier type definitions must be lowercase.
Matching modifier type definitions to the things they apply to is case sensitive. Even if the thing it applies to accepts upper case characters in the definition.
- Building definitions do not need to be lower case, but if you create a building with uppercase characters, you can not use it's dynamic modifiers as the type definitions are invalid.
- Renaming things to remove uppercase characters is a save incompatible change.
Because of this, using uppercase characters in the definition of anything that could later have a modifier type definition created for it is a code smell.
Incomplete requirements for modifiers:
Every engine static and dynamic modifier needs a
modifier_type_definitionentry in order to be applied by the game engine.This includes dynamic modifiers for fully vanilla types. A somewhat common mistake is attempting to use a "vanilla" dynamic modifier that lacks a modifier type definition because PDX only added definitions and localization for the the dynamic modifier variants they used in vanilla content.
eg:
goods_input_luxury_clothes_addlooks like a 100% vanilla modifier, but vanilla doesn't have a type definition for it, so using it without adding a type definition to your mod is an error.The prefix of the modifier type definition determines it's type, and propagation. Modifier types with an invalid prefix will generate a error.log entry, but will still appear in game, and can be used to display custom effects implemented elsewhere in script, so should be considered valid
(Tiger might not need to maintain a hard coded map of modifier names and types if it can just use the prefix)
Dynamic building modifiers don't have a prefix, they just look like they do because all the vanilla building definitions start with
building_if you name your buildingsuper_factorythe modifiers for it look likesuper_factory_throughput_addnotbuilding_super_factory_throughput_addApplying modifiers in places where they won't propagate to something they will apply to does nothing (and I'm 90% sure there's no error.log message about it, it just silently doesn't work).
eg: A modifier applied to a state which includes country type modifiers will do nothing.
It may be possible to validate modifier propagation to warn if a modifier won't do anything if we can figure out the structure of the modifier graph. I have a hunch that if you can draw a path from one scope to another following scope level iterators, the modifier will propagate.
ie: state type modifiers work when applied to power blocs because you can navigate from power_bloc scope to state scope with
every_power_bloc_member->every_scope_stateModifier type definitions must be lowercase.
Matching modifier type definitions to the things they apply to is case sensitive. Even if the thing it applies to accepts upper case characters in the definition.
Because of this, using uppercase characters in the definition of anything that could later have a modifier type definition created for it is a code smell.
add_modifierin a scope where the contained modifier types won't propagate (feat(vic3): Validate modifier flow with add_modifier #263)add_enactment_modifierwith a static modifier containing modifier types that won't propagate from country scope (feat(vic3): Validate modifier flow with add_modifier #263)