Crusader Kings 3 Dev Diary #30 - Event Scripting

Crusader Kings 3 Dev Diary #30 - Event Scripting

  • Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning

RelVleDy

CKII Static Portrait Guru
28 Badges
Jul 13, 2008
613
786
  • Crusader Kings II: Way of Life
  • Crusader Kings III
  • Prison Architect
  • Crusader Kings II: Holy Fury
  • Shadowrun Returns
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Pillars of Eternity
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
this code is terrible, let us use a proper language, any normal programming language, python whatever, anything but this!
One of the advantages to Paradox's code is its simplicity. I'm not a programmer, yet even I was able to mod heavily with CKII. In about 1-2 days of self-learning, I was creating custom events, new traits, and a new religion. I can't imagine how long it would have taken me otherwise. I get what you're saying though that if you're an experienced programmer, it might seem frustrating, but as a non-programmer, it helped me out a lot.
 
  • 5
Reactions:

jumbi

Elder Councillor & Servant of the Masters
89 Badges
May 18, 2013
551
638
  • Stellaris: Galaxy Edition
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: Pre-order
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • A Game of Dwarves
  • Stellaris: Galaxy Edition
  • Steel Division: Normand 44 - Second Wave
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Sons of Abraham
  • Age of Wonders III
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Legacy of Rome
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Stellaris: Synthetic Dawn
  • Crusader Kings II: Rajas of India
  • Crusader Kings II
  • Magicka
  • Europa Universalis IV: Res Publica
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Stellaris Sign-up
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
I get what you're saying though that if you're an experienced programmer, it might seem frustrating, but as a non-programmer, it helped me out a lot.
As an experienced programmer, CK2's scripting language is perfectly serviceable. The new tools previewed here plus other general features of the latest Clausewitz and Jomini will make it even better
 
  • 5
  • 2
  • 1
Reactions:

Nicolas-frm

Major
27 Badges
Oct 24, 2015
594
654
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Wealth of Nations
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Crusader Kings III
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Europa Universalis IV: Golden Century
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Rome: Vae Victis
  • Victoria 2: A House Divided
  • Victoria 2
  • Stellaris: Synthetic Dawn
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Rome Gold
this is not actual scripting, these are data structures and we can set values... you should provide a .NET api, there are many things I am unhappy with in ck2 I wish I could just fix myself. Give us a .NET api and let us fix the game ourselves

this code is terrible, let us use a proper language, any normal programming language, python whatever, anything but this!
Yeah I don't think this is a good idea to be honest. This code is simplified enough for any gamer to learn how to mod. Using other programming languages will make it more difficult and no one will want to learn C++ or python just to be able to mod CK3.
 
  • 7
Reactions:

Sushurashi

Sergeant
39 Badges
Sep 16, 2018
83
144
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Cadet
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Galaxy Edition
  • Cities: Skylines
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Stellaris - Path to Destruction bundle
  • Stellaris
  • Stellaris: Synthetic Dawn
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Imperator: Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
Thing is modders are extremely important to many aspects of the CK community. Those groups need to know if they will be able to transition from one game to the next.
Not just the modders, but the people who love playing those mods will also want to know if the mods (especially the total conversion mods) will make an appearance in CK3. The easier the game is to mod, not only will it be more likely that widely loved mods will make an appearance, but the sooner those mods will get translated.
 
  • 3
  • 1Like
Reactions:

DaJay42

Second Lieutenant
39 Badges
Jan 31, 2018
164
386
  • Crusader Kings II
  • Crusader Kings II: Holy Fury
  • Crusader Kings III
  • Europa Universalis IV: Mandate of Heaven
  • Age of Wonders III
  • Hearts of Iron III
  • Cities: Skylines
  • Cities: Skylines - Mass Transit
  • Shadowrun Returns
  • Stellaris
  • Stellaris: Distant Stars
As much as I love the customisable religions, and as interesting as the stress mechanic seems, I think the improvements to the scripting language might in the long term be the greatest addition to the game; I do like me some modding after all.
 
  • 2
Reactions:

LeSingeAffame

Loyal ally to Durcorach the Black Drake
71 Badges
Sep 16, 2012
3.446
1.176
  • Crusader Kings II
  • Crusader Kings III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Conclave
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Holy Fury
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Distant Stars
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
As much as I love the customisable religions, and as interesting as the stress mechanic seems, I think the improvements to the scripting language might in the long term be the greatest addition to the game; I do like me some modding after all.
Customisable religions in itself opens great opportunities for modders, as changing religions mid-gameplay was a bit of a chore if you didn't stick to just what the base game offered
 
  • 2
Reactions:

wickermoon

Lt. General
75 Badges
Jan 10, 2013
1.249
382
  • Crusader Kings II
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mare Nostrum
  • Tyranny - Tales from the Tiers
  • Pillars of Eternity
  • Europa Universalis IV: Pre-order
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • March of the Eagles
  • Magicka
  • Knights of Pen and Paper +1 Edition
  • Heir to the Throne
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Crusader Kings III
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
@blackninja9939 I don't remember if it's ever been asked, mostly because I haven't paid too much attention to the scripting part of CK(3), but is it theoretically possible to script new inheritance laws? And if not - if they're hard-coded - would it be possible to open up hard-coded inheritance laws just enough so as to modify how they...divide the estates, for example? I'm thinking specifically about Gavelkind.
 

ziggystartdust

Recruit
2 Badges
Sep 5, 2020
1
1
  • Crusader Kings II
  • Age of Wonders III
Thanks for the in-depth description. I have a question and I feel it might be a place to ask it.
The Wiki says AI characters will use Decisions and Character Interactions based on the attributes. Energy determines how often the character will consider a Decision.
Does it mean that if my character is ambitious (+75 energy) I'll get more events triggered? And if he is lazy (-50 energy) I'll have fewer opportunities to choose some answers from a list? If yes, how much does it influence the event occurrence?
 
  • 1Like
Reactions: