-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdummy event for beginners.txt
83 lines (58 loc) · 8.04 KB
/
dummy event for beginners.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
###########################
# Dummy event by Nijato
###########################
add_namespace = dum #This will add a unique namespace for your file, do something short, without capital letters and relatable to the topic of your file, here I will set up the namespace "dum" for dummy
#By the way putting a # before a characters will set up everything after it and on the same line as a comment, it means what you will write after it won't have any effect on the code. It's mainly used to have a legible file, for you or for others who could happen to read it.
#There is also a big rule with paradox script being when you have a { you have to put an other } somewhere to close it. This is used to have defined spaces. For exemple when you will set up a answer to an event you will first open the answer like this : option = { then you will write everything it and then you will close it to tell the game the answer is finished like this }
#So in practice this could be "option = { add_political_power = 100 }"
country_event = { #Now we're commencing the event, by setting this you tell the game you are beginning a country_event, it's the standard type of event. There is an other type but I won't explain it here cause it's not needed.
id = dum.1 #This is the idea of the event, it's name in the engine, it's always your defined namespace (that's why it's important) followed by a dot and a number, here 1. I suggest naming your events in the numeral order so here if I made other events they would be "dum.2" "dum.3" etc. This way it will be easier for you to avoid conflicts.
#Also keep in mind that since every file has its own namespace you will never have to worry about an id conflict with someone else's work.
title = dum.1.t #This is the code for the title of the event this is only used for localization
desc = dum.1.d #This is the code for the description of the event, namely the text explaining what it is. Again this is only used for localization purpose.
picture = GFX_report_event_british_artillery #The nice picture of the event, I won't go into details here because it's not very important and we don't have any of those anyway
#Here we are designing an event that will fire either for france or germany and only once as long as they are at war and that it's after october 15th 1936
fire_only_once = yes #This means the event will only fire once in every game and that for any country, meaning if france got it first it will never fire again for germany or for anyone
#If you remove it it will fire for everyone anytime as long as the conditions are met, this is useful to have repeating flavor events like comet sighted in EU4
trigger = { #Now we are opening the trigger of event, meaning the conditions required for the event to fire
#tag = AFG this is commented and so not used but I will explain it before doing anything else, tag = AFG means the event will only fire if your country is that tag, for exemple tag = AFG means the event will only fire for afghanistan
date > 1936.10.15 #This means the event will only fire after the 15th of october 1936 you can also use date < 1936.10.15 if you want it to fire before that date
has_war = yes #This checks is the country is at war, it's a yes/no variable so you can only puy yes or no after it
OR = { tag = FRA tag = GER } #Now I'm using of the 3 basic boolean operators : OR. This means the event will trigger either if you are playing france (FRA) or germany (GER). OR works for every condition and mean the condition will be met if there is at least one true thing in it. (See the end of the file for explanations about other booleans)
} #Our conditions are finished we are now closing the trigger. I only used 3 triggers but there are a lot more, see the hoi4wiki for that : http://www.hoi4wiki.com/Conditions
mean_time_to_happen = { #This is the mean_time_to_happen. It's made to make a random event (again like comet sighted), it means the amount of time until the event have a 50% chance to fire. This is still a complicated concept even for hardened modders so I suggest you have a read on here, especially at the curve : http://www.eu4wiki.com/Events#Mean_time_to_happen
days = 25 #the event will have a 50% chance of firing 25 days after the conditions are met. Keep in mind the MTTH isn't linear so you won't have 100% chance after 50 days, again check the curve on the link.
} #We close the mean_time_to_happen
#Now we want our events to have two options, one to give you manpower and one to give either political power if you're playing as france or national unity if you're playing as germany
option = { #We are opening the first option of the event
name = dum.1.a #This is the code of the name of the event, the text associated with it. As for the description and the title this is only used for localization
ai_chance = { #This is a percentage of the chance the ai will pick this option so factor = 75 means the ai will have 75% chance of taking it.
factor = 75
} #We close the ai_chance (you understood the trick now)
#Now we will be listing the effects the option will have, here I will only use 3 commands in total but like conditions there are a lot more, see all of them here : http://www.hoi4wiki.com/Commands
add_manpower = 8000 #this command will add 8000 manpower to your country
} #And we close the option, we have now finished the first one
option = { #we are now opening the second option of the event, note that of course you can have as many options as you want from 1 to infinite
name = dum.1.b #the name, now with a b since it's the second one
ai_chance = { #Still the ai_chance, the ai now has 25% chance of taking it
factor = 25
}
if = { limit = { tag = FRA } add_political_power = 100 } #Now we are into a more complicated structure, I just used a if, it checks if the something is true or not, if it is it will do the said effect. So now this checks if you're playing france or not, if you do it will give you 100 political power. If you code in other languages you may know the "else" that you can put after an if, well it doesn't exist in paradox script sorry.
if = { limit = { tag = GER } add_national_unity = 0.1 } #The same thing but we are now checking if you play germany or not, if you do it will give you 10% national unity (1 = 100% 0.1 = 10% 0.01 = 1%)
} #the second option is finished we close it
#Just a small note : if you are giving the event a fourth option don't name it 1.d but 1.e since 1.d is already taken by the description
} #Okay so we just finished the event and it's fully fonctionnal, we can close it and the game will understand that everything in the brackets is a single event. Note that if you use Notepad++ you can place your cursor on the bracket and it will color in red this bracket and the one it's linked to. It's very useful to track down bracket errors.
#Some general things :
#As you have maybe seen we can divide an event into three parts : -the frame, it's the id card of the event, its type, id, name, description, picture
#-the trigger, it's the conditions needed for the event to fire
#-the options, there are the possible answers to the event
#You can notice I left quite a lot of line breaks and often started new lines only to close a bracket, this is purely aesthetical and won't have any influence in game you can even in theory have 1000 events on the same line but it will be illegible.
#Other booleans :
#NOT : this will check for the contrary of anything you put in it so for exemple NOT = { has_war_with = RUS tag = FRA } will be true when you are not at war with russia and not playing france
#AND : this will be true when all of the conditions put in it are true. For exemple AND = { has_war_with = RUS tag = FRA } will be true when you are at war with russia and are playing france
#Useful Links :
#http://www.hoi4wiki.com/Conditions
#http://www.hoi4wiki.com/Commands
#http://www.hoi4wiki.com/Scopes
#http://www.eu4wiki.com/Events#Mean_time_to_happen (for the mean_time_to_happen)
#http://www.hoi4wiki.com/National_focus (if you're doing a focus tree and are needing inspiration)