• 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(114671)

Sergeant
Sep 14, 2008
60
0
Hello everyone,

In the Ottoman Empire mod I'm currently working on, I want to make an event that allows Turkey to join an alliance on choice, right after Poland falls to Germany. I wanted to know how to make the event fire as soon as the terms are fulfilled (Poland does not exit, Germany holds Warsaw). Thanks in advance!
Here's the event, please tell me what to add to make it work.

#############################################
###### Poland Has Fallen!
#############################################
event = {
id = 1000027
random = no
country = TUR
trigger = {
event = 1000001
NOT = { exists = POL }
control = { province = 485 data = GER }

}

name = "Poland Has Fallen!"
desc = "The much feared and expected war is here. Germany defeated Poland, and it seems they will now turn their attention to France. This can go in a lot of different ways. If we want to find friends - now might be a good time to make our bets."
style = 0


action_a = {
name = "Back to WW1 - ask to join the axis"
command = { type = trigger which = 1000028 }
ai_chance = 80
}
action_b = {
name = "Counter the blacks and reds - ask to join the allies"
command = { type = trigger which = 1000031 }
ai_chance = 10
}
action_c = {
name = "The worldwide revolution has to come eventually - ask to join the comintern"
command = { type = trigger which = 1000032 }
ai_chance = 5
}
action_d = {
name = "We need no allies! Turkey can build itself up!"
command = { type = relation which = GER value = 0 }
ai_chance = 5
}


}
 
You'll need a date and an offset, or you'll need to remove the trigger and just have it triggered by another event ("event = 1000001" here just means this event can only fire after 1000001 has fired).

As a date/offset example:

date = { day = 29 month = january year = 1936 } #the first day this event can fire
offset = 7
deathdate = { day = 1 month = july year = 1941 } #after this date the event can no longer fire

The offset is how often the game will check this event, so if it absolutely must be right after Germany conquers Poland you can set it to 1 and it will check every day (you don't want to do this for every even though, since it will bog down the game as the computer is forced to check every event's conditions every day).
 
you just need a start date, deathdate, offset are optional
offset works as it is described in the event commands.txt file:
"offset = X # X = number of days. Means the event will trigger once in the x days period, which day is random"
if your start date is jan 1st, and your offset is 30, it chooses a random day in the 30 day period after jan 1st to fire
if you have other conditions met after the random date chosen by the computer, it will fire as soon as those conditions are met
 
Last edited:
First: there is no need to be a jerk. Second: offset and the date parameters are not in event_commands because they are not triggers or effects.

And as far as I have ever heard offset is actually checking the triggers every X days (although it is reset on a load). This is also confirmed by the HOI2 wiki and the comments in the event files (e.g. "offset = 7 # Check for trigger conditions every seven days"). The only thing I can't confirm is that a low offset increases CPU usage.

The way you've described it would make no sense. There would be no reason to have an offset except for triggers with random in them. And then they would either not fire after the offset (which I can confirm is false), or the offest would be completely useless (because an offset = 7 may randomly fire in any of those 7 days...but then you'll just have another 7 days after that that it might fire, and another 7 and another 7 ad infinitum (until the deathdate)).

The only thing that I can think of that you might be thinking of is the MTTH system that most other Paradox games use (except Vicky and HOI2). It would be nice if HOI2 and Vicky had it, but they don't.
 
if you make five events with the starting date jan 1 1936 with an offset of 10 and no triggers (or tirggers with conditions met), the events fire randomly in those ten days, instead of all at the same time in ten days
 
Last edited:
First of all, thank you both for helping.

Second of all, i checked who is right on the "offset" thing. I gave it the start and death date UltimaGecko suggested, with an offset of 1. Indeed, the event only fired once, a day after the annexation of Poland. So yeah, it seems UltimaGecko was right about it.

Btw, UltimaGecko, I know what a deathdate and a startdate is, and I know this event can only be triggered by event 1000001. It's a part of an event chain I'm making for a mod :) its first version are already released.
 
Second of all, i checked who is right on the "offset" thing. I gave it the start and death date UltimaGecko suggested, with an offset of 1. Indeed, the event only fired once, a day after the annexation of Poland. So yeah, it seems UltimaGecko was right about it.
We did not disagree on whether or not it would fire the next day with an offset of 1, or how many times it would fire.
 
Last edited:
Unfortunately it would be impossible to discern which of the offset theories is true with an offset of 1.


I had never tested it (aside from because the comments and wiki implied it was so) because the offset really doesn't have much of an impact and the triggers are generally more important than firing an event at a specific time.


But at your behest I have and it is closer to your functionality than mine, and I am now disappointed with the inaccuracy of the wiki.


That out of the way:

The game picks one day in X to check the event. If the event's triggers are true on that day the event will fire (if they are true on the beginning of the offset, but not true by the day the game has selected it will not fire). After X days, one random day in X many days is selected to check the event again. Random seems to be selected at the beginning of the offset. If no offset is included the event will check only on the date specified (i.e. even if the triggers are true it won't fire later).

So if you have an offset of 5 and the event's conditions are true for all 5 days there's a 20% chance of it firing on any of the 5 days, but a 100% chance of it firing at some point in those 5 days.

If you have the same offset of 5 and it's not true on the date the game selected, the game will continue through that offset run, and select another random day in the next 5 days to check the conditions. So if it's not true from the 1st to the 5th, a random day from the 6th to the 10th will be selected. But if you reload the game on say the 3rd, it will then reset the offsets and the new batch of days would be the 3rd to the 8th (or the 4th to the 9th ...the midnight firings make it difficult to be explicit - anyway it resets the offset).