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

unmerged(13787)

Sergeant
Jan 14, 2003
97
0
Visit site
I've been trying to figure out why I can't get an event to fire every month

here is the event

event = {
id = 24505
random = no
trigger = {
constitution = { type = democracy }
reform = { type = voting_rights level = suffrage }
slavery = yes
}

name = "Slaves are released"
desc = "Due to our Goverment Policies, all slaves are released to be Free"
style = 0

date = { day = 2 month = january year = 1836 }
offset = 30
deathdate = { day = 30 month = december year = 1920 }

action_a = {
name = "Freedom" # Free them all
command = { type = convert_pop_type which = slaves value = labourers }
}
}

When I manually trigger it, it works perfectly fine. But in a Belgium game where I've got a good portion of the East Africian coast, i've ran for 6 months without it triggering.

Anyone have any insights?

Nicholi
 

JScott991

General
48 Badges
Feb 16, 2001
2.400
372
  • Crusader Kings II
  • Crusader Kings II: Reapers Due
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Semper Fi
  • Rome Gold
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • March of the Eagles
  • Magicka
  • Europa Universalis III Complete
  • Heir to the Throne
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Crusader Kings II: Legacy of Rome
  • Hearts of Iron Anthology
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Stellaris: Apocalypse
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome - Magna Graecia
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis III: Collection
  • 500k Club
  • Victoria 2
  • Supreme Ruler 2020
  • Europa Universalis IV
  • Crusader Kings II: Charlemagne
Doesn't the offset value effect the timing of the trigger?
 

unmerged(13787)

Sergeant
Jan 14, 2003
97
0
Visit site
If I'm understanding the Offset value correctly, it's checking every X days (where X is the offset)...

Which I wasn't understanding correctly, drat it. Just checked Havards, and offset is the random day value.

Bleh. I want my event to check every 30 days.

Nicholi
 

unmerged(21731)

Sergeant
Nov 11, 2003
80
0
Visit site
Well I'm not an expert, but my understanding is this....

Events will only fire once (except random events). The offset is the number of days (I think, could be months), from the start date that the event will fire. For example, if the event dates were from Jan 1st, 1850 with an offset of 300 and all other trigger conditions had been met, then the event would fire sometime within 300 days(months) of Jan 1st, 1850.

I have been toying with some recuring events. Some ideas include:

- Make it a random event and have an early event which sets the %chance of the random event to be quite high.
- Another idea is to make it a campaign event. Campaign events are random events that fire every 4 years or when you hold an election. Could make a campaign event that would do what you wanted.
 

unmerged(13787)

Sergeant
Jan 14, 2003
97
0
Visit site
I think I have it working, will do one more game to make sure everything fires right, but, the solution turned out to simple / annoying :)

It is a 2 event step. The first event (which I just made hence need to test) sets 2 local flags. The first flag is set to keep the initial event from firing all the time (heh). The second flag is set to keep the 2nd event firing constantly (not sure how thats going to effect the cpu performance).

The 2nd event looks for the localflag value to be 1, if not, it fires, but never sets the localflag value to 1, hence it's self repeating (hopefully).

If this turns out to be the right stepping stone, then I'll need to modify it for the US so that it doesn't mess up their events.

Here are the events (both in randomevents.txt)

event = {
id = 24505
random = no
trigger = {
NOT = { local_flag = { name = SLAVERY_FLAG_SET value = 1 } }
}

name = ""
desc = ""
style = 0

date = { day = 2 month = january year = 1836 }
deathdate = { day = 30 month = december year = 1920 }

action_a = {
command = { type = local_setflag which = SLAVERY_REMOVED value = 0 }
command = { type = local_setflag which = SLAVERY_FLAG_SET value = 1 }
}
}

event = {
id = 24506
random = no
trigger = {
NOT = { local_setflag = { name = SLAVERY_REMOVED value = 1 } }
constitution = { type = democracy }
reform = { type = voting_rights level = suffrage }
slavery = yes
}

name = "Slaves are released"
desc = "Due to our Goverment Policies, all slaves are released to be Free"
style = 0

date = { day = 2 month = january year = 1836 }
offset = 30
deathdate = { day = 30 month = december year = 1920 }

action_a = {
name = "Freedom" # Free them all
command = { type = convert_pop_type which = slaves value = labourers }
}
}

I'm pretty sure this will be moot once 1.02 is released, since I saw in there a bugfix for this very issue, but, doing this is fun, it's a learning experience, and i'm too durn impatient.

Nicholi