• 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.

tonberrian

Second Lieutenant
93 Badges
Sep 25, 2013
155
29
  • Crusader Kings II: Charlemagne
  • Tyranny - Tales from the Tiers
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mare Nostrum
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Res Publica
  • Magicka
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sword of Islam
  • Victoria: Revolutions
  • Europa Universalis IV
  • Surviving Mars
  • BATTLETECH
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Nemesis
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines
  • Hearts of Iron IV: Cadet
  • Victoria 2
  • Stellaris: Galaxy Edition
  • Stellaris
  • Victoria 2: A House Divided
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Victoria 2: Heart of Darkness
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
I'm poking through the Jade Dragon events, trying to find out how to get the Art of War. I'm pretty sure I've never gotten either the Envoy coming for trade or the Governer's councilor coming to visit, and I'm trying to decipher them so I can increase the odds of it happening.

#An envoy from China appears, hidden event generates the envoy then pings
character_event = {
id = JD.60000
hide_window = yes
is_triggered_only = yes

only_capable = yes
only_playable = yes
has_dlc = "Jade Dragon"
prisoner = no
war = no
min_age = 16

trigger = {
NOT = { offmap_china = { governor = { character = ROOT } } }
is_inaccessible_trigger = no
china_diplo_interaction_trigger = yes
offmap_china = {
NOR = {
has_status = china_civil_war
has_status = china_plague
}
}
}

weight_multiplier = {
days = 1
modifier = {
factor = 0.1
any_artifact = { has_artifact_flag = chinese }
}
modifier = {
offmap_china = { has_status = china_unrest }
factor = 0.6
}
modifier = {
offmap_china = { has_status = china_mongol_invasion }
factor = 0.3
}
modifier = {
offmap_china = { has_status = china_jurchen_invasion }
factor = 0.3
}
modifier = {
offmap_china = { has_status = china_famine }
factor = 0.3
}
modifier = {
offmap_china = { has_status = china_golden_age }
factor = 3
}
modifier = {
offmap_china = { has_policy = china_expansionist }
factor = 2
}
}

immediate = {
offmap_china = {
governor = {
random_list = {
50 = {
modifier = {
NOT = {
has_game_rule = {
name = gender
value = all
}
}
factor = 0.05
}
create_character = {
age = 32
culture = PREV
religion = PREV
dynasty = actually_culture
female = yes
random_traits = yes
historical = yes
}
}
50 = {
create_character = {
age = 32
culture = PREV
religion = PREV
dynasty = actually_culture
female = no
random_traits = yes
historical = yes
}
}
}
new_character = {
set_character_flag = chinese_envoy_artifacts
random = {
chance = 10
remove_education_effect = yes
add_trait = brilliant_strategist
change_martial = 5
set_character_flag = chinese_envoy_warrior
}
character_event = { id = JD.60001 }
}
}
}
}
}

This is the event that triggers the trade envoy. Most of this I understand, but I'd like some help going through it anyways. I definitely don't understand how Weight Multiplier works to determine how often the event fires. An idea of how often this fires would go a long way to helping me understand the event.
 

WomboCombo

Colonel
71 Badges
Apr 8, 2017
946
34
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Rights of Man
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Pillars of Eternity
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Prison Architect
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Age of Wonders: Planetfall Sign Up
  • Europa Universalis IV
  • Stellaris: Ancient Relics
  • Crusader Kings II: Holy Fury
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Crusader Kings II: Way of Life
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Shadowrun Returns
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Jade Dragon
  • Imperator: Rome
  • Stellaris: Megacorp
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Art of War
Events have a Mean Time to Happen (MTTH), meaning after a time, the event should have a 50% chance of firing. Weight will modify this by MTTH/Weight (effectively a percentage), so:

If an event has a MTTH of 500 days, a modifier with a weight of 2 will cut the MTTH by half, making it more likely to fire.
Inversely, if the same event has a modifier with a weight of .5, it will double the MTTH, making it less likely to fire.

At least I think that's how it goes.
 

TDarksword

Second Lieutenant
89 Badges
Feb 16, 2011
116
50
  • Crusader Kings III: Royal Edition
  • Stellaris: Necroids
  • Europa Universalis 4: Emperor
  • Stellaris: Nemesis
  • Stellaris: Galaxy Edition
  • Victoria 2
  • Prison Architect
  • Stellaris: Galaxy Edition
  • Crusader Kings II
  • Europa Universalis IV
  • Pillars of Eternity
  • Cities: Skylines Deluxe Edition
  • Surviving Mars: First Colony Edition
  • BATTLETECH
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Cities: Skylines - After Dark
  • Crusader Kings II: Sword of Islam
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Victoria 2: A House Divided
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Cities: Skylines - Campus
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
MTTH and weight are somewhat similar but actually relate to completely different things.

MTTH applies to some events (all those that aren't triggered_only = yes) and have modifiers that affect the MTTH (the factor being how much it affects it, a factor of 0.5 halves the MTTH and thus means it is twice as likely to occur). So for events triggered by MTTH high factors are bad, low factors good.

Weight_multiplier though applies to triggered_only = yes, most of which (including this one JD.60000) are triggered as an on action event. This specific event lies under on_yearly_pulse, which is checked basically once a year for each character. The top group of events, between the event = { and } trigger every time this pulse is called (most of them of course have global flags that stop them being triggered every year for every char).

The JD.60000 though lies in the random_event {} section. There is a massive list of events here, which are of the form x = y, where x is the base weight of the event and y is the eventid. The game goes through all of these events, evaluates any that can actually happen to the character (note there is the quite high chance at the bottom of 5000 = 0, which is the weight of no event happening). As part of this evaluation, it modifies the base weight of the event with any weight_modifiers that character meets. All events that can be triggered then go into a list (including that 5000 chance of nothing happening) and a number is rolled between 1 and the total weights of the events, and then it chooses the event based on that number.

example. You have 4 events each with weight 100, and a 400 chance of calling event 0 (or no event).
Code:
random_event = {
   100 = Ex.1
   100 = Ex.2
   100 = Ex.3
   100 = Ex.4
   400 = 0
}

This would mean you have a 1 in 8 base chance of calling each event (base weight of event/weight of all possible events) and a 50% chance of having no event (weight of no event/weight of all possible events)

Now lets say the character has the trait Fat. Fat is set as a condition that prevents event ex.3 from triggering (so under triggers has the condition NOT {trait=fat}), but it has a weight modifier on event ex.4 of 2 ie the following bit of code in event ex.4
Code:
weight_modifier = {
   days = 1
   modifier = {
           factor = 2
           trait = fat
       }
   }
}

this doubles the base weight of that event happening. So our weights now actually look like
Code:
random_event = {
   100 = Ex.1
   100 = Ex.2
   0 = Ex.3 #not possible as character is fat
   200 = Ex.4 # doubled weight as character is fat
   400 = 0
}

Now there is still a 1/8 chance of Ex.1 or Ex.2 being triggered, a 0 chance of Ex.3, a 1/4 chance of Ex.4 and still a 50% chance of no event.

Regarding the specific event you are looking at (JD.60000) its base weight in on_actions is 25. The best weight modifiers you can get is offmap_china = { has_status = china_golden_age } (factor 2) and offmap_china = { has_policy = china_expansionist } (factor 3), which gives a maximum factor of six (3x2) so a maximum weight for that event of 150 (6x25). This though is against a total weight for all those events (assuming just the base weights in on_actions) of 55,150, so it only has a 0.272% chance of triggering. Even if all the other events could be made to not be possible for that char, it would still only have a 2.9% chance of triggering (150/5150) as there is that 5000 weight chance of no event triggering.

In truth though it will likely be a different chance, as all those other events will be affected by weight modifiers of their own, if not completely removed, but the maximum chance of that event triggering will not be above 2.9% per year (as it is part of the on_yearly_pulse set). Note event from mods that add to the on_actions list may also affect this.