• 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.
Here you are!

Code:
song = {
    name = "ascalon.ogg"
    
    chance = {
        factor = 5
        modifier = {
            factor = 0.1
            has_called_crusade = no
        }
        modifier = {
            factor = 2
            crusade_target = {
                ROOT = {
                    location = {
                        kingdom = {
                            title = PREVPREVPREV
                        }
                    }
                }
            }
        }
    }        
}
That's weird. It this the Holy Land DLC? I'm not even sure what that's targeting. If the crusade target is a kingdom owned by the player? What?
 
In landed_titles.txt, can I code that a title requires ownership of specific lands/titles in order to be created? For example, require you own 2 duchies in Naples to create the titular Kingdom of Naples? Or requiring you control both counties in Cyprus to create its duchy (instead of the usual 50%).
 
Also, is there any way to add a list of surnames (dynasties) into the cultures.txt for CK2 to use for random characters? It seems to only take from the city/temple/castle names, which is a bit lame.

How about a list of names for cities/temples/castles for when you build a new one in game?
 
In landed_titles.txt, can I code that a title requires ownership of specific lands/titles in order to be created? For example, require you own 2 duchies in Naples to create the titular Kingdom of Naples? Or requiring you control both counties in Cyprus to create its duchy (instead of the usual 50%).
Snippet from CK2Plus:
Code:
	allow = {
		NOT = { e_france = { holder_scope = { character = ROOT } } }
		religion_group = christian
	}

Also, won't the game use dynasties.txt to pull randoms? There's a ton and they're all culture-specific, so I can't imagine that they're all specifically defined.
 
AFAIK The chance to invite to court is hard coded.

However people getting captured is all done via events, so that can be changed. The current events are in events\battle_events.txt, but capturing people is only limited by your event scripting skills and your imagination.

Well, my skills are rather limited, but I did find this in the battle_events.txt:

Code:
#On-action battle_lost: Imprisoned by the enemy
character_event = {
	id = 250
	is_triggered_only = yes
	
	picture = "GFX_evt_into_the_dungeon"

	desc = "EVTDESC250"
	
	trigger = {
		is_alive = yes
		prisoner = no
		NOT = {
			character = FROM
		}
	}

Phrased like so, it seems like anyone could be captured, regardless of who they are, and even if they have no titles at all. Alright, next I look in on_actions.txt and find this:

Code:
#character
on_battle_lost = {
	random_events = {
		900 = 0
		50 = 250 # Imprisoned by the enemy
		50 = 8320 # Crusader becomes cynical
	}
}

Alright, so it's in there after all, so yay for that. Then I look underneath it and find this:

Code:
#on_siege_lost = {
#
#}

Hmmm, a lump of nothing.

SO... here is what I am thinking, and I'm probably wrong of course, but if I were to copy & paste some of that "on_battle_lost stuff" into the empty "on_siege_lost" area, then would it trigger the same events during a siege as it does in a battle? And would it properly aim it at the at-home defender of the siege, or would it just say "who?" and fail to trigger? Something like this:

Code:
#on_siege_lost = {
	random_events = {
		900 = 0
		50 = 250 # Imprisoned by the enemy
	}
}

Do you think that would do the trick? Or do I need something more elaborate?

And finally, I have not been able to locate any actual probability modifiers. It says that it checks once per "combat pulse," but what do the numbers inside mean? What is "2750 = 0" mean? Or "10 = 255?" I'm confuzzled.
 
As long as the imprisonment-event doesn't have a clause invalid if fired from a siege, that should work.

And the numbers are the probability of the specific option being chosen. So, if you lose a battle, in 900 of 1000 cases nothing happens, in 50 cases you're captured and in 50 cases you become cynical if you're a crusader (whatever event that is).
 
NephilimNexus,

It is good what you are doing. I wanted to say that you need to remove the '#' from in front of on_siege_lost.

The numbers seem to refer to the weight of events and how often they will trigger. "2750 = 0" means that by and large nothing will happen when conditions are met for an event of that kind to trigger. So for your lost siege events, out of 950 times that a siege is lost, in 900 instances nothing will happen, while in 50 instances prisoners will be taken.

EDIT: I tip my hat to Dragnar.
 
So...

Code:
on_siege_lost = {
	random_events = {
		900 = 0
		50 = 250 # Imprisoned by the enemy
	}
}

... should work? I'll have to try it. If I want to make it a nearly defacto event (99% chance), then, maybe...

Code:
on_siege_lost = {
	random_events = {
		1 = 0
		99 = 250 # Imprisoned by the enemy
	}
}

... would do it? I'll go test it, see if anything explodes. Back soon!
 
We'll know for sure, when you try.
As there are no vanilla siege_lost events, no one knows if they actually fire for the owner of the sieged province. They could fire for the province itself, in which case you'd have to write a version of the imprisonment-event that switches scope.
Or they could do something else entirely, like firing for the liege of the province.
Try it, for science!
 
In landed_titles.txt, can I code that a title requires ownership of specific lands/titles in order to be created? For example, require you own 2 duchies in Naples to create the titular Kingdom of Naples? Or requiring you control both counties in Cyprus to create its duchy (instead of the usual 50%).

you can use the has_landed_tilte command
Code:
	allow = {
              AND = {
				has_landed_title = d_xxx
				has_landed_title = d_xxx
					}
				}
you can play with "AND" "OR" and "NOT" to make your differnet combinations.
for counties -last time I check it didn't work with c_XXX, as a turn around I used the baronies as conditions.


Also, is there any way to add a list of surnames (dynasties) into the cultures.txt for CK2 to use for random characters? It seems to only take from the city/temple/castle names, which is a bit lame.

How about a list of names for cities/temples/castles for when you build a new one in game?

-to add surnames, you have to add them in common/dynasties.txt
-names for additional holdings are set in each history/provinces/000 - nameofprovince.txt files. the available additional names are commented with "#". keep in mind the name is randomly chosen when you build the holding

Also, won't the game use dynasties.txt to pull randoms? There's a ton and they're all culture-specific, so I can't imagine that they're all specifically defined.
yes it does. indeed not all are specifically defined (a lot)
 
-to add surnames, you have to add them in common/dynasties.txt
-names for additional holdings are set in each history/provinces/000 - nameofprovince.txt files. the available additional names are commented with "#". keep in mind the name is randomly chosen when you build the holding

I think the surnames in dynasties.txt is only related with historical characters in the history folder.
The other surnames and settlement names are generated from the barony names in the landed_titles.txt. Interestingly, a character with surname X is generated, even if settlement X is not built in game.
 
I have been using the bottom code to force the AI to form a serene republic once it has the pre-reqs to do it. Would there be a way for me to have the money requirement scale depending on their power? (I'd like the money cost to scale the same way, or a similar way, to the way titular kingdom money cost does). The way titular kingdom cash cost works, it costs less and less to make a titular kingdom the more land you own down to a minimum of something around 350 when you have a lot of duchies (I believe 6-8?)

Code:
#Formation of the Most Serene Republic of Genoa
decisions = {
    serene_republic_of_genoa = {
        potential = {
            ai = yes
            is_republic = yes
            independent = yes
            has_landed_title = c_genoa
            num_of_duke_titles = 2
			NOT = {
				num_of_king_titles = 1
			}
            piety = 100
            wealth = 800
			war = no
        }
        effect = {
            k_genoa = { gain_title = ROOT }
            prestige = 250
            piety = -100
            wealth = -800
        }
        revoke_allowed = {
            always = no
        }
        ai_will_do = {
            factor = 1                    
        }
    }
}
 
That's weird. It this the Holy Land DLC? I'm not even sure what that's targeting. If the crusade target is a kingdom owned by the player? What?

Yes, it's the Holy Land DLC (I own all three, I opened one at random. If you prefer, I'll post the "Avalon" one.
As for the question, I'd suppose the modifier refers to a crusade which has for target a kingdom owned by the player. You can see the modifier is for giving half the potential for a crusade against the player. Otherwise the factor would be 5 or 0.1 in case there is no crusade.
 
I think the surnames in dynasties.txt is only related with historical characters in the history folder.
The other surnames and settlement names are generated from the barony names in the landed_titles.txt. Interestingly, a character with surname X is generated, even if settlement X is not built in game.
This is what I suspected, or feared, ha. Adding it to the future suggestion box!
 
I think the surnames in dynasties.txt is only related with historical characters in the history folder.

Lots of those surnames are unused for characters in the history folder -especially double occurences. Pretty sure they are used for random characters.
 
I tried to replace job_description_spiritual with job_description_spiritual_iberian (and so on), but it doesn't work.
It works only job_spiritual_iberian, but what is its purpose (it was job_spiritual_christian, zoroastrian, muslim)? Only to change the name?
I want to "localize" the description too, since I want to mod WoT and I need different names for Aes Sedai, Wise Ones, Windfinders and whatevers (not damanes, the won't replace the "Bishop"'s job).
 
I can confirm the following:

a) it is possible for the game to read modifier_icons.tga - which greatly enhance the graphic quality - *BUT* you need to rename modifier_icons.dds in the \\Crusader Kings II\gfx\interface folder to something else since that format seems to be the preferred one by the game;

b) I now have 112 modifiers so there's no limit at the 100 mark.