• 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.
How is this for the basic code?

Code:
character_event = {
    id = DT.01 #Asher
    title = EVTNAME_DT_01
    desc = EVTDESC_DT_01
   
    major = no
   
    hide_window = yes
   
    religion_group = jewish_group
    culture_group = israelite
   
    trigger = {
        on_startup = {
            OR = {
                dynasty = 10015400
                dynasty = 10015401
                dynasty = 10015402
            }
    }
   
    option = {
        add_trait = asher
    }
}
 
How is this for the basic code?

Code:
character_event = {
    id = DT.01 #Asher
    title = EVTNAME_DT_01
    desc = EVTDESC_DT_01
  
    major = no
  
    hide_window = yes
  
    religion_group = jewish_group
    culture_group = israelite
  
    trigger = {
        on_startup = {
            OR = {
                dynasty = 10015400
                dynasty = 10015401
                dynasty = 10015402
            }
    }
  
    option = {
        add_trait = asher
    }
}

Couple points:
Unbalanced parentheses.
You're going to want immediate, not option.
No need for title and desc, since it is "hide_window = yes".
Don't put on_startup in the trigger, instead call it from the on_startup on_action, and make the event "is_triggered_only = yes".
 
Couple points:
Unbalanced parentheses.
You're going to want immediate, not option.
No need for title and desc, since it is "hide_window = yes".
Don't put on_startup in the trigger, instead call it from the on_startup on_action, and make the event "is_triggered_only = yes".

So like this?

Code:
character_event = {
    id = DT.01 #Asher
     
    major = no
 
    hide_window = yes
 
    religion_group = jewish_group
    culture_group = israelite
 
    is_triggered_only = yes
 
    on_startup = {
        OR = {
            dynasty = 10015400
            dynasty = 10015401
            dynasty = 10015402
        }
    }
 
    immediate = {
        add_trait = asher
    }
}

I don't know what an unbalanced parenthesis is. :)
 
So like this?
More like this:
Code:
character_event = {
    id = DT.01 #Asher
    
    major = no
    hide_window = yes
 
    religion_group = jewish_group
    culture_group = israelite
 
    is_triggered_only = yes
 
    trigger = {
        OR = {
            dynasty = 10015400
            dynasty = 10015401
            dynasty = 10015402
        }
    }
 
    immediate = {
        add_trait = asher
    }
}
And like this in common/on_actions:
Code:
on_startup = {
    events = {
        DT.01
    }
}
 
  • 1
Reactions:
Unbalanced paranthesis meant that you opened more paranthesis (or in this case, curly braces) than you closed.
When you deleted on_startup, you happenedto fix it, since that was the broken part.
 
  • 1
  • 1
Reactions:
Unbalanced paranthesis meant that you opened more paranthesis (or in this case, curly braces) than you closed.
When you deleted on_startup, you happenedto fix it, since that was the broken part.

Ahh okay, when I first started modding a couple of years ago it was called missing paranthesis. :) It appears I have some catching up to do.
 
Ahh okay, when I first started modding a couple of years ago it was called missing paranthesis. :) It appears I have some catching up to do.
You also don't need to specify major = no, that is the default behaviour for all events
 
  • 1
  • 1
Reactions:
For future convenience, save a backup of your mod somewhere when you have a version that seems to work, and test the mod frequently. You can't realistically test the mod every time you change a few lines, but if you have done major rewrites to a large file or many small edits you should test the game so that you know which files you have changed since your last successful test, particularly as the Validator almost always gives false positives. I once had to compare a few hundred files because I had forgotten to make frequent backups and tests, which was a lot of work to find that one event was causing a CTD and that the rest of the files were fine.

Thanks for the help. I spent a while trying to figure out what was wrong, then sorted all the files by date edited and then realized out I renamed my trade routes file, which caused the vanilla trade route file to be loaded instead of overridden, causing the crash. I'll keep in mind to take better care to back up my progress in the future.
 
Is there any way to change the tooltip which appears when hovering over a holding?
 
I don't know a non-computationally expensive way to do it, but I can think of an expensive way that might work (the algorithm works, but it might be hard to implement in CK2):

1. Set a flag on the province and create two variables (connected_provinces and connected_provinces_old; I'll use CP and CPO for them below). Set CP and CPO to 1.
2. Fire an event for all realm provinces adjacent to the flagged provinces that haven't been flagged. This event sets the flag on the province and fires an event for the original provinces that increments CP.
3. Check if CPO is equal to CP. If so, you have found all connected provinces. If not, set CPO to be equal to CP and go back to 2.
4. Check if the capital has the flag. Make sure to clear the flag for all realm provinces regardless of the outcome to avoid trouble in the future because of false positives.

The above would have to be modified if you want e.g. a shared sea zone to count as a connection, though anything with a strait would be connected automatically.
 
  • 1
Reactions:
I don't know a non-computationally expensive way to do it, but I can think of an expensive way that might work (the algorithm works, but it might be hard to implement in CK2):

1. Set a flag on the province and create two variables (connected_provinces and connected_provinces_old; I'll use CP and CPO for them below). Set CP and CPO to 1.
2. Fire an event for all realm provinces adjacent to the flagged provinces that haven't been flagged. This event sets the flag on the province and fires an event for the original provinces that increments CP.
3. Check if CPO is equal to CP. If so, you have found all connected provinces. If not, set CPO to be equal to CP and go back to 2.
4. Check if the capital has the flag. Make sure to clear the flag for all realm provinces regardless of the outcome to avoid trouble in the future because of false positives.

The above would have to be modified if you want e.g. a shared sea zone to count as a connection, though anything with a strait would be connected automatically.

Thank you! I will try this out. I'm trying to encourage exclaves belonging to the AI to revolt via events (or possibly just apply province modifiers making them less lucrative), so I'd probably have to do a pulse event on the first of the year that checks the entire map. That would overlap with the autosave lag though so it wouldn't be as noticeable.
 
Hey so I think my save game has some how messed up as courtiers no longer have unique dynasties and are all part of one large blank dynasty and I was wondering if there was a way to fix this
 
Thank you! I will try this out. I'm trying to encourage exclaves belonging to the AI to revolt via events (or possibly just apply province modifiers making them less lucrative), so I'd probably have to do a pulse event on the first of the year that checks the entire map. That would overlap with the autosave lag though so it wouldn't be as noticeable.

You might be able to offload the load a bit by using on_yearly_pulse (or even on_five_year_pulse, if you don't mind it taking a bit longer for exclaves to change status) events for independent rulers and reversing the check (flag all provinces connected to the capital, then apply a revolt risk modifier to all provinces without the flag, fire a province event that can spawn a peasant revolt, or do something else), again making sure to remove the flag from all provinces. However, keep in mind that unless you include some sea zone (or distance from other realm port connected to the rest of the realm) check it would make e.g. Malta cause problems for the duke of Sicily and the duchies of Iceland and Orkney being problematic for Norway.
 
  • 1
Reactions:
How do you mean? Do you want to create a new title with different crown and succession laws and make that the primary title?
 
This is the case:
Two titles, A and B, of equal rank (empires, to be precise)
Holder of title A inherits B, he should then hold both titles for a while, with the laws of B.
After a time, title A is given away to somebody else, and should have its original laws intact.