-
Notifications
You must be signed in to change notification settings - Fork 17
on_action Blockers
Mods interested in having specially generated heirs (especially for things like historical heirs) in countries with hereditary transfers of power can utilize the Heir Blocking Framework's feature to prevent the visual appearance of an heir. That is, while the heir technically is generated (as there is no useful way to prevent that), we can intercept the new heir and remove them whilst blocking the "Heir Born" message at the same time, giving the appearance to the user that no heirs are actually being born.
To use it, just set a variable named no_heirs in the country that should have its heirs blocked; e.g.,
c:GBR = {
set_variable = no_heirs
}
Modified on action logic for heir births will take care of the rest automatically.
To allow randomly-generated heirs again, simply remove the variable.
Note:
- No considerations have been made regarding any fail-safe. You are solely responsible for unblocking heirs later, even if the country switches away from a government type with hereditary transfer of power.
- Heirs created via
create_characterand heirs set viaset_heirare not blocked, as they do not count as a "natural" heir birth. This means the variable does not need to be briefly unset when generating or setting heirs via script, such as for historical heirs.
This allows for blocking the formation events that occur whenever the player forms a country. This can be used for blocking the events' effect of adding claims to all homeland states which is vanilla behavior.
To use it, just set a variable named com_no_formation_events in the country that should have formation events blocked; e.g.,
c:GRE = {
set_variable = com_no_formation_events
}
To allow formation events again, simply remove the variable.
Notes:
- No considerations have been made regarding any fail-safe. You are solely responsible for unblocking formation events later, even if the country successfully completes additional formations.
- Changing country via the
change_tageffect will not remove thecom_no_formation_eventsvariable.