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

ExuberantTopHat

Corporal
20 Badges
May 6, 2020
36
35
  • Crusader Kings III
  • Europa Universalis IV
  • Cities: Skylines - Campus
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines Industries
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Holy Fury
  • Victoria 2
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Crusader Kings II: The Old Gods
  • Cities: Skylines
  • Stellaris
  • Cities: Skylines - Parklife
Howdy. I have no modding experience but had a neat idea for an event chain that could be added to Crusader Kings II. I've heard that modding isn't terribly complex and was wondering if it was something that could be learned easily. To clarify, I am not planning on trying to completely overhaul the game. I simply want to add a few events, several of which would have an effect on character stats. Is this within the scope of possibility?
 
There are limits to what you can do, and only you will be able to figure out if your ideas are possible. I suggest starting reading this and this, to get started on modding.
 
  • 1Like
Reactions:
Thank you for the links. They have certainly helped me begin to understand exactly how to "code" mods. Regarding your first point. The mod I am planning is a simple three-part event chain (one main event and two possible branch events) so I'm guessing that won't be too difficult to deal with.

How does one actually get into the txt file in order to add a mod? Am I going into it via the "mod" folder or through some other method? Additionally, Is there an easy way to sandbox the mod in order to check if it works or not before actually putting it into the game? Final question: can CK2's in-game artwork be used for new mods? Thank you. Sorry for all of the questions.
 
This will help you find out how create a mod from scratch. There's no sandbox - anything you create or adjust will be in the game if you enable your mod. Yes, vanilla artwork can be reused.
 
Thank you. I appreciate your help.
 
So, as I gather. The attached is the general format for an event. The #s and the <>s have to be filled out, no?


Code:
namespace = <namespace>
<event_type> = {
  #Basic event information
  id = <namespace>.<id>
  desc = EVTDESC<namespace>.<id>

  #Fast event triggers
  only_playable = yes

  trigger = {
    #Event eligibility condition block
    religion_group = pagan_group
  }
  mean_time_to_happen = {
    #Randomness of the event (not applicable for triggered-only events)
  }
  immediate = {
    #Command block executed once the target is eligible, but before displaying the event
  }
  option = {
    name = EVTOPTA<namespace>.<id>
    trigger = {
      #Option A eligibility condition block
    }
    ai_chance = {
      #Option A modifiers
    }
    #Option A command block
  }
  option = {
    name = EVTOPTB<namespace>.<id>
    trigger = {
      #Option B eligibility condition block
    }
    ai_chance = {
      #Option B modifiers
    }
    #Option B command block
  }
  after = {
     #Command block executed after any option is chosen. It is the counterpart of the immediate block.
  }
}
 
Correct. There are a few more things you can use, but you'll likely not need any of them for your first events.

Is there a way to reverse engineer the events from a pre-built event? The template is obviously a good start but is there a functional event that could be viewed for reference in order to back into the event creation?
 
Is there a way to reverse engineer the events from a pre-built event? The template is obviously a good start but is there a functional event that could be viewed for reference in order to back into the event creation?

All events are scripted, so you can find them in the game's files. If you use console command 'charinfo', the game will let you know the ID of the event. If you also add the following lines to your settings.txt file, you can press Control + right click on an event option to open the right file, accurate to the very line that event option starts:

Code:
text_editor="C:\\Program Files\\Notepad++\\notepad++.exe"
text_editor_postfix=" -n$"

Adjust to your path and preferred editor, of course.
 
Last edited:
  • 1
Reactions: