• 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.
In character_events, FROM is who triggers the event; ROOT is who gets the event. In province_events, it works rather similar except we're talking provinces instead of characters. So, if you have an event where the pope receives 50 gold from the Duke of Spoleto (who triggered the event with one of his own), the pope is ROOT, and the Duke is FROM.
And in cb_types, ROOT is the attacker, and FROM is the defender. FROMFROM is the claimant if you're pushing someone else's claim.
I wonder if one could use FROMFROM for event series?
 
And in cb_types, ROOT is the attacker, and FROM is the defender. FROMFROM is the claimant if you're pushing someone else's claim.
I wonder if one could use FROMFROM for event series?

I still don't quite understand FROMFROM and PREVPREV in events. I'm probably using more character and province flags than I should because of it. :blush:
 
Well, this doesn´t work properly if the ruler is an attacker in wars with some specific CB.
any_playable_ruler doesn't work either.

Thats odd, any_playable_ruler is used in quite a lot of the heresy events that ship with the game?

does num_of_king_titles or similar exist?

Sure does. It's used in one non-modded event too (#66050 - one where you may be asked to give up a kingdom to a family member if you have more than one).
 
I still don't quite understand FROMFROM and PREVPREV in events. I'm probably using more character and province flags than I should because of it. :blush:
PREV moves one scope up. PREVPREV moves two. And so on.
If I'd hazard a guess, I'd say FROMFROM is for event chains. FROM is the person giving you the event. FROMFROM is the person giving the event to the person giving you the event.

Also, I'd just like to correct my earlier assertion: ROOT is always the claimant. FROMFROM is the attacker. No scope (in non-title scopes) is also the attacker.
 
PREV moves one scope up. PREVPREV moves two. And so on.
If I'd hazard a guess, I'd say FROMFROM is for event chains. FROM is the person giving you the event. FROMFROM is the person giving the event to the person giving you the event.

Also, I'd just like to correct my earlier assertion: ROOT is always the claimant. FROMFROM is the attacker. No scope (in non-title scopes) is also the attacker.

That sort of makes sense. I'm working on an event series that sends events back and forth between lieges and their vassals so this should be helpful.
 
my questioned hasn't been answered from a while back...

just wondering if anyone knows of the use for --- set_variable = {} ??

thanks!
 
my questioned hasn't been answered from a while back...

just wondering if anyone knows of the use for --- set_variable = {} ??

thanks!
I`m not sure how it works in CK2, but in Victoria2 and older games you can create, set, change and check variables associated with countries. Why do you need them? Depends on what you want. For example, in Magna Mundi variables were used to measure factions strength, administrative efficiency etc.

Syntax is the following:
Code:
set_variable = {
	which = variable_name
	value = x
}
This command creates (if it didnt exist before) a variable variable_name and assigns it value x.
Same syntax is for change_variable (works like "+" sign) and check_variable.

I dont know whether all it works in CK2. I`ll try to check it. :)
 
Yes, variables work fine. :)

They do? THAT'S GREAT!! *dance, dance, dance of joy*

EDIT: so, you define it like in EU3. Now where do you define it? In a special file in common or in events?

Now, in EU3, variables work per nation. Do they work for each title in CK2? For each kingdom? Maybe we could use a guide to variables or at least a thread on it. Or at least a sample event file if you don't mind.
 
Last edited:
They do? THAT'S GREAT!! *dance, dance, dance of joy*
I created the following decision file:
Code:
decisions = {
	variable_create_decision = {
		potential = {
			ai = no
		}
		allow = {}
		effect = {
			set_variable = {
				which = test_variable
				value = 1.0
			}
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	variable_change_decision = {
		potential = {
			ai = no
		}
		allow = {}
		effect = {
			change_variable = {
				which = test_variable
				value = +1.0
			}
		}
		ai_will_do = {
			factor = 0
		}
	}
	variable_check_decision = {
		potential = {
			ai = no
		}
		allow = {
			check_variable = {
				which = test_variable
				value = 2.0
			}
		}
		effect = {
			change_variable = {
				which = test_variable
				value = -1.0
			}
		}
		ai_will_do = {
			factor = 0
		}
	}
}

All decisions work as expected. Variables are per-character.
 
Come on guys, it's such a strange question?

Look at text1.csv:

Code:
job_spiritual_pagan_group;Chief Diviner;Médium en chef;Oberster Wahrsager;;Gran Chamán;;;;;;;;;x
job_spiritual_zoroastrian_group;Chief Diviner;Médium en chef;Oberster Wahrsager;;Augur;;;;;;;;;x
job_spiritual_christian;Court Chaplain;Chapelain de la cour;Hofprediger;;Capellán;;;;;;;;;x
job_spiritual_muslim;Chief Qadi;Cadi en chef;Oberster Kadi;;Jefe Qadi;;;;;;;;;x
job_chancellor_arabic;Grand Vizier;Grand Vizir;Großwesir;;Gran Visir;;;;;;;;;x

Now use that as a model, such that <job_spiritual_german;Reverend;....> should work. Stress on should. Localising job titles works now, but not consorts for some reason.
 
Thanks! I was hoping for making variables for provinces, but this is useful.
Good news! Province variables are possible too. Here`s my test case:
Code:
decisions = {
	variable_create_decision = {
		potential = {
			ai = no
		}
		allow = {}
		effect = {
			location = {
				set_variable = {
					which = test_variable
					value = 1.0
				}
			}
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	variable_change_decision = {
		potential = {
			ai = no
		}
		allow = {}
		effect = {
			location = {
				change_variable = {
					which = test_variable
					value = +1.0
				}
			}
		}
		ai_will_do = {
			factor = 0
		}
	}
	variable_check_decision = {
		potential = {
			ai = no
		}
		allow = {
			location = {
				check_variable = {
					which = test_variable
					value = 2.0
				}
			}
		}
		effect = {
			location = {
				change_variable = {
					which = test_variable
					value = -1.0
				}
			}
		}
		ai_will_do = {
			factor = 0
		}
	}
}
Tested it with Philippe I and it works fine with variable in Paris province.
 
This day keeps getting better. Sorry for the gushing enthusiasm, but this is something that I thought wasn't possible. It would have saved many hours of working with province flags and really insane things to get things to work. This should help with modding holy orders and a lot of other things.
 
This day keeps getting better. Sorry for the gushing enthusiasm, but this is something that I thought wasn't possible. It would have saved many hours of working with province flags and really insane things to get things to work. This should help with modding holy orders and a lot of other things.

first of all thanks avee!

hey red! in what instances does this little code benefit CK2?... i saw it but i dont actually understand what it does lol, you explained the namespace event for me, could you be so grand and do the same here :D!
 
Last edited:
hey red! in what instances does this little code benefit CK2?... i saw it but i dont actually understand what it does lol, you explained the namespace event for me, could you be so grand and do the same here :D!

Anytime that you need to set a variable that needs to increase or decrease or be checked.

EDIT: for example, you could trigger a post-battle event to increase the number of battles a general won by one each time, with a certain reward for winning say ten battles, which could be checked as a variable. Just an idea. :)
 
Last edited: