r/victoria2 • u/COUNTRY_ADJ • 22h ago
Modding CreatineCore Modding Toolkit - IF ELSE_IF and ELSE operators
Hello everyone!
While further work on the new version of the CreatineCore Modding Toolkit is underway, we’d like to share the description of one of the patches from previous versions that has already been implemented into the project.
Most of you probably still remember how to emulate IF in Victoria 2 - that cumbersome construct with random_owned = { limit = { owner = } owner = { } } which dragged out the length of your event and decision effects for a decade. But finally, you now have a reason to throw random_owned into the trash can once and for all: CC MTK now features a built-in patch that allows you to use IF, ELSE_IF, and ELSE statements, much like it was in CK2.
For example, let's write a simple event that splits prestige among the world's countries just for existing:
country_event = {
id = 1500000
title = "Prestige Bonus"
desc = "It's so cool to feel alive!"
picture = "Celebration"
is_triggered_only = yes
option = {
name = "Well, why not?"
if = {
limit = { is_greater_power = yes }
prestige = 100
}
else_if = {
limit = { is_secondary_power = yes }
prestige = 50
}
else = {
prestige = 25
}
}
}
So, if the country where this event pops up is a great power, it gets 100 prestige; if it's a secondary power, it gets 50; and if it's neither, it gets 25.
Let's see how it will work in the game:
Each statement can be used independently:
- A single
ifblock simply triggers the effect if its conditions are met. - Likewise, a single
else_ifwithout a precedingifworks the same way. - A standalone
else... is just a meaningless scope. ifandelse_ifcan, of course, be used without a concludingelse.- If you insert another effect between any of these blocks, each subsequent block will simply start a new chain, as if it were a new
if.
Thanks for watching, and...
Yesterday we launched our own Discord server, so feel free to join in on the project discussions
Also, make sure to check out our GitHub where you can find the latest CreatineCore release
And, of course, don't forget to visit the Unofficial Patch 3.05 page on ModDB











