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

Zergrage

Sergeant
6 Badges
Oct 20, 2008
50
0
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Victoria: Revolutions
  • Victoria 2
  • 500k Club
Hi. I'm trying to make an event which would destroy a factory if you fight too long.



event = {
id = 24535
random = no

trigger = {
war_exhaustion = { country = -1 value = 3 } #30%
random = 10
}
AND = {
war_exhaustion = { country = -1 value = 6 } #60%
random = 50
}
AND = {
war_exhaustion = { country = -1 value = 9 } #90%
random = 80
}
}

name = "Violence due to exhaustion!"
desc = "People are rioting due to war exhaustion! And they're about to destroy our factory!"

style = 0

date = { day = 1 month = january year = 1875 }
offset = 7
deathdate = { day = 30 month = december year = 2800 }

action_a = {
name = "Need your cooperation to win the war. So donate money!"
ai_chance = 20
command = { type = treasury value = 1500 }
command = { type = pop_militancy which = farmers value = 4 where = -1 }
command = { type = pop_militancy which = labourers value = 4 where = -1 }
command = { type = pop_militancy which = clerks value = 2 where = -1 }
command = { type = pop_militancy which = craftsmen value = 4 where = -1 }
}
action_b = {
name = "Can't finish like this!"
ai_chance = 80
command = { type = remove_building which = -1 }
}
}


What exactly does offset do?
Hmm... Would've been great if there's a thread explaining this.
No searching column :-(

P.S. any advise on this event?
 
Last edited:
Offset = the period of days between every time the game checks to see if the event can fire. Be wary though, as too many events with very low offsets may slow down your game considerably.
 
Hi. I'm trying to make an event which would destroy a factory if you fight too long.



event = {
id = 24535
random = no

trigger = {
war_exhaustion = { country = -1 value = 3 } #30%
random = 10
}
AND = {
war_exhaustion = { country = -1 value = 6 } #60%
random = 50
}
AND = {
war_exhaustion = { country = -1 value = 9 } #90%
random = 80
}
}

name = "Violence due to exhaustion!"
desc = "People are rioting due to war exhaustion! And they're about to destroy our factory! (eunsuk01@naver.com)"

style = 0

date = { day = 1 month = january year = 1875 }
offset = 7
deathdate = { day = 30 month = december year = 2800 }

action_a = {
name = "Need your cooperation to win the war. So donate money!"
ai_chance = 20
command = { type = treasury value = 1500 }
command = { type = pop_militancy which = farmers value = 4 where = -1 }
command = { type = pop_militancy which = labourers value = 4 where = -1 }
command = { type = pop_militancy which = clerks value = 2 where = -1 }
command = { type = pop_militancy which = craftsmen value = 4 where = -1 }
}
action_b = {
name = "Can't finish like this!"
ai_chance = 80
command = { type = remove_building which = -1 }
}
}


What exactly does offset do?
Hmm... Would've been great if there's a thread explaining this.
No searching column :-(

P.S. any advise on this event?

i've come up with similar event, which factories are destroyed when a country is occupied by an enemy.

if i'm not mistaken, your trigger seems that all three conditions need to match in order to fire the event. to explain, allow me to put a code on your plot.

let's call the following as A;
trigger = {
war_exhaustion = { country = -1 value = 3 } #30%
random = 10
}

and this goes B;
AND = {
war_exhaustion = { country = -1 value = 6 } #60%
random = 50
}

then the last for C;
AND = {
war_exhaustion = { country = -1 value = 9 } #90%
random = 80
}
}

when you line up A,B,C in trigger, that means you must meet all the conditions A,B and C together for the event to happen. on top of that, B and C got random chance, which B will have a random check and C will have the check as well. the random check is a bit complicated matter as far as i know, but to make it simple, both need to pass the random check.

now, let me rephrase your event structure.
i believe you want the event happen when;
1, war exhaustion reaches at 30% (10% chance)
2, war exhaustion reaches at 60% (50% chance)
3, war exhaustion reaches at 90% (80% chance)

if so, you may need each event for every condition because an event will fire only once in my understanding. otherwise, we have to lend the event system which economic event like disaster, in order to perform the event repeated.

by the way, your event trigger is parenthesized out at the condition A. i believe this will cause an error while loading a game.