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

SwordArTJBF

Sergeant
57 Badges
Jun 20, 2019
72
0
  • Crusader Kings II
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Ancient Relics
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: La Resistance
  • Europa Universalis IV: Mandate of Heaven
  • Imperator: Rome Deluxe Edition
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Conclave
  • Europa Universalis IV: El Dorado
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 2
  • Europa Universalis IV
  • Crusader Kings III: Royal Edition
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Stellaris: Megacorp
I'm working on a mod that creates 50 new voter titles for the Byzantine and Roman empires that are based on senators. These positions will be held for life, be made up of characters without landed titles, and be revokable. In addition, I plan on turning on protected council appointments on by default so the emperor has to get approval before choosing a new senator.

The way the mods supposed to work is that it creates 50 new characters on game startup, and assigns them the new titles through scripted effects used in an on_action event. While the new characters seem to be generated correctly and at the right amount, they aren't being assigned the senatorrome title automatically, and I can't assign them or any other character to the position manually.

Could any of you look through the work I've done on it so far in this zip and see what's causing this to happen? I suspect that the fill_senate_rome effect somehow isn't working properly, but that doesn't really explain why I can't even choose anyone for that minor title. Don't mind the lack of localization btw. I'll be getting to that once this is sorted out.
 

Attachments

  • parliamentwork.zip
    2,3 KB · Views: 5
The fill_senate_rome doesn't have a while loop.
so I added a count = 50 condition to the a while loop for that effect, which is supposed to cause it to loop exactly 50 times. Unfortunately, that didn't seem to do anything. Is there anything specifically i'll need to put in the while loop in order for the senate seats to be assigned properly? Or is there anything else you've noticed that needs fixing.

Because that doesn't really explain why I can't even assign the senate titles to any character in the first place. That could be what's causing all this, but I can't seem to figure out how or why.
 
Last edited:
so I added a count = 50 condition to the a while loop for that effect, which is supposed to cause it to loop exactly 50 times. Unfortunately, that didn't seem to do anything. Is there anything specifically i'll need to put in the while loop in order for the senate seats to be assigned properly? Or is there anything else you've noticed that needs fixing.

Because that doesn't really explain why I can't even assign the senate titles to any character in the first place. That could be what's causing all this, but I can't seem to figure out how or why.

Code:
fill_senate_rome = {
    WHILE = {
        limit = {
            NOT = {
                any_courtier_or_vassal = {
                    count = 50
                    has_assigned_minor_title = title_senatorrome
                }
            }
        }
        random_courtier_or_vassal = {
            limit = {
                is_female = no
                is_heir = no
                has_regent = no
                has_landed_title = no
                is_councillor = no
                NOT = { has_minor_title = title_senatorrome }
            }
            give_minor_title = title_senatorrome
        }
    }
}
 
Code:
fill_senate_rome = {
    WHILE = {
        limit = {
            NOT = {
                any_courtier_or_vassal = {
                    count = 50
                    has_assigned_minor_title = title_senatorrome
                }
            }
        }
        random_courtier_or_vassal = {
            limit = {
                is_female = no
                is_heir = no
                has_regent = no
                has_landed_title = no
                is_councillor = no
                NOT = { has_minor_title = title_senatorrome }
            }
            give_minor_title = title_senatorrome
        }
    }
}
So I just added that in, but unfortunately, it doesn't seem to fix anything. I've tried looking through the validator, but it's not picking up any errors, so as a newbie modder this forum seems to be the only place I'll find out what's wrong and what I need to do.

Here's my updated mod file. Could you or anyone else look through that and see what I need to change or fix?
 

Attachments

  • parliamenttest (5).zip
    3,5 KB · Views: 3
So I just added that in, but unfortunately, it doesn't seem to fix anything. I've tried looking through the validator, but it's not picking up any errors, so as a newbie modder this forum seems to be the only place I'll find out what's wrong and what I need to do.

Here's my updated mod file. Could you or anyone else look through that and see what I need to change or fix?

It's not working because the scripted effect is fill_senate_rome, but in the event, you have it entered as just fill_senate. The names must match.
 
It's not working because the scripted effect is fill_senate_rome, but in the event, you have it entered as just fill_senate. The names must match.
I fixed that, but it still doesn't seem to be working. I believe that this is somehow either being caused by the fill_senate_rome not properly assigning the council positions to the character generated by generate_senate_pool or by the title_senaterome not allowing any characters to be assigned. Could you look into that some more and see if anything there could be causing it.
 
I fixed that, but it still doesn't seem to be working. I believe that this is somehow either being caused by the fill_senate_rome not properly assigning the council positions to the character generated by generate_senate_pool or by the title_senaterome not allowing any characters to be assigned. Could you look into that some more and see if anything there could be causing it.

I believe I see the problem. The condition has_assigned_minor_title is querying whether or not the scoped character (i.e., any_courtier_or_vassal) has assigned the indicated minor title to another character, not whether or not the scoped character has the title assigned to him. Change it to has_minor_title in the limit block, like so:
Code:
fill_senate_rome = {
    WHILE = {
        limit = {
            NOT = {
                any_courtier_or_vassal = {
                    count = 50
                    has_minor_title = title_senatorrome
                }
            }
        }
        random_courtier_or_vassal = {
            limit = {
                is_female = no
                is_heir = no
                has_regent = no
                has_landed_title = no
                is_councillor = no
                NOT = { has_minor_title = title_senatorrome }
            }
            give_minor_title = title_senatorrome
        }
    }
}
 
Last edited:
I believe I see the problem. The condition has_assigned_minor_title is querying whether or not the scoped character (i.e., any_courtier_or_vassal) has assigned the indicated minor title to another character, not whether or not the scoped character has the title assigned to him. Change it to has_minor_title in the limit block, like so:
Code:
fill_senate_rome = {
    WHILE = {
        limit = {
            NOT = {
                any_courtier_or_vassal = {
                    count = 50
                    has_minor_title = title_senatorrome
                }
            }
        }
        random_courtier_or_vassal = {
            limit = {
                is_female = no
                is_heir = no
                has_regent = no
                has_landed_title = no
                is_councillor = no
                NOT = { has_minor_title = title_senatorrome }
            }
            give_minor_title = title_senatorrome
        }
    }
}
that didn't seem to fix it unfortunately, but I feel like we're getting closer now.

Here's my updated mod folder. Can you or anyone else dig through it again and see if anything else is wrong with it?
 

Attachments

  • parliamentwork (2).zip
    7 KB · Views: 1
that didn't seem to fix it unfortunately, but I feel like we're getting closer now.

Here's my updated mod folder. Can you or anyone else dig through it again and see if anything else is wrong with it?

The title_senatorrome entry in minor_titles_eroman.txt wasn't properly formatted. There was a missing close bracket in the allowed_to_hold block. Here is a cleaned-up version:
Code:
title_senatorrome = {
    dignity = 0.8
    grant_limit = 50
    show_as_title = yes
    realm_in_name = no
    revoke_allowed = no
    is_voter = yes
    opinion_effect = 20
    monthly_salary = 0.5
    monthly_prestige = 0.5
  
    allowed_to_grant = {
        higher_tier_than = KING
        OR = {
            has_landed_title = e_byzantium
            has_landed_title = e_roman_empire
        }
        primary_title = { has_law = law_voting_power_1 }
    }
  
    allowed_to_hold = {
        is_female = no
        has_landed_title = no
        NOT = { primary_title = { temporary = yes } }
        can_be_councilmember_senate_trigger = yes
    }
  
    gain_effect = {
    }
    lose_effect = {
    }
  
    message = yes
}

Make sure you're using a robust editor, like Notepad++, to write your scripts. It will highlight open brackets and their corresponding close brackets, which makes it easier to tell when one is missing. Also, you can get a user-defined language here that will color-code and autocomplete common script elements.
 
Last edited:
The title_senatorrome entry in minor_titles_eroman.txt wasn't properly formatted. There was a missing close bracket in the allowed_to_hold block. Here is a cleaned-up version:
Code:
title_senatorrome = {
    dignity = 0.8
    grant_limit = 50
    show_as_title = yes
    realm_in_name = no
    revoke_allowed = no
    is_voter = yes
    opinion_effect = 20
    monthly_salary = 0.5
    monthly_prestige = 0.5
 
    allowed_to_grant = {
        higher_tier_than = KING
        OR = {
            has_landed_title = e_byzantium
            has_landed_title = e_roman_empire
        }
        primary_title = { has_law = law_voting_power_1 }
    }
 
    allowed_to_hold = {
        is_female = no
        has_landed_title = no
        NOT = { primary_title = { temporary = yes } }
        can_be_councilmember_senate_trigger = yes
    }
 
    gain_effect = {
    }
    lose_effect = {
    }
 
    message = yes
}

Make sure you're using a robust editor, like Notepad++, to write your scripts. It will highlight open brackets and their corresponding close brackets, which makes it easier to tell when one is missing. Also, you can get a user-defined language here that will color-code and autocomplete common script elements.

So I copied and implimented that fixed code, but it still doesn't seem to work. I at least feel like we've narrowed this down to something wrong with the minor_title, but when I ran the code through the validator, I got this strange error:
Code:
--- Error 1 of 2 ---
At <mod>\common\scripted_effects\senate_effects.txt [generate_senate_pool\WHILE] (Line 2, column 5):
No direct match found for WHILE (is the casing correct?). However, other possible matches in scope CharCommand were found.
Left: ["while"] Right: [CharWhileClause]
* called from <mod>\events\senate_events.txt [character_event\immediate\generate_senate_pool] (Line 17, column 3)
--- Error 2 of 2 ---
At <mod>\common\scripted_effects\senate_effects.txt [fill_senate_rome\WHILE] (Line 18, column 5):
No direct match found for WHILE (is the casing correct?). However, other possible matches in scope CharCommand were found.
Left: ["while"] Right: [CharWhileClause]
* called from <mod>\events\senate_events.txt [character_event\immediate\fill_senate_rome] (Line 18, column 3)

Could you confirm if this could be causing any issues? I'm pretty sure it isn't, since the scripted effects seen to be fine, but it could reveal something at least. I've also attached by latest version. Could you look through it again and see if anythings up?
 

Attachments

  • parliamenttest (6).zip
    6,7 KB · Views: 2
So I copied and implimented that fixed code, but it still doesn't seem to work. I at least feel like we've narrowed this down to something wrong with the minor_title, but when I ran the code through the validator, I got this strange error:
Code:
--- Error 1 of 2 ---
At <mod>\common\scripted_effects\senate_effects.txt [generate_senate_pool\WHILE] (Line 2, column 5):
No direct match found for WHILE (is the casing correct?). However, other possible matches in scope CharCommand were found.
Left: ["while"] Right: [CharWhileClause]
* called from <mod>\events\senate_events.txt [character_event\immediate\generate_senate_pool] (Line 17, column 3)
--- Error 2 of 2 ---
At <mod>\common\scripted_effects\senate_effects.txt [fill_senate_rome\WHILE] (Line 18, column 5):
No direct match found for WHILE (is the casing correct?). However, other possible matches in scope CharCommand were found.
Left: ["while"] Right: [CharWhileClause]
* called from <mod>\events\senate_events.txt [character_event\immediate\fill_senate_rome] (Line 18, column 3)

Could you confirm if this could be causing any issues? I'm pretty sure it isn't, since the scripted effects seen to be fine, but it could reveal something at least. I've also attached by latest version. Could you look through it again and see if anythings up?

It's saying that while is case-sensitive, but that's stupid, because if, else, and else_if are not, and I don't see any reason why while should be different. (I type all of the flow control statements in uppercase to keep them consistent with the logical operators AND, OR, NOT, etc. It's a stylistic preference that makes things easier for me to read.) Still, try changing it to lowercase and see what happens.

I'm posting by phone right now and can't look at the files. Will check them out when I get home.
 
Okay, for some reason, the scripted trigger is can_be_councilmember_king_trigger in the allowed_to_hold block of the title_senatorrome minor title (in the minor_titles_eroman.txt file), but can_be_councilmember_senate_trigger in the senate_triggers.txt file. Again, these must exactly match for the game engine to correctly process the trigger.
 
Okay, for some reason, the scripted trigger is can_be_councilmember_king_trigger in the allowed_to_hold block of the title_senatorrome minor title (in the minor_titles_eroman.txt file), but can_be_councilmember_senate_trigger in the senate_triggers.txt file. Again, these must exactly match for the game engine to correctly process the trigger.
even with those changes it doesn't seem to work. Upon further expection, after changed the minor title to allow for landed characters to hold it, the fill_senate trigger doesn't seem to be assigning any of the titles ontop of none of the titles being grantable if I set it to has_landed_title = no

Are you aware of how exactly the game goes about assigning empty council seats on start up? Because It's possible that the senate.000 on_action maybe be conflicting with that, if true. If ya have any other ideas of what's going on feel free to let me know as well.
 
Okay, for some reason, the scripted trigger is can_be_councilmember_king_trigger in the allowed_to_hold block of the title_senatorrome minor title (in the minor_titles_eroman.txt file), but can_be_councilmember_senate_trigger in the senate_triggers.txt file. Again, these must exactly match for the game engine to correctly process the trigger.
So I FINALLY managed to fix the issue with the titles not being grantable by switching the has_landed_title condition to is_landed. I'm now able to manually grant the titles to my landless courtiers, but unfortunately the script that's supposed to assign them the council positions at startup doesn't seem to be working. I can confirm it's firing, but it's not granting any of the titles at all.

Could you or anyone else look through my scripted_effects file here and tell me what's up with it? I'm almost certain it's an issue with syntax, but the validator isn't picking anything up with it so I don't know what the particular issue with it is.
 

Attachments

  • parliamenttest (2).zip
    40 KB · Views: 2