• 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.
Hello,

I'm completely new to ck3 modding, but I do have some experience modding other games, and especially EUIV, so I have some idea on how stuff works.

What I don't get is how events are actually fired/triggered. Like, I started by trying to understand the events happening around the Viking bookmark. Now, both Aelle's execution and the death of Aethelred seem to be programmed in the same way - there is a set of conditions, and then something happens. But while Aelle's event happens immediately when the conditions are met, Aethelred's death seems to happen randomly, and I can't understand where that difference is programmed.

Maybe someone could explain or nudge me into the direction of some place where I can read up on this?

Thank you!
 
  • 1Like
Reactions:
Æthelred is highly stressed (shy) and impotent and is supposed to die to make way for his brother, but he is also an excellent difficult starting character to play. So although he often dies, I don't think it is pre-scripted.
 
Hello,

I'm completely new to ck3 modding, but I do have some experience modding other games, and especially EUIV, so I have some idea on how stuff works.

What I don't get is how events are actually fired/triggered. Like, I started by trying to understand the events happening around the Viking bookmark. Now, both Aelle's execution and the death of Aethelred seem to be programmed in the same way - there is a set of conditions, and then something happens. But while Aelle's event happens immediately when the conditions are met, Aethelred's death seems to happen randomly, and I can't understand where that difference is programmed.

Maybe someone could explain or nudge me into the direction of some place where I can read up on this?

Thank you!
Most events are now in CK3 fired from set on_actions at \\common\on_action\ and it's possible to add your own categories, too.
Events there can be always fired or randomly, usually from inside random_events = { } blocks under an on_action.

Of course events can still be triggered and fired from other events, decisions and character interactions.

https://ck3.paradoxwikis.com/Event_modding has some info
-------
Using Aethelred as an example the following happens :

In \\Crusader Kings III\game\common\on_action\game_start.txt right at the start under on_game_start
in the effect = { } block the first effect targets character ID 33358, which is Aethelred judging by the history files.

If he is alive and has a holding somewhere then an event is triggered on a random timer of 365 to 730 days.
Event id = bookmark.0001 which is located at \\Crusader Kings III\game\events\bookmark_events.txt right at the top there.

If the trigger = { } in this event is still true when the event happens 365 to 730 days from game start before character selection,
then it will immediately execute the following :

If Aethelred is at war, then a 20% chance of just being wounded or an 80% of being killed by an enemy in the war who is commanding an army.
If no commander of an enemy army is found then just a random enemy knight gets picked.

Then if such an enemy commander/or knight indeed is found this enemy character is saved as a scope called "knight". Who will then be the cause of Aethelred's death, the description of which being "death_hunting_accident".

But if Aethelred is not at war you'll skip the first IF statement and after it says ELSE, randomly with a 10% chance Aethelred gets cancer
or again dies with a 90% chance due to a hunting accident, but this time no killer is assigned.

So there's always a 20% chance of just him being wounded if he's at war and a 10% chance of getting cancer if not at war.

(The event trigger's criteria is that Aethelred is an AI character and that an heir exists, who is Alfred the Great. Otherwise the aforementioned event will not trigger)
 
Last edited:
  • 1Love
Reactions:
Is like create a trait create a modifiers?
I create a modificatore like:
Name = {
index = Number

name = Name
genetic = x
physical = x


birth = x
random_creation = x


general_opinion = x
same_opinion = x
monthly_piety = x
monthly_piety_gain_mult = x

ruler_designer_cost = x

desc = "x"

}
 
Most events are now in CK3 fired from set on_actions at \\common\on_action\ and it's possible to add your own categories, too.
Events there can be always fired or randomly, usually from inside random_events = { } blocks under an on_action.

Thank you, this was a perfect reply - you answered my question AND have additional info AND guided me towards further reading. Much more than I had hoped for, and very fast. :)
 
Is like create a trait create a modifiers?
...
Traits and modifiers are similar in that they are basically just a bunch of effects that can be given to a character.
However modifiers are usually much simpler in syntax and content and traits more complicated.

Both are created differently.

Modifiers only need the following :
Modifiers are located at \\Crusader Kings III\game\common\modifiers\
Code:
your_modifier_name = {
    icon = icon_name # like intrigue_positive, martial_negative, hunt_positive, prestige_negative
    # references to generic icon names are easy to find by just searching thru the files at \\common\modifiers\

    # Effects, such as
    scheme_power = 10
    scheme_success_chance = 5

    # stacking = yes # if you want your modifier to stack, leave the line out if not
}
Additionally a modifier only needs two lines of localization:
your_modifier_name:0 "The Name of Your Character Modifier Shown in Game"
your_modifier_desc:0 "The Description of Your Character Modifier Shown in Game"

Adding your finished character modifier to a character in code :
Code:
    add_character_modifier = {
        modifier = your_modifier_name
        years = 5
    }

A trait however is more complex and needs at least the following :
Traits are located at \\Crusader Kings III\game\common\traits\
Code:
your_trait_name = {
    index = 123 # no trait can have the same index as another trait, not sure if it can be higher than 999 however

    # some sort of effect like
    fertility = 10

    # is it shown in the ruler designer? leave the line out if yes
    # but add a cost, ruler_designer_cost = 80
    shown_in_ruler_designer = no

    desc = trait_your_trait_name_desc

}
A trait needs at least two lines of localization:
trait_your_trait_name:0 "The Name of Your Trait Shown in Game"
trait_your_trait_name_desc:0 "The Description of Your Trait Shown in Game"
- Notice that in localization your trait's actual name will need an added trait_ prefix before it

Biggest thing however is that a trait needs a trait icon.
Vanilla trait icons are located at \\Crusader Kings III\game\gfx\interface\icons\traits\
and in your mod's \\gfx\interface\icons\traits\ folder.

A trait icon needs to be named the same as your trait : your_trait_name.dds
A trait icon needs to be a .DDS texture file, dimensions 120x120, 24BPP, usually has mipmaps, and saved with no compression.

Adding your finished trait to a character in code :
Code:
    add_trait = your_trait_name
 
Last edited:
Honestly I have not idea what's the problem, I tried to make as suggested, but I read in the game the recall, and not the text that should be recalled
I checked the MIDC mod on the Steam Workshop and I think the only reason might be that your localization files need to end with _l_english.yml
(That's a lower case letter L, not a capital letter i there)

Like full file name MIDC_More_Immersive_Decision_and_Consequences_l_english.yml
 
Non riesco a far funzionare l'evento, non succede nulla né dopo il primo anno né dopo il 5:

Pay_the_merchant_ID.1 = {
type = character_event

nascosto = sì

trigger = {
has_character_flag = signatory_promissory_note
}

immediato = {
trigger_event = {
id = Pay_the_merchant_ID.1 # ora attiva l'evento effettivo che ricorda al giocatore
}
}

opzione = {
nome = "opzione"

trigger_event = {
id = custom_checker_event_ID.1
giorni = 365
}
}
}





effetto = {
add_gold = 300

add_character_modifier = {
modifier = signatory_promissory_note
anni = 5

}
trigger_event = {
id = custom_checker_event_ID.1
giorni = 365
}

}
 
Non riesco a far funzionare l'evento, non succede nulla né dopo il primo anno né dopo il 5:

Pay_the_merchant_ID.1 = {
type = character_event

nascosto = sì

trigger = {
has_character_flag = signatory_promissory_note
}

immediato = {
trigger_event = {
id = Pay_the_merchant_ID.1 # ora attiva l'evento effettivo che ricorda al giocatore
}
}

opzione = {
nome = "opzione"

trigger_event = {
id = custom_checker_event_ID.1
giorni = 365
}
}
}





effetto = {
add_gold = 300

add_character_modifier = {
modifier = signatory_promissory_note
anni = 5

}
trigger_event = {
id = custom_checker_event_ID.1
giorni = 365
}

}

Guarda il registro degli errori nella Documents/Paradox Interactive/Crusader Kings III/logs/error.log. Credo che i blocchi di codice e i comandi debbano essere etichettati in inglese; per esempio, «hidden» per «nascosto», «immediate» per «immediato», «days» per «giorni», eccetera. Inoltre, non è possibile utilizzare un'opzione in un evento nascosto; dovresti attivare l'evento custom_checker_event_ID.1 nel blocco immediato.

Sembra anche che tu stia cercando di attivare l'evento Pay_the_merchant_ID.1 in modo ricorsivo? Ma dove si è originariamente attivato? Linguaggio a parte, potrebbe non attivarsi mai in primo luogo se non viene attivato da un altro evento o «on action».

Check the error log in Documents/Paradox Interactive/Crusader Kings III/logs/error.log. I believe that code blocks and commands must be labelled in English; for example, 'hidden' for 'nascosto,' 'immediate' for 'immediato,' 'days for 'giorno,' &c. Furthermore, it's not possible to use an option in a hidden event; you should trigger the custom_checker_event_ID.1 event in the immediate block.

It also looks as though you're attempting to call the Pay_the_merchant_ID.1 event recursively? But where is it originally triggered? Language aside, the event may never activate in the first place unless triggered from another event or on action.
 
Last edited:
My error log now has suddenly started with a long list repeating the following lines 20 or more times. I have not sen this before. It seems to have no effect in game and it is in the log even if I progress no further than the main screen, which makes me wonder if it is something to do with the three figures loaded from your last game. However starting a new game has no effect.
Code:
[21:06:22][pdx_data_factory.cpp:843]: Failed to find type 'CharacterRef' in 'CharacterRef.Get'
[21:06:22][pdx_data_factory.cpp:850]: Could not find promote for 'CharacterRef' in 'CharacterRef.Get'
[21:06:22][pdx_data_factory.cpp:697]: Failed converting statement for 'CharacterRef.Get'
 
Hello Everyone, *****Apologies for the 3 messages - the spam-bot forced my hand :)*****

I am working on a mod that translates the game to my native language and for this I need to get into some 'light' modding. I have been struggling with an issue for days now, read the wiki and most of this thread but found no answers, so this is my last hope. Please help :)

On the Bookmarks screen I would like to insert a few characters behind the ruler's names based on their gender.

So in 'localization\replace\english\bookmarks\bookmarks_l_english.yml' - I insert this:

Code:
BOOKMARK_CHARACTER_TITLE:0 "[BookmarkCharacter.GetTitleTierName] of [BookmarkCharacter.GetTitleName] [BookmarkCharacter.Custom('HU_A_E')]"
 
In a 'common\customizable_localization\00_HU_custom_loc.txt' - I have the following very simple code copied from another language:

Code:
HU_A_E = {
    type = character
    text = {
        localization_key = CustomLoc_HU_A
        trigger = { is_female = no }
    }
    text = {
        localization_key = CustomLoc_HU_E
        trigger = { is_female = yes }
    }
}