Jump to content

CK2 Modding Quick Question Thread


Recommended Posts

8 minutes ago, lockeslylcrit said:

There are no "tribal armies". Only armies with different unit compositions, numbers, and modifiers.

If you mean units that are the same as the decision tribals get, then just look in the /decisions/unit_decisions.txt file and search for raise_tribal_units decision. You can copy and paste the effect into an event.

Thank you for the directions.

Link to comment
4 minutes ago, AlexWyrmin said:

war = { target = PREVPREV casus_belli = duchy_adventure thirdparty_title = PREV tier = DUKE }

Could someone explain to me how to use this kind of line correctly?

 

character_scope = {
	title_scope = {
		war_scope = {
			PREV jumps back one scope, affecting the title.
			PREVPREV jumps back two scopes, affecting the character.
			THIS means the current scope (war)
			
poor_sap_who_is_getting_attacked = {
	title_being_warred_over = {
		war = { 
			target = PREVPREV 
			casus_belli = duchy_adventure 
			thirdparty_title = PREV 
			tier = DUKE 
		}
	}
}

 

Link to comment

Fair warning to anyone trying to add events to a character's personal history directly, like I was trying to do: it makes the sections of the map close to their seat of power go completely bonkers, at least if you're starting in 769.

 

Also, are the consequences of losing a war modded like below written right to ensure Haraldr gets offed at the end of it?

	on_reverse_demand = {
		ROOT = {
			piety = -200
			transfer_scaled_wealth = {
				to = FROM
				value = 2.0
			if = {
				limit = {
					has_character_flag = king_harald_sjaelland
					death = {
						death_reason = death_battle
					}
				}
			}
		}

 

Link to comment

I need some more help on the static portraits ? I have been trying to use the file that was sent to me by lockeslylcrit but am still having problems. The file worked once in the console but on the wrong character ( that was my own fault ) but I was never able to repeat it and ideally I would want it to function without the use of the console but through the event script.

 

Comparing  the files you sent me with the Red Sonja example you used I am still wondering when to use the name of the template file ( the collected 27 frames, in my case various_beast) and when to use the name of the single portrait file ( a single picture in the chain of 27 pictures, in my case fighting _dog ).

 

For example in the interface sprite file:

 

the red sonja example shows

Spoiler

priteTypes = {

# Misc characters
    spriteType = {
        name = "GFX_portrait_dwtw_others"
        texturefile = "gfx/static_portraits/dwtw_others.dds"
        noOfFrames = 27
        norefcount = yes
        can_be_lowres = yes
    }

 

This would correspond to using the 27 frame file twice.

the file you sent me, however, combines the two different file names

 

Spoiler

spriteTypes = {
    spriteType = {
        name = "GFX_portrait_fighting_dog"
        texturefile = "gfx/static_portraits/various_beast.dds"
        noOfFrames = 27
        norefcount = yes
        can_be_lowres = yes
    }

 

 

The same thing is true for the Portrait file

 

Red Sonja:

 

Spoiler

portraitType = {
        name = "PORTRAIT_dwtw_others_static" # would correspond to various_beast
        effectFile = "gfx/FX/portrait.lua"
        weight = {
            additive_modifier = {
                value = 100000
                portrait_clothing = yes
                    OR = {
                        portrait_has_trait = dwtw_others1 # Fleur-de-Lis  # would correspond to fighting_dog
                        portrait_has_trait = dwtw_others2 # Lockesly L'Crit
                        portrait_has_trait = dwtw_others3 # Red Sonja
                        portrait_has_trait = houseirae_others4 # Broken Waterlily
                        portrait_has_trait = houseirae_others5 # Thicc Waterlily
                    }
             }
        }

        layer = {
            "GFX_empty:p0"
            "GFX_empty:c0"
            "GFX_empty:c2"
            "GFX_empty:c3"
            "GFX_empty:c1"
            "GFX_empty:c4"
            "GFX_empty:p1:h:y"
            "GFX_empty:p6"
            "GFX_portrait_dwtw_others:c5" # would correspond to various_beast
        }

        allow_property_values = {
            1 = {
                0  = { always = yes }
            }
            19 = {
                0  = { always = yes }
            }
            33 = {
                0  = { always = yes }
            }
            34 = {
                0  = { always = yes }
            }
            35 = {
                0  = { always = yes }
            }
            36 = {
                0  = { always = yes }
            }
            6 = {
                0  = { always = yes }
            }
            5 = {
                0 = { always = no }
                1 = { portrait_has_trait = dwtw_others1 }
                2 = { portrait_has_trait = dwtw_others2 }
                3 = { portrait_has_trait = dwtw_others3 }    # would correspond to fighting_dog
                4 = { portrait_has_trait = houseirae_others4 }
                5 = { portrait_has_trait = houseirae_others5 }
                6 = { always = no }
                7 = { always = no }
                8 = { always = no }
                9 = { always = no }
                10 = { always = no }
                11 = { always = no }
                12 = { always = no }
                13 = { always = no }
                14 = { always = no }
                15 = { always = no }
                16 = { always = no }
                17 = { always = no }
                18 = { always = no }
                19 = { always = no }
                20 = { always = no }
                21 = { always = no }
                22 = { always = no }
                23 = { always = no }
                24 = { always = no }
                25 = { always = no }
                26 = { always = no }
            }
        }
    }

}

The file you sent me

Spoiler

portraitType = {
        name = "PORTRAIT_fighting_dog_static"  #according to the red sonja logic this should be "PORTRAIT_various_beast_static"
        effectFile = "gfx/FX/portrait.lua"
        weight = {
            additive_modifier = {
                value = 1000000
                portrait_clothing = yes
                OR = {
                    portrait_has_trait = fighting_dog
                    portrait_has_trait = companion_dog
                    portrait_has_trait = breeding_dog
                }
             }
        }

        layer = {
            "GFX_empty:c0"
            "GFX_empty:c2"
            "GFX_empty:c3"
            "GFX_empty:c1"
            "GFX_empty:c4"
            "GFX_empty:p1:h:y"
            "GFX_portrait_fighting_dog:c5" #according to the red sonja logic this should be "GFX_PORTRAIT_various_beast"
        }

        allow_property_values = {
            1 = {
                0 = { always = yes }
            }
            
             19 = {
                0  = { always = yes }
            }
            33 = {
                0  = { always = yes }
            }
            34 = {
                0  = { always = yes }
            }
            35 = {
                0  = { always = yes }
            }
            36 = {
                0  = { always = yes }
            }
            6 = {
                0  = { always = yes }
            }
            5 = {
                0 = { always = no }
                1 = { portrait_has_trait = fighting_dog }
                2 = { portrait_has_trait = companion_dog }
                3 = { portrait_has_trait = breeding_dog }
                4 = { portrait_has_trait = 0 }
                5 = { portrait_has_trait = 0 }
                6 = { portrait_has_trait = 0 }
                7 = { portrait_has_trait = 0 }
                8 = { portrait_has_trait = 0 }
                9 = { portrait_has_trait = 0 }
                10 = { portrait_has_trait = 0 }
                11 = { portrait_has_trait = 0 }
                12 = { portrait_has_trait = 0 }
                13 = { portrait_has_trait = 0 }
                14 = { portrait_has_trait = 0 }
                15 = { portrait_has_trait = 0 }
                16 = { portrait_has_trait = 0 }
                17 = { portrait_has_trait = 0 }
                18 = { portrait_has_trait = 0 }
                19 = { portrait_has_trait = 0 }
                20 = { portrait_has_trait = 0 }
                21 = { portrait_has_trait = 0 }
                22 = { portrait_has_trait = 0 }
                23 = { portrait_has_trait = 0 }
                24 = { portrait_has_trait = 0 }
                25 = { portrait_has_trait = 0 }
                26 = { portrait_has_trait = 0 }
            }
        }
    }

 

I've tried both solutions but neither works. Although your file did work once. Could you eliminate one approach for me so I can concentrate on the correct one?

Link to comment
15 minutes ago, joemann said:

        name = "GFX_portrait_fighting_dog"
        texturefile = "gfx/static_portraits/various_beast.dds"

It absolutely does not matter if the two names are completely different. The bottom name is the actual filename of the file sitting on your computer. The top name is the code name you tell CK2 to assign to the file, to be used elsewhere in the interface. This is the most important one, and the one that can be customized.

 

32 minutes ago, joemann said:

portraitType = {
        name = "PORTRAIT_fighting_dog_static"

This name is not important, at all. It just tells the game "hey, here's a new portrait layer!". You can name it whatever the hell you want, as long as it is unique.

 

 

Your code seems solid, but the question I now have to ask is, did you make the traits in the /common/traits/ folder? portrait_has_trait wont work unless there are, yanno, actual traits the portrait looks for.

 

Link to comment

Remodded the subjugation casus belli. Does the synthax of the paragraph below make sense?

		FROM = {
			piety = -100
			transfer_scaled_wealth = {
				to = ROOT
				value = 1.0
			}
			prestige = -100
			
			if = {
				limit = {
					is_reformed_religion = ROOT
					controls_religion = no
				}
				religion = ROOT # Reformed pagans are forced to convert back
			}
			if = {
				limit = {
					OR = {
						religion = germanic_pagan
						religion = germanic_pagan_reformed
					}
				}
				death = {
					death_reason = death_battle
				}
			}
			
			custom_tooltip = {
				text = tribal_subjugation_tip
			}
				
			hidden_tooltip = {
				opinion = {
					modifier = opinion_subjugated 
					who = ROOT
				}
				any_vassal = {
					opinion = {
						modifier = opinion_subjugated
						if = {
							limit = {
								OR = {
									religion = germanic_pagan
									religion = germanic_pagan_reformed
								}
							}
							modifier = opinion_einherjar_recruiter
						}
						who = ROOT
					}
				}

 

Link to comment

I have defined the trait in common/interface/traits/remedy_portrait_traits

 

fighting_dog = {
    hidden = yes   # Do I want this hidden?
    customizer = no
    random = no
}

Should it be in the traits folder?

 

In the event I use: trait = fighting_dog should this be:  portrait_has_trait ?

Link to comment
21 minutes ago, joemann said:

I have defined the trait in common/interface/traits/remedy_portrait_traits

 

There's your problem. It has to be in the /common/traits/ folder.

 

22 minutes ago, joemann said:

In the event I use: trait = fighting_dog should this be:  portrait_has_trait ?

No

Link to comment

Given that trying to mod a character's personal history before 769 seems to wreak havoc on the game map, I tried to spawn literal event troops but they don't show up, so what did I write wrong?

character_event = {
	id = KHsWfV.1
	hide_window = yes
	is_triggered_only = yes # Triggered from on_startup
	trigger = {
		has_character_flag = king_sigurd_svitjod
		war_with = {
			any_independent_ruler = {
				has_character_flag = king_harald_sjaelland
			}
		}
	}
	raise_tribal_units = {
		spawn_unit = {
			owner = 194004
			province = 290 # Uppland
			troops = {
				archers = { 500 500 }
				light_infantry = { 1500 1500 }
				heavy_infantry = { 300 300 }
				light_cavalry = { 200 200 }
			}
			attrition = 1.0
			disband_on_peace = yes
			maintenance_multiplier = 0.5
		}
	}
}

 

Link to comment

Well, for one thing, you added a decision as an effect.

 

There is no command or scope for raise_tribal_units. Remove that line and the matching bracket.

 

Alternatively, replace it with:

 

character_event = {
	id = KHsWfV.1
	hide_window = yes
	is_triggered_only = yes # Triggered from on_startup
	trigger = {
		has_character_flag = king_sigurd_svitjod
		war_with = {
			any_independent_ruler = {
				has_character_flag = king_harald_sjaelland
			}
		}
	}
	capital_scope = { # Sets the scope of the capital (should be Uppland). Alternatively, use location instead of capital_scope to spawn the units at the location of the character instead of the capital.
		PREV = { # Resets the scope back to the previous one (ROOT)
			spawn_unit = {
				owner = THIS # Goes to PREV, which then goes to ROOT, which means the character anyone with the character flag king_sigurd_svitjold
				province = PREV # Will spawn in the previous scope (the capital)
				home = PREV # Assigns the home province, if you choose to spawn it somewhere else
				leader = THIS # Assigns the primary leader of the army
				troops = {
					archers = { 500 500 }
					light_infantry = { 1500 1500 }
					heavy_infantry = { 300 300 }
					light_cavalry = { 200 200 }
				}
				attrition = 1.0
				disband_on_peace = yes
				maintenance_multiplier = 0.5
			}
		}
	}
}

 

Link to comment
3 hours ago, AlexWyrmin said:

If I add gain_title = FROM to the results of winning a war, without specifying what title I'm talking about, do I end up usurping every title personally held by my former opponent?

You could try, but likely it will bug out without assigning a scope.

 

Try ROOT = { any_demesne_title = { gain_title = FROM } }

Link to comment
ROOT = { usurp_title = { target = PREV type = invasion } }

Does this string imply that to get more out of a subjugation war, other than just your opponent's top title, you need to proceed like you started it using an invasion casus belli instead?

 

P.S. I already modded the relevant casus belli to target titles lower than my own.

Link to comment
1 hour ago, AlexWyrmin said:

ROOT = { usurp_title = { target = PREV type = invasion } }

Does this string imply that to get more out of a subjugation war, other than just your opponent's top title, you need to proceed like you started it using an invasion casus belli instead?

 

P.S. I already modded the relevant casus belli to target titles lower than my own.

No. You're gonna have to specify titles beneath the character if you want more, using vassalize_or_take_under_title. An example from the vanilla files:

 

	on_success_title = {
		if = { # Claim the targeted Kingdom if it is held by the target
			limit = {
				controls_religion = no
				holder_scope = {
					OR = {
						character = FROM
						is_liege_or_above = FROM
					}
				}
			}
			usurp_title = { target = ROOT type = invasion }
		}
		ROOT = {
			vassalize_or_take_under_title = {
				title = PREV
				enemy = FROM
				type = invasion
			}
			hidden_tooltip = {
				vassalize_or_take_under_title = {
					title = PREV
					enemy = FROM
					type = invasion
				}
			}
		}

 

Link to comment

title = PREV will point to on_success (character scope), not on_success_title (title scope). You're going to take nothing if you do it like this.

 

Even if it was on_success_title, the only thing you're going to take are titles under the main title (baronies if targeting the county, counties if targeting the duchy, etc), not the main title itself. Add in usurp_title = { target = ROOT type = invasion } to take the main title too.

Link to comment
4 minutes ago, lockeslylcrit said:

title = PREV will point to on_success (character scope), not on_success_title (title scope). You're going to take nothing if you do it like this.

 

Even if it was on_success_title, the only thing you're going to take are titles under the main title (baronies if targeting the county, counties if targeting the duchy, etc), not the main title itself. Add in usurp_title = { target = ROOT type = invasion } to take the main title too.

*facepalm* I can't believe I didn't notice up until now that pagan subjugation had no on_success_title paragraph.

Link to comment

Something complete different, but I wanted to tell you.

 

If you hadn't read it yet, you can now have opinion towards a specific trait. 

 

Patch:

  • It is now possible to specify characters' opinions of specific traits, and specify their opinion effect on people with specific traits. "lustful_opinion = 10" for example will now make Lustful characters like you more. "opinion_of_lustful = -10" will make you dislike lustful characters. Works in any modifier (E.G., traits, artifacts, event modifiers). Has to be defined in the modifier definitions folder, just like religion and culture opinion

 

And it WORKS :D.

Link to comment
51 minutes ago, AlexWyrmin said:

Given that there are four traits outing a character as someone who murdered a relative, is there also a "is_kin" check or something similar?

is_close_relative

47 minutes ago, Abominus said:

Something complete different, but I wanted to tell you.

 

If you hadn't read it yet, you can now have opinion towards a specific trait. 

 

Patch:

  • It is now possible to specify characters' opinions of specific traits, and specify their opinion effect on people with specific traits. "lustful_opinion = 10" for example will now make Lustful characters like you more. "opinion_of_lustful = -10" will make you dislike lustful characters. Works in any modifier (E.G., traits, artifacts, event modifiers). Has to be defined in the modifier definitions folder, just like religion and culture opinion

 

And it WORKS :D.

Yep. 

 

image.png.c0b2ea9e6caaa19c7de9e8868c8df3c5.png

 

It's a bitch and a half to code, though. Dark World has so many fucking traits.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use