-
Notifications
You must be signed in to change notification settings - Fork 1
scripting_3_events
Ok, time for events. This, like common, is a main game folder. However, unlike common, this doesn't define all the things in the game. This is just events, plain and simple. As such, subfolders don't really matter here. They serve only as a means of organization, not separating different things that are defined.
For once, here, we have an actual guide on the wiki for how to mod:
https://ck3.paradoxwikis.com/Event_modding
{width="3.0in" height="7.365277777777778in"}So why are events important? Events dictate how a character's life goes, just as much as the wars and diplomacy and all that. They add flavor and make characters dynamic. They are also the very first thing I recommend a new modder start with. They provide a good way to understand the script and are a good way to quickly get a grasp on scripting.
So, let's go over the structure of an event. Here, we have a character event. First, we have a namespace. Every events file [MUST]{.underline} start with one of these, no matter the event type, and every event name [MUST]{.underline} start with the name defined by the namespace, then .numberID. These numbers can be arbitrarily picked.
Type can be character_event or letter_event (I will give an example later on.) Title and desc, and name (for options) define the loc keys for those things. Desc is the actual event description, title the event title, and name is the option's text.
Trigger in the event must be met or the event won't even happen for you, while trigger in the option determines if the option will show. If you're brave, the event will show up, while if you're not zealous, you still won't see the first option but only the second. That said, trigger is not necessary and the game will default to it always showing.
The theme determines the icon and even background, they can be found listed on the website above. Left_portrait, right_portrait, lower_left_portrait, lower_center_portrait, and lower_right_portrait adds characters that show up on the events. Character requires a scope and animations can also be found on the website.
The immediate block runs the effects in it right as the event opens, which is useful for getting scopes before the event shows. Options (which I assume are self-explanatory) require a name and then you can just add effects. Finally, after = {} applies its effects after an option is selected. So here, a character first gets 200 prestige, then either 70 or 20 gold, and then finally you die. (probably not worth it.) You can add an ai_chance = {} block to options, I should note.
{width="2.1878051181102363in" height="1.6356452318460193in"}Hidden events are events that don't show up. They're simple enough and all they need/can have are these three lines/blocks. They can be used if you want something to happen to a character that you don't want said character to see. They're mostly used for maintenance, and there's not much to say about them.
{width="3.448397856517935in" height="5.386167979002624in"}Letter events are the final type of event. They need an opening, which the loc of which goes along the lines of "Greetings, random guy," a description, which is the text of the letter, and a sender, which is the only portrait this type of event can have. They have options, triggers, ai_chances, immediate ={}, and after = {} like normal events as well.
Something that should be understood is that all events need at least one event to show up for a character. Furthermore, if none are valid for a character, the event also won't show up.
Events can be triggered with the effect trigger event, like as shown below:
trigger_event = example_event.1003