Events

From EU3 Wiki

Jump to: navigation, search

Events are pieces of code that checks if certain triggers are true. If they are, the event may happen with a certain regularity and coded effects are applied. An event may have several options, where the player can choose which set of coded effects he or she prefers. If the triggers are false, the event will not happen.

An event can be either a province event or a country event. Province events are events based on triggers related to a province, like province religion, population, data about the province owner or neighbouring provinces.

You can trigger events manually, providing you know the event id.

List of events

[edit] Basic event coding

An event consists of five parts:

As an example, let's look at the National Bank event:

country_event = {

    id = 4042

This was the id

    trigger = {
        NOT = { has_country_flag = bank }
        NOT = { idea = national_bank }
        advisor = treasurer
    }

This was the trigger

    mean_time_to_happen = {
        months = 480
        
        modifier = {
            factor = 0.9
            ADM = 6
        }
        modifier = {
            factor = 0.9
            advisor = statesman
        }
        modifier = {
            factor = 0.9
            treasurer = 5
        }
        modifier = {
            factor = 0.9
            treasurer = 6
        }
        modifier = {
            factor = 1.1
            NOT = { ADM = 5 }
        }
        modifier = {
            factor = 1.2
            NOT = { ADM = 3 }
        }
        modifier = {
            factor = 1.1
            NOT = { advisor = statesman }
        }
    }

This was the mean time to happen with modifiers

    title = "EVTNAME4042"
    desc = "EVTDESC4042"

These were the title and description

    option = {
        name = "EVTOPTA4042"        # National loans at 500 ducats
        ai_chance = { factor = 5 }
        inflation = -5
        stability = 1
        loan_size = 500
        set_country_flag = bank
    }
    option = {
        name = "EVTOPTB4042"        # National loans at 200 ducats
        ai_chance = { factor = 90 }
        inflation = -5
        stability = 1
        loan_size = 200
        set_country_flag = bank
    }
    option = {
        name = "EVTOPTC4042"        # National loans at 1000 ducats
        ai_chance = { factor = 5 }
        inflation = -5
        stability = 1
        loan_size = 1000
        set_country_flag = bank
    }
}

...and at last the options. This event has three different options

To go deeper into how these different parts work, follow the links from the list above.

Personal tools