• 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.
I've not tried it myself (but I haven't written that many events), however the base game uses it for a lot of the templar/hospitler events (in their triggers and their options).
 
I've added a section describing scopes, and another section talking about how events are triggered (MTTH, triggered_only, or on_actions).

Which means I think I'm done on the event syntax (except for when I run across a trigger in someone else's event which looks new).
 
Speaking of events, would someone be able to script a very simple one for me?

I usually play with England starting out as Feudal Elective (for the Saxons) and whilst this is fine should the Norse win, it's obviously not a good way to represent the Normans. How would I write an event that changes England's succession type to Primogeniture should the Normans win? This is particularly for the AI of course.

Thanks. :)
 
The trigger is the hard bit of that event. I think it would go something like this:
primary_title = {
title = k_england
has_law = succ_feudal_elective
}
culture = norman
not = { year = 1100 }

Not 100% sure about where the scope of the has_law section though. This is where I'd start trial and error with one of my own events.
 
Here is something that I learned doing my CAT events mod:

You can't actually add anything using FROMFROM. You can trigger another event, sure, and use localisation display codes, but you can't add prestige, a character modifier, minor title or trait that way. FROM you can, but not FROMFROM. I hope that this might save one of you an hour or two of debugging.

In my case, I had an event where a squire pressed his guardian to have him knighted. Guardian event (squire is now FROM) makes the guardian decide whether to accept this or not and if so trigger an event for the liege to preside over the knighting ceremony or if he is the liege trigger an alternative event. So after all that, I came to testing the knighting ceremony. The liege was being billed for the gifts he was giving the newly minted knight, but the new initiate did not receive the right effects, which is the knight minor title. So I figured out that I could trigger an event to handle this, though:

Code:
FROMFROM = { character_event . . .
 
I have a problem with my event option. For the first option, sometimes both possibilities are realized and for the second option, the second portion isn't taken into account

option = {
name = "EVTOPTA160000"
random = {
chance = 50
owner = { reverse_religion = ROOT
piety = 50 }
}
random = {
chance = 50
add_province_modifier = { name = heretic_stronghold }
owner = { letter_event = { id = 160001 days = 3 } }
}
}
option = {
name = "EVTOPTB160000"
owner = { piety = -50 }
character_event = { id = 160002 days = 3 } }
random = {
chance = 60
add_trait = craven
}
}
 
It's the random factor. You have a 50 percent chance of getting either part of option (a) and a 40 percent chance of nothing happening in option (b), besides the char event.

You might want to try random_list (search in the vanilla events folder for some examples).
 
Hi,

I wanted to first thank you for this thread. It's been a tremendous help for me, and I've managed to successfully code my first event, in that it technically works as it should. However, I seem to having a couple of problems, so if anybody can answer my questions, I'll be grateful.


Firstly, for some reason, the text for the event is not displaying. I already have the text typed up in the localisation folder, but the game simply displays the line I put in the text document (i.e. the desc and option name). So if the code below is my event, then in the description, it'd say "life.event.1" instead of something like "Today I did this and that and this." Previously I tried having it as "EVTDESC123456789" but the game also displays "EVTDESC123456789" in-game, even though I do have text in the localisation. I suspect there's nothing wrong with the code itself for this matter, but it perhaps is something related to the localisation. Do I have to do the localisation in a certain way? I copied exactly from the original game's .csv files, but I just noticed that some of the entries were spread across different columns, rather than one column - if I have to do that, how do I know how to spread it across columns, like do I just put a word or two in each column, or do I have to do it a certain way?

Secondly, I'm still a bit confused about events start. For the code below, I just copied from one of the vanilla events; however, I don't know if this event will trigger randomly in-game (so far I've only brought it up using console commands). So I guess my question is this - will this event, with the current code I have now, be able to fire up randomly so long as the triggers are met? Or do I have to add a line or remove a line (like the is_triggered_only = yes)?

I hope I wasn't too confusing, and I want to thank you in advance for everybody's help. I've provided the code of my event below for reference:


##Charitable - Give Beggar Money##
character_event = {
id = 123456789
desc = life.event.1
picture = GFX_evt_market

min_age = 16
capable_only = yes
prisoner = no
is_triggered_only = yes

trigger = {
trait = charitable
in_command = no
}

mean_time_to_happen = {
days = 1

modifier = {
factor = 1.1
trait = kind
}
}

option = {
name = life.event.1a #Give a little bit of money
piety = 10
treasury = -1
}

option = {
name = life.event.1b #Give entire purse
piety = 25
treasury = -5
}
}
 
is_triggered_only = yes means it won't fire unless triggered. You'll need to put it in a file in the common/on_actions folder (probably in one of the random_events sections) for it to happen.
 
is_triggered_only = yes means it won't fire unless triggered. You'll need to put it in a file in the common/on_actions folder (probably in one of the random_events sections) for it to happen.

Or remove the is_triggered_only (in which case charitable people will get the event all the time)

Any chance we could get the line from localisation file which you are trying to use?
 
Thanks richvh and Fawr for the replies! Much appreciated.

Or remove the is_triggered_only (in which case charitable people will get the event all the time)

Any chance we could get the line from localisation file which you are trying to use?

When you say "charitable people will get the event all the time", do you mean that a charitable person has a chance of getting it at any moment?

Here's the lines from the localization file for the event description and the two event options; all entries are only in one cell:


life.event.1;While traveling one day, I came across a persistant beggar asking for some spare change.;While traveling one day, I came across a persistant beggar asking for some spare change.;While traveling one day, I came across a persistant beggar asking for some spare change.;;While traveling one day, I came across a persistant beggar asking for some spare change.;;;;;;;;;x;
life.event.1a;Give him a bit of coin, for he needs it more than me.; Give him a bit of coin, for he needs it more than me.; Give him a bit of coin, for he needs it more than me.;; Give him a bit of coin, for he needs it more than me.;;;;;;;;;x;
life.event.1b;Look at him! His suffering is too much for me to bear. Here, give him my entire purse.; Look at him! His suffering is too much for me to bear. Here, give him my entire purse.; Look at him! His suffering is too much for me to bear. Here, give him my entire purse.;; Look at him! His suffering is too much for me to bear. Here, give him my entire purse.;;;;;;;;;x;



Thanks again for all the help, it's much appreciated!
 
If you're going to remove the is_triggered_only line, then greatly increase the mean_time_to_happen or your charitable characters are going to be accosted by beggars every few days.
 
Hi all - first time poster here

I have been playing around with events and thought of spicing things up by taking some Feast Events out of the Feast environment so they occur without a Feast being held. I have thought about starting with: -

#Host or Host's son "falls in love" with unmarried daughter of vassal
character_event = {
id = 72090

From what I understand to do this I will have to:-
a) Create a new event and save it in the Events folder
b) Change the event id number and associated EVTDESC and EVTOPT numbers in the event itself and add new ones in text1.csv
c) Remove limits such as "has_character_flag = host_feast_started" and "has_character_modifier = holding_large_feast"

But I am concerned by a few things:-
1) The initial trigger is "only_men = yes/capable_only = yes/prisoner = no" and makes no reference to the Leige or being the Leige's son. So my first question is how to get the trigger to work for any of the Leige's sons (not necessarily the heir) and not any other man?

2) Outside of the Feast environment the Leige's son and the unmarried daughter will most likely be in different locations (I assume during the feast the script identifies them as being at the same location) so how do I make sure they are the same loacation or is that not an issue?

3) Later on in the script there is only a trigger that calls
#Liege or liege's son seduced my daughter!
is_triggered_only = yes
option = {
name = "EVTOPTA72092"
trigger = {
FROM = {
father = {
has_character_flag = host_feast_started
has_character_modifier = holding_large_feast
}
}
}

So if I remove the "has_character_flag = host_feast_started" and "has_character_modifier = holding_large_feast" I will be left with
FROM = {
father = {
}
}
Is this valid?

Other related yest random questions
4) Is there a way so that you can script events using ROOT and FROM (or any other means) that has no interaction with the main character (say for example you can can get 1 son to communicate with a 2nd son and have random options available. Example son1 challenges the son2 to a duel and possible outcomes could be a) yes - duel takes place - random son injured b) no - son2 forfeits prestige to son1 c) Son2 informs Leige

5) Can someone tell me how to initiate communication between a spouse to the character. Can I just use "spouse =" or do I have to use "spouse = ROOT"

6) On a similar theme to 5) how about lover or heir?

7) Lastly how do add a lover in the CHARACTER_TOOLTIP_DELAYED in text1.csv

Thanks in advance - Great board BTW
 
Do you want this to work only with the top level liege's sons, or any level ruler?