• 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.
Showing developer posts only. Show all posts in this thread.

Johan

Studio Manager Paradox Tinto
Administrator
Paradox Staff
Moderator
15 Badges
Dec 14, 1999
19.180
78.931
  • Diplomacy
  • Teleglitch: Die More Edition
  • War of the Roses
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis III: Collection
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Imperator: Rome Sign Up
  • A Game of Dwarves
  • Magicka
  • Starvoid
Hello, and welcome to another development diary about Crusader Kings II.

This time there are two subjects I want to talk in detail about, both related to something popular in this community, ie usermodding.

New file-system for Mods.

We have implemented a system in the game, where there is no need for a mod-dir system, and where the game files are loaded in the same way as any applied user-modification.

The game will allow enable/disable of any mod and/or dlc you have in your folders when you start the game.

Advantages of new system.
  • transparent for us when developing so there should be much less problems in the future when someone forgets to add mod support to some files
  • can load several mods at once
  • supports archives


example file structure
Code:
mods/my_cool_mod.mod
mods/my_cool_mod.7z

New file format
Code:
name = "My Cool Mod"
archive = "mods/my_cool_mod.7z"
dependencies = "some_other_cool_mod"
override =" flags"

- Name is just a name given to the mod for display purposes.
- Archive specifies a zip file that contains the files for the mods.
you also have the option of using "path" instead of archive with a normal directory, but we recommend using the zip archive for released mods because its less clutter on the player's computer.
- dependencies is a list of mod names. This means that you can set up a dependency chain and support having multiple mods loaded even if they might affect the same files. You can also depend on official DLC here. If dependencies are missing the mod wont be loaded.
- override specifies directories that will not be extended like normal, if you use this any previous loaded mods containing a directory in that list will not have that part loaded.

Event Scripting

We have also severly enhanced the scripting capabilities for CK2.

First of all we have added lots of triggers and effects to the language, which give you some rather powerful capabilities. While the game only have province and character events as entry points, an effect or trigger can switch scope to titles, wars & combats as well.

We have also made a system that random events can be run from what we call "pulses", so that you get one event each "time-period", so that when we add events, it will give more variety without the spam.


Another cool option is the "hidden_tooltip" effect, which allows the event-writer to have some hidden effects.
Code:
	hidden_tooltip = { prestige = 100 }

You can now also make event-chains that lasts over time much easier than before, with the new concept of "spawn event in the future at days x-y from now".
Code:
	character_event = { id = hedgeknight.1  days = 2 random = 5 tooltip = "They will get this in 2 to 7 days" }

It is also possible to have some options in an event only be available when certain conditions are true.
Code:
	option = {
		trigger = { trait = cruel }
		name = "I can only do this if cruel"
		prestige = 10
	}

Also, an option can have multiple effects, effects that depend on whatever conditions are true.
Code:
	option = {
		name = "Effect depends on stuff"
		if = {
			limit = {
				trait = cruel
			}
			piety = 10		#we become more pious if we are cruel.
		}
		if = {
			limit = { liege = { opinion = { who = root value = 25 } }
			scaled_wealth = 0.05	#get 5% more money if our liege has at least 25 relation with us
		}
		prestige = 10		#always get 10 prestige
	}

There is new terminology for scope-switching, and you can nest as many scope-switches as you'd like.
  • prev = previous scope.
  • from = who sent this event to us.
  • root = who got the event.

Events that target a character can use targeting mechanisms like from, prev, root, and also stuff like liege, prevprev, fromfrom and prevprevprev!



We mentioned earlier that you do not have to find unique id's for your event series and can instead just use a descriptive tag as base for your event series.
Code:
namespace = hedgeknight
character_event = {
	id = hedgeknight.0
	desc = "hedgeknight.0.desc"

	...
	option = {
		name = "hedgeknight.0.a" #Refuse them Access
		random_courtier = {
			character_event = { id = hedgeknight.1  days = 2 random = 5 }
		}
	}
 
Query: Does the file format have to be ".7z" or will an old-fashioned ".zip" or even a ".rar" work?

For what I do for my own benefit, I assume from what's been said so far that there's no need to zip the file up at all - but does that mean I have to specify each individual file, or just a directory?

I think that we'll support .zip, .7z and plain old directory in the end.
 
I can confirm it is very fun using if = { limit = { } }, hidden_tooltip = { } and be able to trigger different event options depending on different things (traits, treasury, relations and so on...) :)
 
This is incredibly amazing. I particularly love the "if" clause, at this rate the Clausewitz event engine will end up being Turing-complete. So many possibilities... :D

A couple of questions to settle some potential problems in my future mod: will it be possible to give titles to characters by event (even if they couldn't normally create/usurp it because they don't fulfill the requeriments)? And will it be possible to make a character a vassal of another by event?

yes