How to create an event for dummies :
Any event your create must be in a file with an extension .txt in the "events" directory of your V2 game.
Names are only here to help you find where your events are.
Country/Province :
First select if this should apply on country, state/province :
Code:
country_event = {
your event
}
Code:
province_event = {
your event
}
All the following must be in the "{" and "}" :
Basic elements
You have to set a unique id, a title and a description :
Code:
id = 50000
title = "MyEvent"
desc = "MyEventDescription"
The "id" value must be unique for all events. If I'm not mistaken starting at 40000 there are no vanilla event id.
The "title" can be the full title (no matter the player language) or a tag that link to a value depending on the language (see the post about localisation)
Same for "desc" than for "title".
There are some optional element (I'm missing some right now, will add them later) :
Select the picture to display (name can be found by looking at events) :
Code:
picture = "Revolution"
Trigger/Condition
Now we start the big part of the event : the trigger. It set the conditions for the event to pop.
Code:
trigger = {
your triggers
}
Inside the "{" and "}", you need to put condition for your event to have a chance to trigger.
There are many elements that you can put inside : here you can get a list
In addition to the element to test, you can put logical element :
Code:
AND = {
trigger1
trigger2
}
Code:
OR = {
trigger1
trigger2
}
Note that the basic logical element is always a "AND"
Examples without using real V2 trigger element :
Code:
trigger = {
country got 1000 cash
NOT = { country is at war }
}
This event might trigger if the country got 1000 cash and if the country is not at war
You can do very complex test, so try to be clear in your mind when starting creating trigger :
Code:
trigger = {
OR = {
AND = {
country culture is south german
country own all german core
NOT = {
OR = {
Prussia exist
North German Federation exist
Germany exist
}
}
}
AND = {
country is Prussia
country own all german core
NOT = { Germany exist }
}
}
}
This is one big ugly trigger and you might need to think a lot about each element.
Time for event to trigger
Once this is done, you need to set element to decide how often it should trigger if condition are meet.
Code:
mean_time_to_happen = {
months = 10
}
In this case, the event should trigger every 10 months approximately.
This value can be modified by element working exactly like the trigger part :
Code:
mean_time_to_happen = {
months = 10
modifier = {
factor = 0.9
trigger
}
}
}
In this case, if the trigger conditions are meet, the value months = 10 will be multiplied by 0.9.
So this would decrease the time between each same event.
A value bigger than 1 would increase the time.
Of course, you can add as many as you want.
Code:
mean_time_to_happen = {
months = 10
modifier = {
factor = 0.9
trigger 1
}
}
modifier = {
factor = 0.9
trigger 2
}
}
}
Effects
Then the last part, the choice you can make and the effect of each option. You can set 1, 2, 3 or 4 options.
You need to put a name working like the title and the description.
Code:
option = {
name = "Option 1"
effect
}
You can put as many effect as you want in each option.
Again, a list of effect can be found here
For instance, you can do something like :
Code:
option = {
name = "we are king of the world"
give 500 prestige
give 500 000 cash
}
Warning : Effect here are immediate and can't be overtime. To do overtime effect, you need to use country/province modifiers (see next posts, when it will be written)
Example
So you can make something like this :
Code:
country_event = {
id = 188718951
title = "Kiel Canal phase 1 completed!"
desc = "Digging off the Kiel Canal under the Grünenthal Bridge."
picture = "Kiel1"
trigger = {
has_global_flag = building_kiel_canal_phase1
has_country_modifier = building_kiel_canal
}
mean_time_to_happen = {
months = 32
modifier = {
factor = 1
prestige = 10
}
}
option = {
name = "Let's start phase 2"
treasury = -35000
clr_global_flag = building_kiel_canal_phase1
set_global_flag = building_kiel_canal_phase2
}
}
Event taken in the Canal mod.
If you have question, feel free to ask.
To come :
technology modding
localisation modding (translating things)
country/state modifier (long term effect)
Maybe to come :
case of complete use to create something.
If you want to help, correct or make a guide, feel free to post or contact me by private message.