• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Roman617

Private
14 Badges
Sep 20, 2018
21
0
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Crusader Kings II: Charlemagne
So, I created a event by reverse engineering events already there I came up with this:

Code:
namespace = rome_test_event

rome_test_event.1 = {
  
    type = country_event
    title = "rome_test_event.1.t"
    desc = "rome_test_event.1.desc"
    picture = romans_marching
    goto_location = root
    trigger = {
        tag = ROM
        NOT = {
            has_variable = rome_test_100_flag
        }
    }
    immediate = {
        set_variable = { 
            name = rome_test_100_flag
        }
    }
    option = {
        name = "rome_test_event.1.a"
        ai_chance = {
            factor = 100
        }
        C:ROM = {
            create_unit = {
                name = "Roman Army 1"
                location = p:2
                while = {
                    count = 20
                    add_subunit = heavy_infantry
                }
                while = {
                    count = 5
                    add_subunit = horse_archers
                }
                while = {
                    count = 5
                    add_subunit = heavy_cavalry
                }
            }
        }
    }
}

I localized it afterwards. Then to see if it worked I went into a new game to see if it would trigger and it never did. Does anyone know why its not working?

I don't know if this helps but here's what I localized:

rome_test_event.1.t:0 "The New Recruits"
rome_test_event.1.desc:0 "Rome has gotten a new contingent of troops"
rome_test_event.1.a:0 "Very Good"
 
Event triggers aren't checked monthly as they are in other Paradox titles; if you want the trigger checked monthly or yearly you need to put it in the appropriate on_action file.
 
Event triggers aren't checked monthly as they are in other Paradox titles; if you want the trigger checked monthly or yearly you need to put it in the appropriate on_action file.
Do you happen to know how the weight_multiplier works? I know that it modifiers the chance that random on_actions will occur, but not sure of the specifics.
 
Do you happen to know how the weight_multiplier works? I know that it modifiers the chance that random on_actions will occur, but not sure of the specifics.
Well you can make events that will always fire each year, and those that have a less than 100% chance to fire. I'd assume that the weight multiplier sums all the weights and does the event weight/sum to find the probability of firing, but if that's not the case, you'd just have to keep the sum of the weights fixed to 100 to not be confused.
 
Do you happen to know how the weight_multiplier works? I know that it modifiers the chance that random on_actions will occur, but not sure of the specifics.

In the random section of an on_action you'll have values which correspond to the chance of each event (or no event if there's a blank entry) happening exactly like in EU4. Weight multipliers in the events in question then multiply by the base value for that event in the on_action file.

E.G. If the on_action entries have 900 = 0 and 100 = my_event.1, no weight multipliers or a weight multiplier that was equal to 1 would result in a 100/1000 chance that my_event.1 fires. If the weight multiplier in my_event.1 was equal to 2, it would result in a 200/1100 chance of the event firing and so forth.
 
In the random section of an on_action you'll have values which correspond to the chance of each event (or no event if there's a blank entry) happening exactly like in EU4. Weight multipliers in the events in question then multiply by the base value for that event in the on_action file.

E.G. If the on_action entries have 900 = 0 and 100 = my_event.1, no weight multipliers or a weight multiplier that was equal to 1 would result in a 100/1000 chance that my_event.1 fires. If the weight multiplier in my_event.1 was equal to 2, it would result in a 200/1100 chance of the event firing and so forth.
Thank you for explaining :)