- Dec 14, 1999
- 22.005
- 258.826
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.
example file structure
New file format
- 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.
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".
It is also possible to have some options in an event only be available when certain conditions are true.
Also, an option can have multiple effects, effects that depend on whatever conditions are true.
There is new terminology for scope-switching, and you can nest as many scope-switches as you'd like.
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.
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 }
}
}