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

unity100

Major
45 Badges
Mar 31, 2003
779
58
www.webgeekworld.com
  • Hearts of Iron IV: Cadet
  • Victoria 2
  • Victoria 2: A House Divided
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Rome Gold
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall - Revelations
  • Divine Wind
  • Crusader Kings II: Charlemagne
  • 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: Sword of Islam
  • Commander: Conquest of the Americas
  • Deus Vult
  • Europa Universalis III Complete
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
I made the below event with Spoonist's event builder for victoria. It is supposed to trigger an event to turn the country to a monarchy and set all the reforms to nil upon some conditions (ie plurality not over 50, ruling party is conservative or reactionary). it is supposed to happen after an election. it also would fire off for every country, player or ai, if the same conditions met, without dying. i included it in the event files.

however it doesnt work. can anyone tell me what i am doing wrong ?

event = {
id = 97054
random = no
invention = no
campaign = yes # Random states (-1) are the same for all event commands.
trigger = {
OR = {
government = { type = conservative }
}
OR = {
government = { type = reactionary }
}
AND = {
NOT = {
plurality = 50
}
NOT = {
constitution = { type = monarchy }
}
}
}
name = "Institute Monarchy"
desc = "Current political climate in our country favors a Monarchy. Will we institute the Monarchistic reform ?"
picture = default
date = { day = 1 month = january year = 1836 }
offset = 30
deathdate = { day = 30 month = december year = 1920 }
action_a = {
Name = "No"
ai_chance = 85
command = { }
}
action_b = {
Name = "Yes"
ai_chance = 15
command = { type = constitution which = monarchy }
command = { type = executive_designation which = laws_by_decree }
command = { type = pop_militancy which = reactionary value = -3 where = }
command = { type = pop_militancy which = aristocrats value = -3 where = }
command = { type = pop_militancy which = clergymen value = -3 where = }
command = { type = pop_militancy which = socialist value = 3 where = }
command = { type = pop_militancy which = liberal value = 3 where = }
command = { type = pop_militancy which = farmers value = 3 where = }
command = { type = pop_militancy which = labourers value = 3 where = }
command = { type = pop_militancy which = clerks value = 3 where = }
command = { type = pop_consciousness which = aristocrats value = 3 where = }
command = { type = pop_consciousness which = officers value = 3 where = }
command = { type = pop_consciousness which = clergymen value = 3 where = }
command = { type = voting_rights which = none }
command = { type = press_rights which = state_press }
command = { type = trade_unions which = none }
command = { type = public_meetings value = no }
command = { type = political_parties which = none_allowed }
}
}
 

unity100

Major
45 Badges
Mar 31, 2003
779
58
www.webgeekworld.com
  • Hearts of Iron IV: Cadet
  • Victoria 2
  • Victoria 2: A House Divided
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Rome Gold
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall - Revelations
  • Divine Wind
  • Crusader Kings II: Charlemagne
  • 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: Sword of Islam
  • Commander: Conquest of the Americas
  • Deus Vult
  • Europa Universalis III Complete
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
i cant believe this kind of event was never talked in modding forum. its one of the most common questions.

i roamed 38+ pages full of threads on this forum going back past yet i havent seen anything relevant.

how come ?
 

Taylor

Field Marshal
99 Badges
Feb 17, 2006
2.960
5.184
  • War of the Roses
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Magicka
  • 200k Club
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Magicka 2
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Stellaris: Nemesis
  • Europa Universalis III
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • 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
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • Heir to the Throne
Exactly what doesn't work? Does the event fire at all?

One thing you can try is not having date, offset and deathdate fields.
 

Gheis

Custom User Title
124 Badges
May 8, 2007
324
12
  • Victoria: Revolutions
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Leviathan: Warships
  • Lost Empire - Immortals
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Galactic Assault
  • Europa Universalis: Rome
  • Semper Fi
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Supreme Ruler 2020
  • Teleglitch: Die More Edition
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Hearts of Iron IV: No Step Back
  • Deus Vult
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • 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
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • Hearts of Iron II: Armageddon
  • East India Company
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For The Glory
The trigger currently needs the country to have both conservative and reactionary governments at the same time.
Code:
OR = {
government = { type = conservative }
}
OR = {
government = { type = reactionary }
}
 

unity100

Major
45 Badges
Mar 31, 2003
779
58
www.webgeekworld.com
  • Hearts of Iron IV: Cadet
  • Victoria 2
  • Victoria 2: A House Divided
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Rome Gold
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall - Revelations
  • Divine Wind
  • Crusader Kings II: Charlemagne
  • 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: Sword of Islam
  • Commander: Conquest of the Americas
  • Deus Vult
  • Europa Universalis III Complete
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
Exactly what doesn't work? Does the event fire at all?

One thing you can try is not having date, offset and deathdate fields.


Not at all. Not even from the console.


The trigger currently needs the country to have both conservative and reactionary governments at the same time.
Code:
OR = {
government = { type = conservative }
}
OR = {
government = { type = reactionary }
}

i already changed it :

OR = {
government = { type = conservative }
government = { type = reactionary }
}

still no go.

i think its flopping at the point of being random and the dates etc.

i need it to fire reliably when triggers are met, more frequent than a random item. fireable for all countries at any given time when conditions are met.

yesterday i studied the forums, wiki items regarding event scripting, some of the stuff even confused me more. the examples in forum and some event examples i took from some mods didnt help either.
 

unity100

Major
45 Badges
Mar 31, 2003
779
58
www.webgeekworld.com
  • Hearts of Iron IV: Cadet
  • Victoria 2
  • Victoria 2: A House Divided
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Rome Gold
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall - Revelations
  • Divine Wind
  • Crusader Kings II: Charlemagne
  • 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: Sword of Islam
  • Commander: Conquest of the Americas
  • Deus Vult
  • Europa Universalis III Complete
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
in the below form it fired only once in 1854, while the game was lasting from 1836 and on. despite i removed the triggers. in this state this event has very little firing chance. how do we increase the chances of a random event ?


event = {
id = 97054
random = yes
invention = no
trigger = {


}
name = "Institute Monarchy"
desc = "Current political climate in our country favors a Monarchy. Will we institute Monarchy government ?"
picture = organisation
action_a = {
Name = "No"
ai_chance = 85
command = { }
}
action_b = {
Name = "Yes"
ai_chance = 15
command = { type = constitution which = monarchy }
command = { type = executive_designation which = laws_by_decree }
command = { type = pop_militancy which = reactionary value = -3 }
command = { type = pop_militancy which = aristocrats value = -3 }
command = { type = pop_militancy which = clergymen value = -3 }
command = { type = pop_militancy which = socialist value = 3 }
command = { type = pop_militancy which = liberal value = 3 }
command = { type = pop_militancy which = farmers value = 3 }
command = { type = pop_militancy which = labourers value = 3 }
command = { type = pop_militancy which = clerks value = 3 }
command = { type = pop_consciousness which = aristocrats value = 3 }
command = { type = pop_consciousness which = officers value = 3 }
command = { type = pop_consciousness which = clergymen value = 3 }
command = { type = voting_rights which = none }
command = { type = press_rights which = state_press }
command = { type = trade_unions which = none }
command = { type = public_meetings value = no }
command = { type = political_parties which = none_allowed }
}
}
 

Taylor

Field Marshal
99 Badges
Feb 17, 2006
2.960
5.184
  • War of the Roses
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Magicka
  • 200k Club
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Magicka 2
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Stellaris: Nemesis
  • Europa Universalis III
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • 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
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • Heir to the Throne
If I were you, I would start by editing an existing campaign event (db\events\campaign_events.txt).

I don't know if you can increase the chance for random events. (You can of course make multiple copies of your event...)
 

unmerged(140895)

Sergeant
4 Badges
Apr 30, 2009
77
0
  • Hearts of Iron III
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
Hi, this is my first post and it's nice to be trying to answer a question rather than ask
one. Not that I won't be asking lots in the future! lol

I've read a few threads as well as Vikywiki etc and have tried this out several times; so
bear with me while I try to clarify a few things:

I'm using 3 different versions, namely; Vanilla 1.03 and 1.04 with combined hotfixes (also
1.04 with VIP 0.45) and yes I know that these aren't up-to-date versions but considering I
bought the game from Blockbuster for £1, I'm still smiling! :)

As far as I can make out you can only have totally random events not the semi-random
ones that you want. By that I mean that you are trying to control when this event occurs and
thus it is no longer random. (therefore 'random = no')

Usually once an event fires it is recorded in the history section (near the end) of the save
game file in order to prevent it from firing more than once. However as you want this to
work on multiple occaisions you need to add ('persistent = yes'). But you should note that
the event will still only fire once per session (i.e. you need to save and reload inbetween)
no matter how often the trigger situations occur. - TESTED

I believe a random event cannot be assigned to a particular country but sadly it also can't
be set to fire for all countries if trigger conditions are stipulated (because then it is no
longer random!) Here I've set this event to fire for Uruguay. - TESTED

You can use 'random = %%' within the trigger braces (e.g. 'random = 66' meaning the event
supposedly has a 66% more chance of happening (more chance than what? zero?) but I've not
been able to get this to work as yet!)

You cannot set the end of an election as a trigger condition so the program will not check
for anything once the election is finished. However, you can use the existance of a campaign
as a trigger - so once an election campaign starts the event will fire (assuming, of course,
that the other triggers are met) - add ('campaign = yes') but this must be put within the
trigger braces and it only works during a campaign not afterwards. - TESTED

So my suggestion is as follows:

a/ leave 'campaign = yes' commented out otherwise the event will fire during the campaign if
the conservatives or reactionaries are already in power and therefore the result of the election
isn't taken into account. - TESTED

b/ copy this event for all countries individually (yes all of them!) - just look at the events
for the German minor nations and you'll see what I mean. Don't forget to give each copy of
the event a unique ID because they would be seperate although virtualy identical events, one
for each country. (how dearly I would love to be proved wrong on this point!)

c/ so that the event doesn't fire immediately at the start of the game for the countries that
might meet the trigger conditions that early, set the start date to 1st of January 1841 or
later. This way no country will trigger the event until at least after its first election
has been held. (note: you cannot set an event to occur a set time or date after the trigger
conditions have been met - shame ;-( ) - TESTED

d/ save and reload the game at least every 5 years (or sooner) so that the events will reset
ready for the next round of elections. You should get into the habit of saving frequently
anyway for your own peace of mind. - TESTED

e/ if playing Revolutions then you should ensure that the deathdate is set accordingly or
removed altogether - otherwise the event will not fire for the last 15 years of the game.


###############################################
# Convert to Monarchy
###############################################

event = {
id = 97054 # must be unique

random = no
persistent = yes # makes event reoccur

country = URU # added to make event affect Uruguay only - for test purposes

trigger = {
campaign = yes # remove as per text unless wanted
OR = {
government = { type = conservative }
government = { type = reactionary }
}
NOT = {
plurality = 50
constitution = { type = monarchy }
}
}

name = "Institute Monarchy"
desc = "The current political climate in our country favours a Monarchy. Shall we
institute the Monarchist reform?"
picture = default

date = { day = 1 month = january year = 1841 } # note the startdate
offset = 30 # the offset isn't really needed
deathdate = { day = 30 month = december year = 1920 } # nor the deathdate

action_a = {
Name = "No"
ai_chance = 85
command = { }
}

action_b = {
Name = "Yes"
ai_chance = 15
command = { type = constitution which = monarchy }
command = { type = executive_designation which = laws_by_decree }
command = { type = pop_militancy which = reactionary value = -3 }
command = { type = pop_militancy which = aristocrats value = -3 }
command = { type = pop_militancy which = clergymen value = -3 }
command = { type = pop_militancy which = liberal value = 3 }
command = { type = pop_militancy which = socialist value = 3 }
command = { type = pop_militancy which = clerks value = 3 }
command = { type = pop_militancy which = farmers value = 3 }
command = { type = pop_militancy which = labourers value = 3 }
command = { type = pop_consciousness which = aristocrats value = 3 }
command = { type = pop_consciousness which = clergymen value = 3 }
command = { type = pop_consciousness which = officers value = 3 }
command = { type = voting_rights which = none }
command = { type = press_rights which = state_press }
command = { type = public_meetings value = no }
command = { type = political_parties which = none_allowed }
command = { type = trade_unions which = none }
}
}

Hope this helps!