• 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.
Today I was messing around with modding for the first time, testing things out before I make my first real mod. I plan on making a historical mod that improves mainly in the dutchy of Iceland. If it goes well, I'll also add an Icelandic culture (irritating how quickly they always submit to Norway), and some flavor events that reference the sagas or the civil war period.

Anyway, to the question. I started out with some basic things, like messing around with holdings. I wanted to change the names of the holdings, so I changed the localisation file without trouble. For example, instead of "Vestisland" it's now "Vesturland" and instead of "Norðland" it is not "Norðurland." But the "ð" letter causes problem with the game once I loaded in, despite numerous names added with Holy Fury having no problems with all modern Icelandic letters (á/é/í/ó/ú/ö/ð/þ). I even tried copying the letters from the native Holy Fury file under localisation (was tricky to figure out where the 2 newer holdings were located), but it didn't work. As you can see on the screenshots, I tried adding more holdings to Vestisland, and the letters only work for already coded in names from Holy Fury, but not names I type out. Any idea what is causing this?

View attachment 502279
View attachment 502280

The second barony was written as "Hólmavík" in the code.

One extra question as well: How do you control which court landless characters end up in? I couldn't figure it out, and from limited tests it seems fairly random or purely based on ancestry/culture/etc. Is there a way to give a character an honorary title perhaps?

Thanks in advance!

Also, sorry if this was too long of a question for the 'quick questions' thread.

Make sure you are saving the csv file as the correct encoding. Windows-1252

Regarding the second question, i'm not sure what you want.
 
Thank you. I changed the encoding to the same as the native files in notepad++ and it worked!

As for the other question, I want to be able to control which court unlanded characters end up in. I created some new characters to test things out, and gave one a county. The former owner then either ends up in the new characters court or the duke's court at random. I wanted to create a character called Snorri Sturluson (a historically relevant character) and put him in the court of the current Norwegian King. But only for a limited span of years, and have him move from court to court depending on when the player chooses to start their game. How do I choose which characters are in which court? Is there perhaps a way to manipulate this by granting them honorary titles with the appropriate ruler?
 
Thank you. I changed the encoding to the same as the native files in notepad++ and it worked!

As for the other question, I want to be able to control which court unlanded characters end up in. I created some new characters to test things out, and gave one a county. The former owner then either ends up in the new characters court or the duke's court at random. I wanted to create a character called Snorri Sturluson (a historically relevant character) and put him in the court of the current Norwegian King. But only for a limited span of years, and have him move from court to court depending on when the player chooses to start their game. How do I choose which characters are in which court? Is there perhaps a way to manipulate this by granting them honorary titles with the appropriate ruler?


Fire an event by on_action start up

Fire that event to the norweigan king (use character id).

Make the norweigan king creat a character with create_character command with the name and attributes you want. Add a special flag to it to be able to scope to him later. From that same event you created the character, you fire an event to the player, hidden, with the delay you want to move him Snorri to the court. (to fire an event to the player you just fire an event from the king of norway socping to any_character = { limit = { ai = no } } character_event = etc

In the player event you just use any_character = { limit has_character_flag = "flag you set before".

Then just use the command move_character = ROOT.

That's it.

Note that if when you create a character you can assign him a specific ID, you don't need to set a special flag to then find him in the game. You just use, from an event to the player, c_"characterid" = { move_character = ROOT }.

Since i've never created characters, wouldn't know, but I assume you can only assign them random ids.
 
Last edited:
Fire an event by on_action start up

Fire that event to the norweigan king (use character id).

Make the norweigan king creat a character with create_character command with the name and attributes you want. Add a special flag to it to be able to fire an event to him later. From that same event you created the character, you fire an event to the player, hidden, with the delay you want to move him Snorri to the court.

In the player event you just use any_character = { limit has_character_flag = "flag you set before".

Then just use the command move_character = ROOT.

That's it.

Note that if when you create a character you can assign him a specific ID, you don't need to set a special flag to then find him in the game. You just use, from an event to the player, c_"characterid" = { move_character = ROOT }.

Since i've never created characters, wouldn't know.

Thank you again. I'll keep this in mind when I go into creating Snorri. I've created 4 custom characters so far, and I just made sure to have their ID long enough so it wouldn't duplicate other characters. It seems I'll do most of the coding through startup events and what not. This really helps as I now have much better idea of what I'm actually going to do!
 
Thank you again. I'll keep this in mind when I go into creating Snorri. I've created 4 custom characters so far, and I just made sure to have their ID long enough so it wouldn't duplicate other characters. It seems I'll do most of the coding through startup events and what not. This really helps as I now have much better idea of what I'm actually going to do!

That's awesmoe that you can assign custom IDs, will make it much easier.

What's the line to assing specific ID if you don't mind telling me
 
That's awesmoe that you can assign custom IDs, will make it much easier.

What's the line to assing specific ID if you don't mind telling me
The ID is located at the beginning of each character in the character folder under history.

Here's a character I created:
Coding example.png

Each character starts with their ID similar to dynasties. Then you can customize them. I just created a new character entry called "added" and then put "151515" as I was too lazy to check if anything less jarbled was already taken, and just added each character with additional 001,002,003 etc. Then copied another character and just changed what I wanted, which seems to work fine.

And I saw something on the wiki on "historical characters" so I'll just create him like I did with these test characters, and move him around with the use of events, either at startup or not, like in your example. I guess that's where the majority of my question came from, as I'm unsure how to use events.

And yes I read the comment after you edited. Thank you.
 
The ID is located at the beginning of each character in the character folder under history.

Here's a character I created:
View attachment 502363

Each character starts with their ID similar to dynasties. Then you can customize them. I just created a new character entry called "added" and then put "151515" as I was too lazy to check if anything less jarbled was already taken, and just added each character with additional 001,002,003 etc. Then copied another character and just changed what I wanted, which seems to work fine.

And I saw something on the wiki on "historical characters" so I'll just create him like I did with these test characters, and move him around with the use of events, either at startup or not, like in your example. I guess that's where the majority of my question came from, as I'm unsure how to use events.

And yes I read the comment after you edited. Thank you.

If you want to constantly move him from court to court it's gonna be tricky, but its definetely doable.
 
The ID is located at the beginning of each character in the character folder under history.

Here's a character I created:
View attachment 502363

Each character starts with their ID similar to dynasties. Then you can customize them. I just created a new character entry called "added" and then put "151515" as I was too lazy to check if anything less jarbled was already taken, and just added each character with additional 001,002,003 etc. Then copied another character and just changed what I wanted, which seems to work fine.

And I saw something on the wiki on "historical characters" so I'll just create him like I did with these test characters, and move him around with the use of events, either at startup or not, like in your example. I guess that's where the majority of my question came from, as I'm unsure how to use events.

And yes I read the comment after you edited. Thank you.
There are 2 ways to create character:
• "historical characters" are created as you did, in a file in the history/characters folder. They are crated at startup, or not created, depending on the date the player starts the game. After the initial startup of the game, the history files don't matter any more.
• "created characters" are created in script command create_character, create_random_diplomat, create_random_intriguer, create_random_priest, create_random_soldier, or create_random_steward. The create_random_X commands are versions of create_character that give an appropriate education trait and bias the relevant stat.

In vanilla, and I assume in some mod, a given historical character may be created either way, depending on the start date. If the game starts after a given date, that character is already in the history files and shows up that way. If the game starts before that, then the character may be created in script commands around the historic date. The various invading horde leaders like Seljuk are examples of this.
 
As for the other question, I want to be able to control which court unlanded characters end up in. I created some new characters to test things out, and gave one a county. The former owner then either ends up in the new characters court or the duke's court at random. I wanted to create a character called Snorri Sturluson (a historically relevant character) and put him in the court of the current Norwegian King. But only for a limited span of years, and have him move from court to court depending on when the player chooses to start their game. How do I choose which characters are in which court? Is there perhaps a way to manipulate this by granting them honorary titles with the appropriate ruler?

I think move_character is what you're looking for.
 
There are 2 ways to create character:
• "historical characters" are created as you did, in a file in the history/characters folder. They are crated at startup, or not created, depending on the date the player starts the game. After the initial startup of the game, the history files don't matter any more.
• "created characters" are created in script command create_character, create_random_diplomat, create_random_intriguer, create_random_priest, create_random_soldier, or create_random_steward. The create_random_X commands are versions of create_character that give an appropriate education trait and bias the relevant stat.

In vanilla, and I assume in some mod, a given historical character may be created either way, depending on the start date. If the game starts after a given date, that character is already in the history files and shows up that way. If the game starts before that, then the character may be created in script commands around the historic date. The various invading horde leaders like Seljuk are examples of this.
Thanks. I was planning on creating Snorri both as a historical character, starting either as a landed character in Iceland, at the court of Haakon IV or Jarl Skule of Nidaros (an interesting superduke actually), and as a created character under certain conditions if the player starts before 13th century which is most likely. My plan is for the player to be able to offer him patronage, and have him write their story, and that of their dynasty in turn, which would grant some buffs.

I still haven't grasped the event coding, but I'm sure I'll figure it out with enough patience.
 
Thank you. I changed the encoding to the same as the native files in notepad++ and it worked!

As for the other question, I want to be able to control which court unlanded characters end up in. I created some new characters to test things out, and gave one a county. The former owner then either ends up in the new characters court or the duke's court at random. I wanted to create a character called Snorri Sturluson (a historically relevant character) and put him in the court of the current Norwegian King. But only for a limited span of years, and have him move from court to court depending on when the player chooses to start their game. How do I choose which characters are in which court? Is there perhaps a way to manipulate this by granting them honorary titles with the appropriate ruler?
You can use the move_character command which will move the currently scoped character to the target character's court.
Code:
ROOT = { move_character = PREV }
This command will move ROOT to PREV's court.

You can scope to the ruler of a title using the following scope tree:
Code:
<title_name> = {
    holder_scope = {
        # Commands
    }
}

You could save the created character as a Persistent Event Target in a province or title so that you can always scope to him from anywhere. For example:
Code:
<new_character_scope> = {
    k_papal_state = {
        save_persistent_event_target = { name = my_new_character scope = PREV }
    }
}

Then, at any point in the game you want to move this character to the court of the King of Ireland. You would do it like this (for example in the "immediate" block of an event):
Code:
# At any point in the game, we want to move our character:
# This code goes in any effect block (e.g. "immediate" or "option" blocks of events)
# First save the target court ruler as an event target for easy and legible scoping
k_ireland = {
    holder_scope = {
        save_event_target_as = target_court_host
    }
}
# Then scope to our persistent event target and move him to the intended court
k_papal_state = {
    persistent_event_target:my_new_character = {
        move_character = event_target:target_court_host
    }
}

Another command called force_host works similarly to move_character but will forcibly move the character without taking into account any hindrances. Use with caution.
 
Last edited:
You can use the move_character command which will move the currently scoped character to the target character's court.
Code:
ROOT = { move_character = PREV }
This command will move ROOT to PREV's court.

You can scope to the ruler of a title using the following scope tree:
Code:
<title_name> = {
    holder_scope = {
        # Commands
    }
}

You could save the created character as a Persistent Event Target in a province or title so that you can always scope to him from anywhere. For example:
Code:
<new_character_scope> = {
    k_papal_state = {
        save_persistent_event_target = { name = my_new_character scope = PREV }
    }
}

Then, at any point in the game you want to move this character to the court of the King of Ireland. You would do it like this (for example in the "immediate" block of an event):
Code:
# At any point in the game, we want to move our character:
# This code goes in any effect block (e.g. "immediate" or "option" blocks of events)
# First save the target court ruler as an event target for easy and legible scoping
k_ireland = {
    holder_scope = {
        save_event_target_as = target_court_host
    }
}
# Then scope to our persistent event target and move him to the intended court
k_papal_state = {
    persistent_event_target:my_new_character = {
        move_character = event_target:target_court_host
    }
}

Another command called force_host works similarly to move_character but will forcibly move the character without taking into account any hindrances. Use with caution.

Thank you so much! Will definitely come in handy.
 
Hello everyone! I have a small problem; I'm trying to apply the command "create_hospital" to the scope "any_province" in a decision what does it should look like? Also, should I use the scope "any_demesne_province" instead if it's that cpu intensive? Here's my decision(only the custom event firing works):
decisions = {

create_hospital = {
ai = no
only_playable = yes

potential = {

}
allow = {
prestige = 25
}
effect = {
character_event = { id = 909090 }
any_province = { create_hospital }
}
ai_will_do = {
factor = 0
}
}
 
create_hospital has to be used from character or title scope, not province scope, and takes a province ID as the value. So no, I don't think you can programmatically create a hospital in every single province in the game unless you list them all manually.
 
Hello everyone! I have a small problem; I'm trying to apply the command "create_hospital" to the scope "any_province" in a decision what does it should look like? Also, should I use the scope "any_demesne_province" instead if it's that cpu intensive? Here's my decision(only the custom event firing works):
decisions = {

create_hospital = {
ai = no
only_playable = yes

potential = {

}
allow = {
prestige = 25
}
effect = {
character_event = { id = 909090 }
any_province = { create_hospital }
}
ai_will_do = {
factor = 0
}
}

Try using create_hospital = random_province

Maybe the problem is a general scope. You should be able to create hospitals without having to assign specific IDs, i'm not sure why the guy above said that.
 
You mean something like

Code:
any_province = {
    c_####### = {
        create_hospital = PREV
    }
}

Yeah, that would probably work, but I don't know why you would want to do that. If there are particular provinces you want to build hospitals in, you need to specify them. You definitely can't put scopes other than PREV/FROM/ROOT on the right hand side of the expression, though.