+ Reply to Thread
Page 1 of 12 1 2 3 11 ... LastLast
Results 1 to 20 of 221

Thread: Event/decision and related for dummies

  1. #1
    Field Marshal Zarine's Avatar
    CK2: Holy KnightEU3 Collectors Edition500k clubEuropa Universalis IV: Pre-order

    Join Date
    Feb 2007
    Location
    Antibes,France
    Posts
    3,483

    Event/decision and related for dummies

    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:
    NOT = { trigger }
    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.
    Last edited by Zarine; 15-12-2010 at 12:39.

  2. #2
    Field Marshal Zarine's Avatar
    CK2: Holy KnightEU3 Collectors Edition500k clubEuropa Universalis IV: Pre-order

    Join Date
    Feb 2007
    Location
    Antibes,France
    Posts
    3,483
    How to create a Decision for dummies :

    Any decision you create must be in a file with an extension .txt in the "decisions" directory of your V2 game.
    Names are only here to help you find where your decisions are.


    First, they must all start like this :
    Code:
    political_decisions = {
    	yours decisions
    }
    I don't know why it's mandatory but it is. You can put as many decisions you want inside the "{" and "}"


    All the following remplace the "your decision" in the above part of the code.

    Now, you need to set a name for your decision :
    Code:
    my_decision_name = {
    	decision elements
    }
    Name must be without any space. Anyway, you can set later what will be displayed inside game, so naming the event auqnf isn't a problem for display (it would be to find a decision inside tons of them)
    It would be best that all decisions have a different name (I don't know if it's mandatory)

    Now we will create the different attributs/elements of the decision.
    First, the "potential". This attribut decide if you can see the possibility to make the decision in the political screen.
    For example, it prevents France to see the unification of Germany in its decision list.
    Code:
    potential = {
    	Conditions
    }
    Conditions works the exact same way as trigger for events. You can look at event for dummies above to read about this part and possible triggers.

    For instance you can make something like that (pseudo trigger code for easier comprehension):
    Code:
    potential = {
    	OR = {
    		country culture is north german
    		country culture is south german
    	}
    }
    So this would enable any country with south german culture or north german culture to see the possibility of the decision.
    If you don't put any condition, all country would see the decision.


    Then, you need to decide the elements to allow the decision to be enact.
    Code:
    allow = {
    	Conditions
    }
    Again, this works the exact same way as trigger for events. You can look at event for dummies above to read about this part and possible triggers.

    For instance you can make something like that (pseudo trigger code for easier comprehension):
    Code:
    allow = {
    	germany core province are :
    		OR = {
    			in the country
    			in the Sphere of Influence of the country
    		}
    }
    In the case, you could take the decision if you own province of germany and those missing are in your SoI.


    WARNING : to enact a decision, both "potential" AND "allow" conditions must be true as you have to see the decision in your political screen to be able to click on the enact button.


    Only part remaining is the effect of your decision :

    Code:
    effect = {
    	effects
    }
    Again, this works the exact same way as effects for events. You can look at event for dummies above to read about this part and possible effects.

    WARNING : same way as for events, those effect are one time only and overtime effect must use province/country modifiers (see the province/country modifiers for dummies below)

    For instance you can make something like that (pseudo effect code for easier comprehension):
    Code:
    effect = {
    	give country 20 prestige
    	change country to GERmany
    	annex all German culture country
    }

    When we put all together, we get something like :
    Code:
    political_decisions = {
    	form_germany = {
    		potential = {
    			OR = {
    				primary_culture = south_german
    				primary_culture = north_german
    		}
    		
    		allow = {
    			GER = {
    				all_core = {
    					OR = {
    						owned_by = THIS
    						owner = {
    							in_sphere = THIS
    						}
    					}
    				}
    			}
    		}
    		
    		effect = {
    			prestige = 20
    			change_tag = GER
    			any_country = {
    				limit = {
    					is_culture_group = germanic
    					in_sphere = THIS
    				}
    				country_event = 11101
    			}
    		}
    	}
    }
    This is almost the event I describe in pseudo code along the explaination.

    Note that this event can be VERY bad as there are intentional error inside :
    As you can see, I don't test if GER (Germany) exist and I try to change the country to it. This means that if Germany exist already, this can create a bug.
    Everytime you try to modify something (a country tag/name, a province owner...) check that it already exist or not depending of the case inside the condition attribut of potential or allow.



    WARNING : I might be wrong about it (I'll delete if so tonight after test) but even if this seems finish, game wants you to make a description of the decision.
    This part should be in the "localisation for dummies" part, but as it's not already made, I'll do it only for decision.


    The goal now is to create elements so that the game knows what to display in the interface.


    The files must be in the localisation folder and the extension must be .csv . Again, name is only here to help you know where things are.
    Those files can be open with excel or open office equivalent, but it would be safer to open it with textpad or any text editing tool.

    Each line is the displayed text for one element in each language :
    Code:
    Name_of_the_element;text to be display in english;text to be display in french;text to be display in german;;;;;;;;;;;;x;;;;;;;;;;;;;;
    (there has to be other language but I don't know which are which. If you do, please tell me so I can update it)

    The easiest way is to copy one of those line and edit element inside so you don't make mistake about the number of ";"

    Code:
    BUDGET_TAX_RICH;Tax(Rich);Impôts (classes supérieures);Steuern(Reiche);;;;;;;;;;;;x;;;;;;;;;;;;;;
    This line describe the translation of the budget tax for rich pop in english, french and german.


    So, what should you add for your decision ?
    There are 2 lines to add : the title and the description.

    If you decision is name "my_decision"
    Code:
    my_decision_title;Title in english;Titre en Francais;Titel auf Deutsch;;;;;;;;;;;;x;;;;;;;;;;;;;;
    my_decision_desc;This is the description of the decision my decision;Ceci est la description de la decision ma decision;I'll pass on the german translation;;;;;;;;;;;;x;;;;;;;;;;;;;;
    So now, depending of the language, I would change the display in the game.

    Note : if you don't know a language, leave it empty. If it is, the game will automaticly select the english version.

    Now you should have a working decision.
    Last edited by Zarine; 15-12-2010 at 11:17.

  3. #3
    Field Marshal Zarine's Avatar
    CK2: Holy KnightEU3 Collectors Edition500k clubEuropa Universalis IV: Pre-order

    Join Date
    Feb 2007
    Location
    Antibes,France
    Posts
    3,483
    technology modding to come

  4. #4
    Field Marshal Zarine's Avatar
    CK2: Holy KnightEU3 Collectors Edition500k clubEuropa Universalis IV: Pre-order

    Join Date
    Feb 2007
    Location
    Antibes,France
    Posts
    3,483
    localisation modding (translating things) and country/state modifier to come

  5. #5
    Sticky this.

    Also, I suspect vanilla has got event ids past 40000. I'd advise anyone creating new events to use 6-figure ids, as that's fine, but never go over 8 figures.

    EDIT: And perhaps some mention of event modifiers should be made for continous effects? After all, an event which gives 0.001 CON is very different to an event modifier that gives 0.001 con...
    For every subtle and complicated question, there is a simple and straightforward answer, which is wrong.

    Creator of PDM:PoD for Heart of Darkness: http://forum.paradoxplaza.com/forum/...ownload-thread
    Aaaaaaaaaaaaaaaaaaaand Creator of '1792' for March of the Eagles: http://forum.paradoxplaza.com/forum/...69074-1792-mod

  6. #6
    Field Marshal Zarine's Avatar
    CK2: Holy KnightEU3 Collectors Edition500k clubEuropa Universalis IV: Pre-order

    Join Date
    Feb 2007
    Location
    Antibes,France
    Posts
    3,483
    About the id end for vanilla, I'll check at home... but I'm pretty confident that they don't have so much id (as I always use 5 digits starting at 50000).

    Event modifier are the last part I'll talk about (country/state modifier) because they require a bit more than just editing 1 file (set element in event modifier file and localisation and then add it to the event/decision).

    BTW, I need a dummy to test if he can create a small event.

  7. #7
    Doubt I count as inexperienced enough to do the testing, I'm afraid :P

    May be worth mentioning that events have to be 1-off effects, then. The game can do very funny things when you stick modifier effects into event fields - like a certain set of needs-increasing inventions used to do...
    For every subtle and complicated question, there is a simple and straightforward answer, which is wrong.

    Creator of PDM:PoD for Heart of Darkness: http://forum.paradoxplaza.com/forum/...ownload-thread
    Aaaaaaaaaaaaaaaaaaaand Creator of '1792' for March of the Eagles: http://forum.paradoxplaza.com/forum/...69074-1792-mod

  8. #8
    Field Marshal Zarine's Avatar
    CK2: Holy KnightEU3 Collectors Edition500k clubEuropa Universalis IV: Pre-order

    Join Date
    Feb 2007
    Location
    Antibes,France
    Posts
    3,483
    Up : decision for dummies added

  9. #9
    Do you know how ai_chance works? Since it's given as factor I'm guessing it doesn't work like in V1
    I'm guessing it multiplies a base chance, but what are the base chances for different options? I see that most events don't have any ai_chance so I guess it's like V1 were the first choice has a much higher standard chance.

  10. #10
    Field Marshal Rylock's Avatar
    Crusader Kings IIDarkest HourEU3 CompleteDivine WindHearts of Iron III
    Heir to the ThroneVictoria 2

    Join Date
    Mar 2008
    Location
    Edmonton, Canada
    Posts
    8,590
    Hmm. I feel a bit like an idiot, but I guess everyone has to start somewhere.

    I created a new event, created a .txt file for it and dropped it in the events folder. Yet when I go to the game and try the event console command, it says the event id doesn't exist. What could I be doing wrong?

    I'm using the same syntax as the other events:

    Code:
    country_event = {
    
    	id = 800015
    
    	is_triggered_only = yes
    
    	title = "Whee!"
    	desc = "Testing"
    	picture = "Unite"
    
    	option = {
    		name = "Modding is fun"
    			diplomatic_influence = {
    				who = HOL
    				value = 200
    				}
    		}
    }
    Shouldn't that work? No matter what the event details are, it should still detect that the event id is there, no?
    Last edited by Rylock; 30-01-2011 at 10:30.

  11. #11
    Field Marshal Rylock's Avatar
    Crusader Kings IIDarkest HourEU3 CompleteDivine WindHearts of Iron III
    Heir to the ThroneVictoria 2

    Join Date
    Mar 2008
    Location
    Edmonton, Canada
    Posts
    8,590
    Bah. Never mind. It was as simple as missing a closing bracket in the event above the one I was trying to fire.

  12. #12
    First Lieutenant EGaffney's Avatar
    Hearts of Iron 2: ArmageddonCities in MotionCrusader Kings IIDeus VultEU3 Complete
    Divine WindFor The GloryFor the MotherlandHearts of Iron IIIHeir to the Throne
    Victoria: RevolutionsSemper FiVictoria 2Victoria II: A House DividedCK2: Holy Knight
    500k club

    Join Date
    May 2009
    Location
    Dublin
    Posts
    267
    This seems like a good place to ask my question. I note that "factor" involves multiplying the base by a certain figure. Are these effects cumulative, or does the multiplication only apply a percentage change to the base figure? I think the second option is correct, because that's how it works in the inventions file "chance" entries, but I wanted to check with modders that this was the right answer.

  13. #13
    Quote Originally Posted by EGaffney View Post
    This seems like a good place to ask my question. I note that "factor" involves multiplying the base by a certain figure. Are these effects cumulative, or does the multiplication only apply a percentage change to the base figure? I think the second option is correct, because that's how it works in the inventions file "chance" entries, but I wanted to check with modders that this was the right answer.
    From experience with other factor/modifier pairs, I can say that it does work as a multiplier, not an additive bonus like the invention chances. However I don't know what the factor is related to exactly. It seems to be a weird sort mix of additive and percentage. So for example if you have two options, you can give one option factor = 0.75 and the other option factor = 0.25, and then it will be 3:1 odds. But you can also do things like set factor A to 20, and factor B to 1, which will gives 20:1 odds.

  14. #14
    Captain greendevil's Avatar
    Hearts of Iron 2: ArmageddonCrusader Kings IIDeus VultDivine WindHearts of Iron III
    HOI3: Their Finest HourHeir to the ThroneEuropa Universalis III: In NomineVictoria: RevolutionsVictoria 2
    Victoria II: A House DividedVictoria II: Heart of Darkness500k club

    Join Date
    Nov 2008
    Location
    Italy, Ferrara
    Posts
    386
    Thank you! I'm gonna try this right now.

    Also, do you know how to add new resources ingame?
    This great evil. Where does it come from? How'd it steal into the world? What seed, what root did it grow from? Who's doin' this? Who's killin' us? Robbing us of life and light. Mockin' us with the sight of what we might've known. Does our ruin benefit the earth? Does it help the grass to grow, the sun to shine? Is this darkness in you, too? Have you passed through this night?

  15. #15
    Captain jaxx2009's Avatar
    Crusader Kings IIDarkest HourEuropa Universalis: ChroniclesEU3 CompleteDivine Wind
    For the MotherlandHearts of Iron IIIHOI3: Their Finest HourHeir to the ThroneMagicka
    Majesty II CollectionMarch of the EaglesVictoria: RevolutionsSemper FiSengoku
    Victoria 2Victoria II: A House DividedVictoria II: Heart of Darkness500k clubEuropa Universalis IV: Pre-order
    EUIV: Call to arms event

    Join Date
    Dec 2010
    Location
    Southeast Texas,United States
    Posts
    420
    Will this be updated with the Localisation part soon?

  16. #16
    Field Marshal Rylock's Avatar
    Crusader Kings IIDarkest HourEU3 CompleteDivine WindHearts of Iron III
    Heir to the ThroneVictoria 2

    Join Date
    Mar 2008
    Location
    Edmonton, Canada
    Posts
    8,590
    Quote Originally Posted by jaxx2009 View Post
    Will this be updated with the Localisation part soon?
    If you need help with localisation, this thread has a good summary on it.

  17. #17
    Field Marshal Zarine's Avatar
    CK2: Holy KnightEU3 Collectors Edition500k clubEuropa Universalis IV: Pre-order

    Join Date
    Feb 2007
    Location
    Antibes,France
    Posts
    3,483
    Quote Originally Posted by jaxx2009 View Post
    Will this be updated with the Localisation part soon?
    I didn't have much time recently so unless I'll get some, it won't be updated soon (and after reading it I asked myself if I should rework it)

  18. #18
    Sergeant 09camaro's Avatar
    Crusader Kings IIEU3 CompleteDivine WindHearts of Iron IIIHeir to the Throne
    Victoria 2

    Join Date
    Dec 2007
    Location
    in a cardboard under the stairs in the basement of a house half a block down the street from jerry's bait shop
    Posts
    66
    EDIT: Found it...

    But now I have another problem.. the decision I created doesn't fire..

    Code:
    political_decision = {
    	the_maritime_province_question = {
    		potential = {
    			AND = {
    				tag = USA
    				war = no
    				has_country_flag = webster_ashburton_signed
    				OR = {
    					has_country_flag = hasmanifestdestiny
    					has_country_flag = ostend_manifesto_published
    				}
    			NOT = {
    				has_country_flag = maritime_provinces_claimed
    			}
    		}
    		effect = {
    			badboy = 5
    			relation = {
    				who = ENG
    				value = -150
    				}
    			}
    			ENG_68 = {
    				add_core = USA
    			}
    			ENG_71 = {
    				add_core = USA
    			}
    			ENG_74 = {
    				add_core = USA
    			}
    			any_state = {
    					limit = {
    						is_slave = yes
    					}
    					any_pop = {
    						consciousness = 2.5
    					}
    			set_country_flag = maritime_provinces_claimed
    		}
    		ai_will_do = {
    			factor = 1
    			}
    		}
    	}
    }
    I will try without the OR tags... but I don't think that will fix anything..
    Last edited by 09camaro; 03-06-2011 at 03:31.

  19. #19
    Field Marshal Rylock's Avatar
    Crusader Kings IIDarkest HourEU3 CompleteDivine WindHearts of Iron III
    Heir to the ThroneVictoria 2

    Join Date
    Mar 2008
    Location
    Edmonton, Canada
    Posts
    8,590
    Quote Originally Posted by 09camaro View Post
    I'm currently working on a simple decision for the US that allows it to gain cores on the Maritime Provinces. And I would like to use the Ostend Manifesto decision as a guide, but I can't find it... And I can't figure out where it is.
    The Ostend Manifesto is in the ACW decision file.

  20. #20
    Sergeant 09camaro's Avatar
    Crusader Kings IIEU3 CompleteDivine WindHearts of Iron IIIHeir to the Throne
    Victoria 2

    Join Date
    Dec 2007
    Location
    in a cardboard under the stairs in the basement of a house half a block down the street from jerry's bait shop
    Posts
    66
    I had discovered it shortly after the post.. But I was too busy working on the coding to edit the post.. sorry. Though I have now..

+ Reply to Thread
Page 1 of 12 1 2 3 11 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts