You, my friend, are an absolute godsend. Thanks so much! Easiest fix ever!If you want to override vanilla localization entries your file needs to go inlocalization/<language>/replace
.
The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.
You, my friend, are an absolute godsend. Thanks so much! Easiest fix ever!If you want to override vanilla localization entries your file needs to go inlocalization/<language>/replace
.
Ah I see, I always searched the files for "global_flag", should have just gone with global. Thanks!I can't answer your first question, but the answer to the second is a definitive 'yes':—
Code:# set global variable set_global_variable = { name = mongol_empire_has_spawned value = yes } # to check for it in a trigger exists = global_var:mongol_empire_has_spawned
You can also save things other than a boolean as the value, such as a scope or a flag:—
Code:# set global variable as a character set_global_variable = { name = ruler_of_ganges value = root } if = { # to check for it in a trigger… limit = { exists = global_var:ruler_of_ganges global_var:ruler_of_ganges = { is_alive = yes } } # …and do something with him! global_var:ruler_of_ganges = { trigger_event = { id = south_asia.0013 #Someone else has taken my title days = 3 } } }
These are all adapted from vanilla code, just to give you examples.
1065.12.27 = {
death = "1065.12.27"
}
on_game_start = {
effect = {
root = {
trigger_event = {
id = fmaa.0002
days = { 2 200 }
}
}
}
}
How do I get an event to trigger for every player or the host player on game start? It seems simple enough to do but I just can't get it to work.
Code:on_game_start = { effect = { root = { trigger_event = { id = fmaa.0002 days = { 2 200 } } } } }
I'm guessing that root isn't correct here, but nothing else I've tried works.
trait_name = {
index = 7501
potential = {
is_female = no
}
Didn't think of that, but sadly doesn't work either. Tried every_player already, now with the after_lobby too, but nope.Did you already try using the next on_action block in that same file, called on_game_start_after_lobby = { } ?
The description says that it's "Like on_game_start, except it is called once the host (or player, in single player) exits the lobby..."
Also you might need to change root into every_player.
on_game_start_after_lobby = {
events = {
EVENT_NAME_ID.1
}
}
EVENT_NAME_ID.1 = {
type = empty
hidden = yes
immediate = {
every_player = {
trigger_event = {
id = fmaa.0002
days = { 2 200 }
}
}
}
}
Do you know how to access this variables from gui? Also do you know how can I access global lists from gui as well?I can't answer your first question, but the answer to the second is a definitive 'yes':—
...
To mark a character as dead in the history files (for characters that exist before the game begins), that is indeed all you need. You can also add various other things if you want, but they're not necessary.I've been searching the forums without any luck regarding the following. Please excuse me if otherwise (and please just direct me to anything related if exists).
I need to work with dead characters. I am assuming the required data to mark a character as dead is the following.
Is there any other requirement?Code:1065.12.27 = { death = "1065.12.27" }
Also, no right click interactions seem to exist for dead characters and I suspect they can't trigger events. Is there any way to work around these limitations with a mod?
I am considering creating a 'dead' copy of characters for this purpose but I would rather work with the original entity if possible.
Thanks in advance.
1066.10.14 = {
death = {
death_reason = death_battle
killer = 140
}
}
Not inDoes anyone know the correct way to limit a trait to only one gender? I rather stupidly thought it would be as follows but it sends the error report into a panic.
Code:trait_name = { index = 7501 potential = { is_female = no }
Should it just be potential = { is_male } ?
ps the error spewed out is:
Error: is_female trigger [ Wrong scope for trigger: none, expected character ]
potential
, but just in the root block of the trait:—valid_sex = all/male/female # Defaults to all, trait can only be had by characters of this sex
Customization points do nothing but block achievements. You can go over the limit without any other incapacitation, and since using a mod will disable achievements anyway, there's no need to cheat the limit in the first place. Go hog wild!Is there any mod or any vanilla way to cheat "customization points" in the ruler designer?
The mere existence of it makes me not want to play the game as a custom ruler.
I'm not entirely sure how to check for specific values from GUIs—honestly, the lack of documentation on how to work with them is quite a hindrance—but if you only need to check for the existence of the global variable, rather than its set value (i.e., if it's only going to be set to a boolean value), you can create a scripted gui that is only visible if the variable is set (it doesn't need to actually display anything, so don't worry about that!), then check for its visibility as a means of checking whether the variable is set.Do you know how to access this variables from gui? Also do you know how can I access global lists from gui as well?
One more thing does anybody know how to get bool values from gui, I already asked this question but nobody answered.
PS: Am I only one suffering huge amount of game crashes and freezes?
# common/scripted_guis/global_variable.txt
mongol_empire_spawned = {
is_shown = { exists = global_var:mongol_empire_has_spawned }
}
# in your GUI
datacontext = "[GetScriptedGui('mongol_empire_spawned')]"
visible = "[ScriptedGui.IsShown(GuiScope.SetRoot(GetPlayer.MakeScope).End )]"
visible
; I'm just using it as an example 'cause that's how I did things in my mod. You might also be able to use this to check for the other boolean values you need, but you'll have to play around with that, 'cause it's beyond my competency at that point.You can actually directly check if variable exist in gui and do some more things with them:I'm not entirely sure how to check for specific values from GUIs—honestly, the lack of documentation on how to work with them is quite a hindrance—but if you only need to check for the existence of the global variable, rather than its set value (i.e., if it's only going to be set to a boolean value), you can create a scripted gui that is only visible if the variable is set (it doesn't need to actually display anything, so don't worry about that!), then check for its visibility as a means of checking whether the variable is set.
Code:# common/scripted_guis/global_variable.txt mongol_empire_spawned = { is_shown = { exists = global_var:mongol_empire_has_spawned } } # in your GUI datacontext = "[GetScriptedGui('mongol_empire_spawned')]" visible = "[ScriptedGui.IsShown(GuiScope.SetRoot(GetPlayer.MakeScope).End )]"
You should be able to do the same thing in tags other thanvisible
; I'm just using it as an example 'cause that's how I did things in my mod. You might also be able to use this to check for the other boolean values you need, but you'll have to play around with that, 'cause it's beyond my competency at that point.
on_start = "[GetVariableSystem.Set('var_name', 'some_value')]" #this should set some value to it, but I not sure what type is that value
on_start = "[GetVariableSystem.Clear('var_name')]" #this should remove this variable
on_start = "[GetVariableSystem.Toggle( 'var_name' )]" #not exactly sure what it does
trigger_when = "[GetVariableSystem.Exists('var_name')]" #this is checking if variable exists and it is returning bool, this might be used, but it is not geting bool value of variable, but rather if variable exists.
text = "GetVariableSystem.Get( 'var_name' )" #this is returing variable as CString, so we cannot get bools this way
trigger_when = "GetVariableSystem.HasValue( 'var_name', 'some_value' )" #From what I understad this is comparing 2 strings values and it is returning bool. This can be used, but for me it is waste of resurces to compare 2 strings
visible = "[EqualTo_CFixedPoint( GetPlayer.MakeScope.Var( 'acs_sort_by' ).GetValue, '(CFixedPoint)1')]"
fixedgridbox = { #other container can be used as well
datamodel = "[GetPlayer.MakeScope.GetList('var_list_name')]"
#later for items:
item = {
widget_type_name = {
datacontext = "[Scope.GetCharacter]" // if we had a list of characters
}
}
}
datacontext = "[Character.MakeScope.Var( 'var_name' ).Title]" #Character is a scope from which this variable is retrieved
onclick = "[DefaultOnCoatOfArmsClick(Title.GetID)]" #usage of this variable
You don't actually need to write the date twice, justI've been searching the forums without any luck regarding the following. Please excuse me if otherwise (and please just direct me to anything related if exists).
I need to work with dead characters. I am assuming the required data to mark a character as dead is the following.
Is there any other requirement?Code:1065.12.27 = { death = "1065.12.27" }
death = yes
works fine. But what you have will work.You can actually directly check if variable exist in gui and do some more things with them:
Also this can be used for geting CFixedPoint value from Scope (in this case player character) and converting it comparing to some value and simulating a bool value (1 for true (yes), 0 for false (no)) :Code:on_start = "[GetVariableSystem.Set('var_name', 'some_value')]" #this should set some value to it, but I not sure what type is that value on_start = "[GetVariableSystem.Clear('var_name')]" #this should remove this variable on_start = "[GetVariableSystem.Toggle( 'var_name' )]" #not exactly sure what it does trigger_when = "[GetVariableSystem.Exists('var_name')]" #this is checking if variable exists and it is returning bool, this might be used, but it is not geting bool value of variable, but rather if variable exists. text = "GetVariableSystem.Get( 'var_name' )" #this is returing variable as CString, so we cannot get bools this way trigger_when = "GetVariableSystem.HasValue( 'var_name', 'some_value' )" #From what I understad this is comparing 2 strings values and it is returning bool. This can be used, but for me it is waste of resurces to compare 2 strings
Code:visible = "[EqualTo_CFixedPoint( GetPlayer.MakeScope.Var( 'acs_sort_by' ).GetValue, '(CFixedPoint)1')]"
But all of this does not solve a problem how to get bool variable directly. Not from global variables, not from scope variables. And getting bool variable directly would be ideal for performance.
About list, for now I know how to get variable list from the scope:
Code:fixedgridbox = { #other container can be used as well datamodel = "[GetPlayer.MakeScope.GetList('var_list_name')]" #later for items: item = { widget_type_name = { datacontext = "[Scope.GetCharacter]" // if we had a list of characters } } }
But I have no idea how to get global variable list.
PS: If someone is interested how to get scoped typed variable (in this example type of scope is Title) here is a code:
Code:datacontext = "[Character.MakeScope.Var( 'var_name' ).Title]" #Character is a scope from which this variable is retrieved onclick = "[DefaultOnCoatOfArmsClick(Title.GetID)]" #usage of this variable
The game grabs characters from there for stuff like inviting physicians or knights. Some characters are just generated to fill the pool, but it's also where characters go when they leave courts, if they don't immediately find another court to visit. However there is definitely a lot I don't understand about how it works, it's not very well-documented.Not sure of it’s the right place to ask, but can anyone explain to me the concept of character pools? ... or point me to some place where I can find info about it? ... in debug mode you have a map with colored character pools ... ok, so what’s up with that?