• 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.
Still having problems with the dynamic titles.
Been trying to add 'titles' for things such as hermitages, universities, etc. And independent landless dynamic titles (made with create_title) seem to work quite nicely. Because those can hold courtiers, but don't automatically fill up with generated ones. ...except for ones created with events that don't check for landless titles, such as the goldsmith and the tribal healer. Which can be easily modded.

Here's the code that I'm using:
Code:
    event_target:founder_title = { #Sets the location to where this title is located
       create_title = {
           tier = DUKE
           landless = yes
           culture = event_target:home_province
           name = "UNIVERSITY"
           ruler = "PRINCIPAL"
           holder = event_target:principal
           base_title = THIS
           copy_title_laws = event_target:founder_title
       }
       new_title = {
           set_title_flag = university
           event_target:principal = { set_defacto_liege = THIS }     #Makes the title independent
           add_law = succ_open_elective
       }
   }

The problem is that the only tiers that I can make work are DUKE and above. BARON tier instantly ceases to exist on creation, for no apparent reason... And COUNT tier doesn't quite work either: it gets created, but the holder of the title never moves to the court and instead ends up stuck abroad, in province 0 (which messes up any decision that requires distance calculation). So there's nobody in the 'court', and I can't move anyone in there because the move_character command only seems to work with characters...?

Any idea how to fix that? I guess I could just keep using the DUKE tier instead, but that's a bit too high for some of the things that I'm trying to model.
 
Still having problems with the dynamic titles.
Been trying to add 'titles' for things such as hermitages, universities, etc. And independent landless dynamic titles (made with create_title) seem to work quite nicely. Because those can hold courtiers, but don't automatically fill up with generated ones. ...except for ones created with events that don't check for landless titles, such as the goldsmith and the tribal healer. Which can be easily modded.

Here's the code that I'm using:
Code:
    event_target:founder_title = { #Sets the location to where this title is located
       create_title = {
           tier = DUKE
           landless = yes
           culture = event_target:home_province
           name = "UNIVERSITY"
           ruler = "PRINCIPAL"
           holder = event_target:principal
           base_title = THIS
           copy_title_laws = event_target:founder_title
       }
       new_title = {
           set_title_flag = university
           event_target:principal = { set_defacto_liege = THIS }     #Makes the title independent
           add_law = succ_open_elective
       }
   }

The problem is that the only tiers that I can make work are DUKE and above. BARON tier instantly ceases to exist on creation, for no apparent reason... And COUNT tier doesn't quite work either: it gets created, but the holder of the title never moves to the court and instead ends up stuck abroad, in province 0 (which messes up any decision that requires distance calculation). So there's nobody in the 'court', and I can't move anyone in there because the move_character command only seems to work with characters...?

Any idea how to fix that? I guess I could just keep using the DUKE tier instead, but that's a bit too high for some of the things that I'm trying to model.
Dynamically creating count and baron tier titles does not really work as they have to be tied to a province and holding
 
How do I Potential a Decision only if a Holding is of a certain type? I thought...

Code:
b_holding_003_province_1535 = {
    holding_type = castle
   }
...would work, but that just kicks out an endless stream of errors in the Error.log file about "pSettlement->IsValid() && "CHoldingTypeTrigger has wrong Scope!"", type: "holding_type".
 
How do I Potential a Decision only if a Holding is of a certain type? I thought...

Code:
b_holding_003_province_1535 = {
    holding_type = castle
   }
...would work, but that just kicks out an endless stream of errors in the Error.log file about "pSettlement->IsValid() && "CHoldingTypeTrigger has wrong Scope!"", type: "holding_type".
What is that "b_holding_003_province_1535"?
 
What is that "b_holding_003_province_1535"?
Initially, "nothing", as it's an empty Holding Slot on start-up (Commented out History defines it as a 'city'); when I was testing, it was an in-game Constructed Castle (so, empty Holding > Build Settlement > Castle).

Keeping the Log open during play, it looks like maybe it's because there's no settlement there? It seems to stop once the Castle is built.

If so, is there a way to work around that, and stop it outputting all the errors?
 
The documentation states that the on-action events on_character_join_society and on_character_leave_society have the society in the FROM scope. Now I want to make a check on whether the character is joining or leaving a particular society. The problem is, there is no society scope, so I can't do anything like

Code:
FROM = {
    is_society = my_society
}

As long as the society has at least one character in it, maybe something like this might be possible

Code:
if = {
    limit = {
        any_character = {
            society_member_of = my_society
            society_member_of = FROM
        }
    }
    # do stuff
}

This would, however, be quite CPU-intensive (any_character) and unwieldy (not to mention I'm not even 100% sure that works). Is there any better way to do this?
 
Last edited:
Is there any better way to do this?
Not sure what you mean by "there's no society scope", so dunno what exactly you're trying to do.
...would this work?:
Code:
if = {
   limit = { FROM = { leader = { society_member_of = my_society } } }
   # do stuff
}

I can't find documentation for the leader scope, but some vanilla events use it. Such as the 'joining hermetics' event (MNM.100), so it should work. But if it doesn't, using the any_society_member scope definitely works.
 
Last edited:
Not sure what you mean by "there's no society scope", so dunno what exactly you're trying to do.
Essentially, I wanted to check whether the society given in FROM is indeed my_society, and was under the impression that societies had no scope (which they apparently do, I guess the wiki is outdated?), and was trying to find a workaround.

...would this work?:
Code:
if = {
   limit = { FROM = { leader = { society_member_of = my_society } } }
   # do stuff
}
Thanks a lot, that is exactly what I had in mind :)
 
Dynamically creating count and baron tier titles does not really work as they have to be tied to a province and holding
Thanks for the confirmation. I guess I'll stick to using duchies for dynamic titles.

One final question about title modding, to make sure that I don't have alternatives. Non-dynamic landless titles (in landed_titles.txt) must always have a defined capitaL, right? ...and there's no way to move or set the capital province in whichever province the creator happens to be in?

So if I want things like hermitage titles that get established in whichever random provinces that happens to first meet the tech and religion criteria, I'll need to use dynamic titles?
 
I made a test setup where I designate a particular Duke the regent as the HREmperor. But few day after the HRE needs a regent ( I gave the HRE the incapable trait) and the Dukes steps in as such, but shortly after another Duke or council member steps in as regent without warning or event showing for the former regent. What do I miss? There is no such event in the regency_events.txt where a random Duke or courtier/council member steps in as regent randomly without event message.

Note: I deactivated all DLCs and mods.
 
Thanks for the confirmation. I guess I'll stick to using duchies for dynamic titles.

One final question about title modding, to make sure that I don't have alternatives. Non-dynamic landless titles (in landed_titles.txt) must always have a defined capitaL, right? ...and there's no way to move or set the capital province in whichever province the creator happens to be in?

So if I want things like hermitage titles that get established in whichever random provinces that happens to first meet the tech and religion criteria, I'll need to use dynamic titles?
Yeah I think they do need a capital and no you cannot change where it is, so yeah dynamic titles would be your best bet.
 
Yeah I think they do need a capital and no you cannot change where it is, so yeah dynamic titles would be your best bet.
Thanks again. Shame that imprisonment seems buggy for dynamic titles (and there's way too many vanilla events that don't check if the liege can actually hold prisoners), but I guess I'll have to live with that.
 
Last edited:
Is there a way to give someone a "fake title"? So that I could make "John" appear as "Lord John" for example? I tried giving my Courtier a Titular Title, but they just automatically gave it back to their Liege for some reason, and although minor_titles show up in the tool-tip and sub-bar, the title does not appear in their actual name (which I thought is what "show_as_title = yes" was meant to do?)
 
Is there a way to give someone a "fake title"? So that I could make "John" appear as "Lord John" for example? I tried giving my Courtier a Titular Title, but they just automatically gave it back to their Liege for some reason, and although minor_titles show up in the tool-tip and sub-bar, the title does not appear in their actual name (which I thought is what "show_as_title = yes" was meant to do?)
You can use a special character title, use the command set_special_character_title = <LOC_KEY> on them and make sure you have localised your special title and it will appear in front of their name. In vanilla it is used for the Horse Lords decision to take the title of Genghis Khan
 
Having an issue in my total conversion mod with a consistent CTD after hitting "start game". The actual CK2 program loads up just fine and I can get to the character selection screen and game rules screen, but when I finally hit Start Game from there it reaches the Initialising Game step in loading and then crashes. I have -debug -debugscripts active in launch options but frankly I cannot make sense of the 200 kb garble it coughs up into the error log. An example:
Code:
[effectimplementation.cpp:1080]: Script Assert! message: "Unknown modifier type!", assert: "_pModifier", type: "id", location: ""
[effectimplementation.cpp:1080]: Script Assert! message: "Unknown modifier type!", assert: "_pModifier", type: "id", location: ""
[effectimplementation.cpp:1080]: Script Assert! message: "Unknown modifier type!", assert: "_pModifier", type: "id", location: ""

Repeated for a while, and then stuff pertaining to some on_action events I removed and some casus belli errors, but I doubt those cause crashes.

Anyone have past experience in solving a problem like this?
 
What does the exception.log say? That tends to be a lot more useful for crashes.

The only entries in it are from March. It's useless for this one.