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

MoralMonster

Second Lieutenant
9 Badges
Apr 2, 2011
173
340
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV
  • Victoria 2
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
Hello everyone. I used to make mods for Victoria 2, particularly events. Now I just started to make a mod for V3, but was confused by some mechanics, which differs from Victoria 2 scripting.

In V2 almost each random event has a "mean time to happen" in the event code itself. In V3 we have some code in common/on_actions instead, and I wonder how exactly it works.

For example, we have the following code:

on_montly_pulse_country = {
random_events = {
10 = 0
5 = event.1
5 = event.2
}
}

Does it mean. that any given month any existing country will have a 10/(10+5+5) = 50% chance of no event, and 5/(10+5+5) = 25% chance of event.1 and of event.2 respectively? And the second questions, derived from the first one, is: what happens if event.1 doesn't meet its trigger when the event.2 does? As far as I understand, in this case the event.1 probability should be added to the probability of no event. and the event.2 probability should remain 25%.

Please let me know if I get this mechanic wrong. Modding Victoria games makes a solid part of fun when playing it.
 
How do I get a random event to fire?

I'm trying to add some randomness to the events firing, and found this code for Krakatoa event:

krakatoa.PNG


So I tried the following:

randomevent.PNG


But I can not get it to activate the event.

When I activate the event in the console, it's fine. So there shouldn't be a problem related to the event itself, probably just have to get the on_yearly_pulse_country to work.

Since you discussed this very topic, maybe you have some suggestions on what I can do to solve the problem?