• 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.
Is there a good way for something to trigger when a regency begins or ends? The only method I'm seeing is a triggered modifier with has_regent = yes/no, but even assuming that would work, I'm a bit reluctant because the wiki says that's resource-intensive. Though I would also have an ai = no clause in there too, I'm not sure if that would suffice for lowering resource intensity.

Not to mention that only lets me attach a modifier to the specific person, not fire an event.

Fire an event for the liege when a character gains the title_regent minor title (happens one day after whatever made the regency start) checking if the liege has some regency_setup_done flag and otherwise doing whatever you want to do, and fire another event for the liege when a character loses the same minor title that cleans things up. There might be some edge cases when a regent dies or otherwise loses the title without the regency ending, however, so you might want to check for all possible causes for a regency (imprisoned, underage, incapable, on a pilgrimage, etc.) not being a thing before doing the cleanup.
 
  • 2
  • 1
Reactions:
How immediately do you need to trigger it? I don't think there's a direct way to fire an event on start/end of regency, but you could run a pulse event which checks for a regent and then performs other actions (eg. triggering a later event that checks for lack of regent and does something else). Unfortunately, this approach would require that you handle all possible situations yourself (eg. change of regent, death of regent, death of ruler), and it probably won't detect momentary regency (eg. seclusion from theology focus).
Yeah I thought of that, but I'd like it to happen immediately, or by the next day.
Fire an event for the liege when a character gains the title_regent minor title (happens one day after whatever made the regency start) checking if the liege has some regency_setup_done flag and otherwise doing whatever you want to do, and fire another event for the liege when a character loses the same minor title that cleans things up. There might be some edge cases when a regent dies or otherwise loses the title without the regency ending, however, so you might want to check for all possible causes for a regency (imprisoned, underage, incapable, on a pilgrimage, etc.) not being a thing before doing the cleanup.
Wouldn't this only work if you haven't already appointed someone as Regent ahead of time?
 
Yeah I thought of that, but I'd like it to happen immediately, or by the next day.

Wouldn't this only work if you haven't already appointed someone as Regent ahead of time?

No, the game will always assign someone as regent. The designated regent minor title is not the actual minor title used for the regency, it's only used to determine who will be the actual regent, before the game falls back to someone.
 
  • 1
Reactions:
No, the game will always assign someone as regent. The designated regent minor title is not the actual minor title used for the regency, it's only used to determine who will be the actual regent, before the game falls back to someone.
Oh I see! Thank you, and Silversweeper too.

So I'm looking at the minor titles file: title_appointed_regent is the Designated Regent that the player can appoint manually when not in a regency, and title_regent is the actual regent whenever a regency is in effect? Do I have that right?
 
Oh I see! Thank you, and Silversweeper too.

So I'm looking at the minor titles file: title_appointed_regent is the Designated Regent that the player can appoint manually when not in a regency, and title_regent is the actual regent whenever a regency is in effect? Do I have that right?

Entirely correct.
 
  • 1
Reactions:
Fire an event for the liege when a character gains the title_regent minor title
Just to confirm for my own understanding (because who knows when this might be useful in the future): Are you suggesting to modify the title_regent minor_title (by firing a custom character_event in its gain_effect and lose_effect blocks)? If so, that's a really neat idea, wish I'd thought of it!
 
Just to confirm for my own understanding (because who knows when this might be useful in the future): Are you suggesting to modify the title_regent minor_title (by firing a custom character_event in its gain_effect and lose_effect blocks)? If so, that's a really neat idea, wish I'd thought of it!

That's the idea.
 
  • 1
Reactions:
Trade Zone Value gives bonuses to the income of trade posts and cities. Is there any way to have it give income bonuses to other kinds of holdings too? (Temples, castles, tribes?) It's probably hardcoded, I know, but I just want to check.
 
Trade Zone Value gives bonuses to the income of trade posts and cities. Is there any way to have it give income bonuses to other kinds of holdings too? (Temples, castles, tribes?) It's probably hardcoded, I know, but I just want to check.
I don't think there is a way to have the game automatically use trade value to increase the income of cities, temples, or tribes.

That said, you probably can add a modifier to every temple, castle, or tribe in the world and keep it updated so it corresponds to the amount of trade value in the trade zone said holdings are in. The silk road and africa trade routes give bonus income to all holdings, not just cities and trade posts (though those are definitely the richest holdings): you might look closer at them to see what they are doing.
 
I don't think there is a way to have the game automatically use trade value to increase the income of cities, temples, or tribes.

That said, you probably can add a modifier to every temple, castle, or tribe in the world and keep it updated so it corresponds to the amount of trade value in the trade zone said holdings are in. The silk road and africa trade routes give bonus income to all holdings, not just cities and trade posts (though those are definitely the richest holdings): you might look closer at them to see what they are doing.
The game already does automatically use trade zone value to apply to income from cities and trade posts.

Trade route modifiers like Silk Road are applied in the trade_route files and are more or less static (other than changing based on China's status and if there's disease or war cutting off the Silk Road, that's a complex kettle of fish I don't know the first thing about how it works).

But Trade Zone Value, which is a value based on all the trade posts in a single trade zone, gives a bonus to the income of cities and trade posts within that zone, and IDK how that bonus is calculated, you can get funky numbers like +47.5% income bonus or something at the high end if I remember correctly.

Applying modifiers to every holding in the game seems like it'd eat a lot of processing power, plus it'd have to be stacking modifiers if I wanted to simulate every percentage point of a possible income bonus from a trade zone, assuming it's even possible to check for Trade Zone Value (I assume it is, but haven't checked), much less update it frequently enough to be relevant.
 
Good evening, I am using Audax.Validator (1.35.3) for the first time to help find issues my mod may have and doesn't seem like it wants to find my mod, any advice would be appreciated.

Mod not found: Greco-Norman + The Sicilian Expedition
Mods in system: A Game of Thrones, A Game of Thrones
[Error] Could not load mod file: C:\Users\BLANK\OneDrive\Documents\Paradox Interactive\Crusader Kings II\mod\Greco-Norman + The Sicilian Expedition.mod [Illegal closing bracket.]
[Error] Could not load mod file: C:\Users\BLANK\OneDrive\Documents\Paradox Interactive\Crusader Kings II\mod\Greco-Norman + The Sicilian Expedition.mod [Illegal closing bracket.]
 
I don't think there is a way to have the game automatically use trade value to increase the income of cities, temples, or tribes.

That said, you probably can add a modifier to every temple, castle, or tribe in the world and keep it updated so it corresponds to the amount of trade value in the trade zone said holdings are in. The silk road and africa trade routes give bonus income to all holdings, not just cities and trade posts (though those are definitely the richest holdings): you might look closer at them to see what they are doing.
Sorry if my prior post seems ungrateful. I am glad you took the time to reply. Thank you!
 
Good evening, I am using Audax.Validator (1.35.3) for the first time to help find issues my mod may have and doesn't seem like it wants to find my mod, any advice would be appreciated.

Mod not found: Greco-Norman + The Sicilian Expedition
Mods in system: A Game of Thrones, A Game of Thrones
[Error] Could not load mod file: C:\Users\BLANK\OneDrive\Documents\Paradox Interactive\Crusader Kings II\mod\Greco-Norman + The Sicilian Expedition.mod [Illegal closing bracket.]
[Error] Could not load mod file: C:\Users\BLANK\OneDrive\Documents\Paradox Interactive\Crusader Kings II\mod\Greco-Norman + The Sicilian Expedition.mod [Illegal closing bracket.]

You enter the mod's name as it appears in the launcher, not the .mod file's filename.
 
Good evening, I am using Audax.Validator (1.35.3) for the first time to help find issues my mod may have and doesn't seem like it wants to find my mod, any advice would be appreciated.

Mod not found: Greco-Norman + The Sicilian Expedition
Mods in system: A Game of Thrones, A Game of Thrones
[Error] Could not load mod file: C:\Users\BLANK\OneDrive\Documents\Paradox Interactive\Crusader Kings II\mod\Greco-Norman + The Sicilian Expedition.mod [Illegal closing bracket.]
[Error] Could not load mod file: C:\Users\BLANK\OneDrive\Documents\Paradox Interactive\Crusader Kings II\mod\Greco-Norman + The Sicilian Expedition.mod [Illegal closing bracket.]

First: Check inside the .mod file to ensure that the curly brackets are correct.
(In my experience, CK2 has a tendency to mangle the .mod file when it uploads to the workshop. This is not a problem for CK2 itself, but it makes the Validator very unhappy.)

Then: Make sure the dropdown near the top right of the Validator is set to "main mod errors".
(TBH I'm not 100% sure what the other options do, as I discovered a long time ago that this was the best choice for my purposes.)

Then: Try removing spaces, capitals and special characters from the .mod filename and all subfolder names.
(Eg: "greco-norman_and_the_sicilian_expedition.mod")
(This is probably a bit time-consuming, which is why I'm suggesting you try the other possibilities first!)
(Here, I'm not suggesting you change the human-readable name in the "name" property of the .mod file doesn't need to change - only the file- and folder-paths.)
(I think the most likely issue here is the "+" character, but testing every possibility one-by-one could take a lot of time, so why not throw everything at it?! Also, standardising on lowercase and "no spaces or weird characters" is a very useful coding convention IMO.)
 
If I use the scope random_realm_province or any_realm_province on a landed ruler who has vassals but is not independent (either a duke who owes fealty to an independent king or emperor, or a king who owes fealty to an emperor), will that find all provinces within his own demesne and his vassals, or will that find all provinces under the highest independent liege?

If I want to do something to provinces under, say, the Duke of Swabia, I don't want to do anything to all provinces under his liege the Holy Roman Emperor.
 
If I use the scope random_realm_province or any_realm_province on a landed ruler who has vassals but is not independent (either a duke who owes fealty to an independent king or emperor, or a king who owes fealty to an emperor), will that find all provinces within his own demesne and his vassals, or will that find all provinces under the highest independent liege?

If I want to do something to provinces under, say, the Duke of Swabia, I don't want to do anything to all provinces under his liege the Holy Roman Emperor.
It should find provinces that are either in the character's demesne or in his vassals' demesnes. But it's always worth testing this kind of thing for your own understanding (with a quick event/decision/etc).
 
First: Check inside the .mod file to ensure that the curly brackets are correct.
(In my experience, CK2 has a tendency to mangle the .mod file when it uploads to the workshop. This is not a problem for CK2 itself, but it makes the Validator very unhappy.)

Then: Make sure the dropdown near the top right of the Validator is set to "main mod errors".
(TBH I'm not 100% sure what the other options do, as I discovered a long time ago that this was the best choice for my purposes.)

Then: Try removing spaces, capitals and special characters from the .mod filename and all subfolder names.
(Eg: "greco-norman_and_the_sicilian_expedition.mod")
(This is probably a bit time-consuming, which is why I'm suggesting you try the other possibilities first!)
(Here, I'm not suggesting you change the human-readable name in the "name" property of the .mod file doesn't need to change - only the file- and folder-paths.)
(I think the most likely issue here is the "+" character, but testing every possibility one-by-one could take a lot of time, so why not throw everything at it?! Also, standardising on lowercase and "no spaces or weird characters" is a very useful coding convention IMO.)
Thank you. It was the brackets in the .mod file.
 
  • 1Like
Reactions:
The game already does automatically use trade zone value to apply to income from cities and trade posts.

Trade route modifiers like Silk Road are applied in the trade_route files and are more or less static (other than changing based on China's status and if there's disease or war cutting off the Silk Road, that's a complex kettle of fish I don't know the first thing about how it works).

But Trade Zone Value, which is a value based on all the trade posts in a single trade zone, gives a bonus to the income of cities and trade posts within that zone, and IDK how that bonus is calculated, you can get funky numbers like +47.5% income bonus or something at the high end if I remember correctly.

Applying modifiers to every holding in the game seems like it'd eat a lot of processing power, plus it'd have to be stacking modifiers if I wanted to simulate every percentage point of a possible income bonus from a trade zone, assuming it's even possible to check for Trade Zone Value (I assume it is, but haven't checked), much less update it frequently enough to be relevant.
I agree that it is probably processor intensive to keep it updated, although you might be able to save processor time by only updating it when something actually changes, but since "simple" changes could have effects across the whole world, it would probably be better to simply have it update on a pulse (either yearly or monthly).

How trade value affects income is listed on this page on the wiki. I am not sure where they got the formula from, but it seems to track with what I have observed in game. It should be possible to get the trade value for the zone that includes the province, but I have no idea what the relevant command would be. Then you would just need to put the correct number of stacking modifiers on the holdings each time you updated.

I happen to agree that this is probably way more work than it is worth. Good luck.
 
Does anyone know what the difference between trade_route_wealth and trade_route_value? I think there is also a "trade_route_income", but it doesn't show up on the wiki and I cannot find any examples so I might have imagined it (or it might be a localization of something else).

I am trying to make a patrician trade-post building that increases the total value of a trade route and gives some income based on the trade route itself. only trade_route_wealth seems to get used in vanilla trade post buildings.
 
Last edited: