• 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.
Okay, this isn't so much of a question as it is an anguished muffled cry of maddened frustration into a pillow.

84d01b34e43b9b0d6e2b78c17712d242.gif


I realised I hadn't rewritten the description text for the Hellenism religion. So I added it to my localization file, along with the other religions I'd previously added. But no changes appeared. It still showed up exactly the same as before.

As an experiment I put in different nonsense words to highlight what, if anything, was working and what was not. BOOP, DOOP, WOOP, and POOP. And to my amazement, Hellenism was listed as a DOOP faith! But change it to anything other than DOOP and it switched right back to Greco-Roman! The same with BOOP! Why does the game like DOOP but not anything else? Why is it determined to send me insane?

(You gained 70 stress because you are calm (critical). You gained the trait Lunatic)
 
Last edited:
  • 2Haha
Reactions:
Okay, this isn't so much of a question as it is an anguished muffled cry of maddened frustration into a pillow.

I realised I hadn't rewritten the description text for the Hellenism religion. So I added it to my localization file, along with the other religions I'd previously added. But no changes appeared. It still showed up exactly the same as before.

As an experiment I put in different nonsense words to highlight what, if anything, was working and what was not. BOOP, DOOP, WOOP, and POOP. And to my amazement, Hellenism was listed as a DOOP faith! But change it to anything other than DOOP and it switched right back to Greco-Roman! The same with BOOP! Why does the game like DOOP but not anything else? Why is it determined to send me insane?

(You gained 70 stress because you are calm (critical). You gained the trait Lunatic)
Did you try to replace entire original file (with same path)?
 
Did you try to replace entire original file (with same path)?
It's a new file, and it's working fine for two new religions, but not replacing the localization for the existing Hellenism (it's in the same path though). I don't want to have to copy all the original file with the same name and path as that would make it incompatible with other mods.

...and I'm only now realising that I had been working on the assumption that the game would always override vanilla game tags with a mod but I've never actually done so with localization - just thought I had.

So yeah, I'm going to need to make my own version of the whole damn pagan religion localization file, aren't I? Bugger bugger bugger.

e06b6bb1cbde252956f7b1c40071d753.gif
 
Last edited:
If you want to disable family generation globally (or for players), you can do that with the 'Generate Families' rule. Disabling it for a specific character is trickier, but fortunately the existing generation function provides a template for how you can do so, since it already specifically excludes Matilda of Tuscany. So take a look at game_rule.1001 in events/game_rule_events.txt and overwrite it as necessary in your mod. :)



I presume the latter, though rather than worrying about coding an event, I'd make an on action and call it from on_game_start.

Code:
# common/on_action/historic_alliances.txt

establish_alliances = {
    # Do stuff
}

on_game_start = {
    on_actions = {
        establish_alliances
    }
}
I have copied and edited the game_rule.1001 to game_rule.1002:
Question: Do i have to create something for the new game_rule.1002 somewhere like in localization? (If, where?) I have searched for something that calls the game_rule.1001 in localization , but i didnt found anything. Thx for your help :)
game_rule.1002 = { #by Eragon
type = character_event
hidden = yes

trigger = {
is_from_ruler_designer = no # Do not modify the family of somoene from the ruler designer
#Is in need of family
NOT = {
exists = player_heir
}
#Allowed to get family
NOT = { # Otherwise historical characters sometimes generate inappropriate children
any_child = {
always = yes
}
}
NOR = {
has_trait = celibate
has_trait = eunuch
}
age >= 17 #Because you need ~1 year of pregnancy
is_landed = yes
primary_title = {
is_mercenary_company = no
is_holy_order = no
}
NOR = {
has_government = republic_government
has_government = theocracy_government
AND = {
exists = character:1100000 #I have created a custom character with this id
this = character:1100000 #Eragon, her bookmark start is about overcoming the issue of no heir
}
}
}



immediate = {
if = {
limit = { faith = { has_doctrine_parameter = marriage_event } }
add_character_flag = ignore_marriage_event
}
game_rule_create_spouse_and_children = { CHARACTER = root }

#In case your created player heir is an older woman (past childbearing age or with a very short window)
if = {
limit = {
exists = player_heir
player_heir = {
is_female = yes
age >= 40
}
#Nothing else should need to be checked, they shouldn't be celibate or something like that
}
player_heir = {
save_scope_as = childless_heir
game_rule_create_spouse_and_children = { CHARACTER = scope:childless_heir }
}
}
}
}
 
I have copied and edited the game_rule.1001 to game_rule.1002:
Question: Do i have to create something for the new game_rule.1002 somewhere like in localization? (If, where?) I have searched for something that calls the game_rule.1001 in localization , but i didnt found anything. Thx for your help :)

You shouldn't need to, I don't think—since it's a hidden event, there's no localization to show!

If something's not working, be sure to check Paradox Interactive/Crusader Kings III/logs/error.log in your documents folder and it should hopefully point you in the right direction.

Does anyone know what the specific conditions are for using the so-called 'interface triggers'? The wiki very unhelpfully says they 'can only be used in specific places,' and the error log likewise gives me the lovely notice that I'm 'reading an interface trigger in a forbidden area,' but neither tells me how or where I can use them.

The context, if it helps, is that I had an event which checked whether nudity was allowed by the game rule, altering the title, description, outfit, and animations to handle it differently depending on whether the character was clothed or not. This worked fine in 1.1.3, but 1.2 changed nudity from a game rule to a setting, and the new trigger, should_show_nudity, seemingly can no longer be used as broadly as I'd been using its predecessor, resulting in errors the which I'm really at a loss to address.

I'm a bit worried I'm going to have to completely redo the whole event so it localizes the same regardless of whether the character is naked, and that'd really take a lot of variety out of the event. :(
 
It's a new file, and it's working fine for two new religions, but not replacing the localization for the existing Hellenism (it's in the same path though). I don't want to have to copy all the original file with the same name and path as that would make it incompatible with other mods.

...and I'm only now realising that I had been working on the assumption that the game would always override vanilla game tags with a mod but I've never actually done so with localization - just thought I had.

So yeah, I'm going to need to make my own version of the whole damn pagan religion localization file, aren't I? Bugger bugger bugger.

e06b6bb1cbde252956f7b1c40071d753.gif
If you want to override vanilla localization entries your file needs to go in localization/<language>/replace.
 
  • 1
  • 1Like
Reactions:
Does anyone know where the Red/Green glow effect for personality traits is located? It used to be in the window_character.gui file, but after the update it is gone. Thanks.
 
I'm trying to figure out how to increase the amount of opinion that gets added in subsequent calls. I have the following code block:

Code:
add_opinion = {
    modifier = angry_opinion
    target = scope:actor
    opinion = {
        subtract = 25
    }
}

But each call appears to overwrite the previous, I want it to be additive instead (e.g. each call subtracts 25 from the existing value). I haven't been able to find any examples of this in the existing code so was curious if it's possible?

EDIT:

After some digging I found out about stacking. angry_opinion is under the #Stacking Opinions section but doesn't stack so you have to define your own modifier or use one with stacking. You also need to create the corresponding localization string to go along with it.

Code:
my_own_modifier = {
    opinion = -20
    monthly_change = 0.1
    decaying = yes
    stacking = yes
    max = 5
}

add_opinion = {
    modifier = my_own_modifier
    target = scope:actor
}
 
Last edited:
Edit: Figured it out, for anyone else out there: The value the AI gives certain regiments is called ai_quality. It's in the block where you define the Men-at-Arms. The value it refers to is in script_values/00_men_at_arms_values. Cultural men at arms however have their own value, which is defined at the top of the cultural_maa_types.txt. I was simply looking for answers in the wrong spot.


hope it is okay for me to be posting multiple questions in a relatively short amount of time, I couldn't post an answer to a post because apparently I was flagged as spam? Anyway, here goes, first question:

Does anyone know how exactly the AI decides which men at arms to buy?
So far I have found a formula in 00_ai.txt which is basically (Toughness*10+Attack*10+Pursuit*3+Screen)/cost*stack_size

So that is basically the score. Now in the men_at_arms_values there are some weight shifts for certain culture groups. What I don't quite understand is whether these increase the weight of buying the standard men-at-arms type or just the basic unit. That is because, for example, it decreases the weight of archers being chosen if your culture has the forest wardens innovation. That would point to it only decreasing the weight of the standard bowmen, since it would otherwise prevent it from picking the Metsänvartija unit aswell. However, if I increase the weight for certain regiments I have created, they still rarely pick those, if at all. Even with an increase of 1000 to the weight of the custom units, they still mainly choose their cultural regiments. Is there a way to see their weighting in debug mode? Or is it a modifier to cultural men at arms I haven't found yet? Or just a flag that I have missed that marks them as cultural units. Any pointers would be helpful.

On another note, said weight modifiers are located in common/script_values. I created my own .txt in that location (with another name of course). All values for the cost of my custom men at arms work, but I have no way of knowing whether the same goes for the ai weight values. Could my mistake lie there?

So that's basically the question, am I missing something here or did I just fuck up the files? Any help would be greatly appreciated. If I don't get it to work I'll still upload it tomorrow, maybe that will make it easier to understand.


Second Question: Is there such a thing as global flags? For example to disable a decision after an event has triggered that flag.
 
Last edited:
Is there such a thing as global flags? For example to disable a decision after an event has triggered that flag.

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.
 
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.
Ah I see, I always searched the files for "global_flag", should have just gone with global. Thanks!
 
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.
Code:
1065.12.27 = {
        death = "1065.12.27"
    }
Is there any other requirement?

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.
 
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.
 
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.

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.
 
Does 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. :rolleyes:
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 ]
 
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.
Didn't think of that, but sadly doesn't work either. Tried every_player already, now with the after_lobby too, but nope.