On Actions

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Overview[edit | edit source]

On Actions are effects that are triggered by hardcoded actions, like a button being pressed. They are found in /Europa Universalis IV/common/on_actions. Unlike ck2, eu4's On Actions do not combine and editing specific on actions in new files requires copying over the vanilla content.

On Actions support a list of events to trigger. Use the events' own trigger to restrict when they actually do.

   events = {
       my_event.1
       my_event.2
   }

Alternatively, events can also be triggered directly in the On Action's effect.

On Actions also support a list of events of which exactly one happens randomly, similar to a random list.

   random_events = {
       200 = my_event.1
       300 = my_event.1
       500 = 0
   }

Event id "0" is used as a 'no event' case.

Random event list events should have both `is_triggered_only = yes` and a `mean_time_to_happen` of **`days = 1`**. This mean time to happen works differently than usual - here, modifiers that increase the MTTH time will **multiply** the random event weight, making it **more likely** for the event to happen. Similar to adding chance modifiers to a random_list.

List[edit | edit source]

On Action Description ROOT THIS FROM Notes
on_abandon_colony Fired right before the colony is abandoned. location country country refers to who abandoned it
on_accept_tribute country overlord
on_add_pasha
on_added_to_trade_company location country
on_adm_development location
on_admiral_recruited country
on_annexed annexing country annexed country
on_bankruptcy country
on_battle_lost_country loser country winner country
on_battle_lost_province location winner country
on_battle_lost_unit unit
on_battle_won_country winner country loser country
on_battle_won_province location loser country
on_battle_won_unit unit
on_become_free_city country
on_bi_yearly_pulse
on_bi_yearly_pulse_2
on_bi_yearly_pulse_3
on_bi_yearly_pulse_4
on_bi_yearly_pulse_5
on_buy_religious_reform country
on_center_of_trade_downgrade Fired when center of trade is downgraded. location
on_center_of_trade_upgrade Fired when center of trade is upgraded. location
on_change_hre_religion
on_change_revolution_target country country THIS = new target, FROM = previous target
on_chinese_empire_dismantled Fired when Chinese Emperor is annexed. country country ROOT = annexing country, FROM = emperor
on_circumnavigation
on_colonial_liberation country
on_colonial_pulse
on_colonial_reintegration country
on_colonial_type_change
on_company_chartered location country FROM = previous country
on_company_disolved location country
on_company_formed location country
on_conquest location previous owner
on_conquistador_empty
on_conquistador_native
on_conquistador_recruited country
on_consecrate_patriarch location
on_convert_by_trade_policy location country FROM = country who propogated
on_country_creation
on_country_released country overlord
on_create_client_state country overlord
on_create_vassal country overlord
on_culture_promoted
on_death_election country
on_death_foreign_slave_ruler country
on_death_has_harem country
on_dependency_gained overlord subject
on_dependency_lost overlord subject
on_dip_development location
on_diplomatic_annex
on_dismantle_revolution loser country winner country loser country = rev. country, winner country = peace treaty enforcer
on_embrace_revolution country
on_emperor_elected country country ROOT = New Emperor, FROM = Previous Emperor
on_enforce_rebel_demands country
on_estate_led_regency country
on_estate_led_regency_surpassed country
on_explore_coast location country ROOT = discovered province, FROM = country doing the exploring
on_explorer_recruited country
on_extend_regency country
on_extended_regency
on_federation_leader_change
on_fetishist_cult_change country
on_five_year_pulse
on_five_year_pulse_2
on_five_year_pulse_3
on_five_year_pulse_4
on_flagship_captured country country ROOT = who captured, FROM = who lost
on_flagship_destroyed country country ROOT = who destroyed, FROM = who lost
on_four_year_pulse
on_four_year_pulse_2
on_four_year_pulse_3
on_four_year_pulse_4
on_gain_great_power_status country
on_general_recruited country
on_golden_bull_enacted country THIS = curia controller
on_government_change country
on_grant_estate_land location
on_great_project_constructed location country FROM = country that owns it
on_harmonized_buddhism country
on_harmonized_christian country
on_harmonized_dharmic country
on_harmonized_jewish_group country
on_harmonized_mahayana country
on_harmonized_muslim country
on_harmonized_pagan country
on_harmonized_shinto country
on_harmonized_vajrayana country
on_harmonized_zoroastrian_group country
on_heir_death country
on_heir_needed_theocracy country
on_holy_order_established country
on_hre_defense
on_hre_member_annexed
on_hre_member_false_religion
on_hre_member_true_religion
on_hre_non_defense
on_hre_province_reconquest
on_hre_released_vassal
on_hre_religion_white_peace
on_hre_transfered_vassal
on_hre_wins_defensive_war
on_integrate
on_janissaries_raised location
on_leader_recruited country
on_loan_repaid country
on_lock_hre_religion
on_lose_great_power_status country
on_mandate_of_heaven_gained country country ROOT = new emperor, FROM = old emperor
on_mandate_of_heaven_lost country country ROOT = old emperor, FROM = new emperor
on_mercenary_recruited country location unit
on_mil_development location
on_minority_expelled location location location FROM = home province
on_monarch_death country
on_monthly_pulse this fires every day
on_native_change_government country
on_new_consort country
on_new_heir country
on_new_monarch country can be called for Personal Union juniors as well
on_new_term_election country
on_overextension_pulse
on_parliament_debate_failed country
on_parliament_debate_succeeded country
on_peace_actor country
on_peace_recipient country
on_pillaged_capital country country ROOT = country pillaging, FROM = country pillaged
on_post_adm_advisor_fired country
on_post_dip_advisor_fired country
on_post_mil_advisor_fired country
on_pre_adm_advisor_fired country
on_pre_dip_advisor_fired country
on_pre_mil_advisor_fired country
on_province_culture_converted location
on_province_owner_change location country FROM = old owner
on_province_religion_converted location
on_queen_death country
on_raid_coast country location THIS = raiding country
on_rebels_break_country country
on_reform_changed
on_reform_enacted
on_refuse_tribute subject overlord
on_regent country
on_regiment_recruited location country
on_released_hre_member
on_religion_change country
on_remove_free_city
on_remove_pasha
on_removed_from_company location country FROM = country doing it
on_replace_governor country
on_revoke_estate_land
on_revoke_estate_land_ai
on_revoke_estate_land_ai_post
on_revoke_estate_land_post
on_revolutionary_guard_raised
on_russian_oprichnina
on_russian_streltsy
on_russian_sudebnik
on_secondary_religion_change country
on_select_heir_from_harem
on_siberian_pulse
on_siege_lost_country loser country location
on_siege_lost_province location winner country
on_siege_won_country winner country location
on_siege_won_province location loser country
on_startup country
on_successive_emperor
on_thri_yearly_pulse
on_thri_yearly_pulse_2
on_thri_yearly_pulse_3
on_thri_yearly_pulse_4
on_trade_company_investment
on_trade_good_changed location country
on_transfer_development country country ROOT = country doing transfer, FROM = country dev was transferred from
on_war_lost loser country winner country
on_war_won winner country loser country
on_weak_heir_claim country

Actions not in the file[edit | edit source]

On Action Description ROOT THIS FROM Notes
on_cossacks_receive_serfs
on_culture_demoted
on_primary_culture_changed
on_raise_cossacks
Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localizationRun files
Scripting Scripted functionAdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEmpire of ChinaEstatesEventsFactionsGovernmentGreat projectsHistoryHoly Roman EmpireIdea groupsInstitutionsMercenariesMissionsModifiersNation designerOn ActionsParliamentPeace treatiesPoliciesRebel typesReligionSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapNation designerRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe ValidatorRun files
Guides Adding a provinceSave-game editingScripting Tutorial