Jump to content

CK2 Modding Quick Question Thread


Recommended Posts

Posted

The only thing I can actually think of that would bypass the immortal restriction on child portraits is an on_adulthood on action events.

 

narrative_event = {
	id = blahblahwhenbloodlineiscreated
	desc = blah
	picture = blahblah
	title = blahblahblah
	is_triggered_only = yes
	
	option = {
		name = blahblahblahblah
		hidden_tooltip = {
			any_character = {
				limit = {
					OR = {
						trait = eight_tails
						trait = nine_tails
					}
					is_adult = yes
					practical_age < 50
				}
				remove_trait = eight_tails
				add_trait = nine_tails
				add_trait = immortal
				add_to_bloodline = blahblahbloodline
			}
			any_character = {
				limit = {
					OR = {
						trait = eight_tails
						trait = nine_tails
					}
					is_adult = no
				}
				remove_trait = eight_tails
				add_trait = nine_tails
				add_to_bloodline = blahblahbloodline
			}
		}
	}
}


character_event = {
	id = blahblahonadulthood.1
	hide_window = yes
	trigger = {
		is_bloodline_member_of = blahblahbloodline
		OR = {
			trait = nine_tails
			trait = eight_tails
		}
	}
	immediate = {
		remove_trait = eight_tails
		add_trait = nine_tails
		add_trait = immortal
	}
}

 

Posted
43 minutes ago, Rascalov1337 said:

"immortal_age" is a command from character creation in history files, so you can set the age when your preset character became immortal, just wanted to test if it works in events too.

 

Still, there is a severe lack of any information about how exactly immortality works, at least other flags pretty self explanatory, there is no confusion about what, for example, "inherit_chance" or "cannot_marry" flags do. What happens on removing traits with "immortal = yes" flag, is character age resets to their actual age, or just starts from where it stopped? This flag exist for a several years and it seems like no one ever tried to test things with it, i can't find any useful info on it.

Just added "immortal = yes" to a random trait that by default it doesn't have it (tiny_tits) and tested it giving the trait to a random count.

 

It works exactly the same as the "immortal" trait, minus the 10 health bonus.

It freezes the character at the age that he got the trait, staying the same (young) even after I gave him 5000 years through console.

When I removed the trait "tiny_tits", he immediately aged into an old person, and died only days after. 

 

I hope this helps.

Posted
7 minutes ago, HierarchOfLies said:

Just added "immortal = yes" to a random trait that by default it doesn't have it (tiny_tits) and tested it giving the trait to a random count.

 

It works exactly the same as the "immortal" trait, minus the 10 health bonus.

It freezes the character at the age that he got the trait, staying the same (young) even after I gave him 5000 years through console.

When I removed the trait "tiny_tits", he immediately aged into an old person, and died only days after. 

 

I hope this helps.

Yes, helps a little, thanks. It means that one of the events i've planned for my mod is impossible. Well, until patch with "add_age" effect comes out, that is.

Now i just need to test what replacing one trait with "immortal = yes" by another with this flag will do, though i will test it myself, need to make some tweaks to that event chain anyway

Posted

Well, switching traits cause character to reset their age to actual one. I suppose there is no solution to my problem other than adding hidden trait with "immortal = yes" at earlier stages.

Posted

I'm trying to create an event in which a "bandit" at the service of a ruler organizes a special raiding party to plunder neighboring lands, which wouldn't be a problem if the said ruler was a tribal or a pagan, but I want it so that even christian feudal lords could raid with these troops.

Is it possible then, to create event troops set to raid even if the character that created them can't raid?

 

Posted
1 hour ago, HierarchOfLies said:

I'm trying to create an event in which a "bandit" at the service of a ruler organizes a special raiding party to plunder neighboring lands, which wouldn't be a problem if the said ruler was a tribal or a pagan, but I want it so that even christian feudal lords could raid with these troops.

Is it possible then, to create event troops set to raid even if the character that created them can't raid?

 

When creating said troops using spawn_unit, try the following tags:

can_toggle_looting = yes

is_looter = yes

 

It should be noted that if you want them to ONLY loot, you should set can_toggle_looting to no

 

Posted
On 11/22/2018 at 1:29 PM, AlexWyrmin said:

It doesn't, unfortunately. So it's either that "imprison = yes" is in the wrong place, along with possible synthax errors, or you need to create a custom scripted effect triggered by winning a subjugation war, rather than mod that casus belli's consequences.

Hmm, use imprison = ROOT and also move this command below set_defacto_liege just in case.

Posted
40 minutes ago, lockeslylcrit said:

When creating said troops using spawn_unit, try the following tags:

can_toggle_looting = yes

is_looter = yes

 

It should be noted that if you want them to ONLY loot, you should set can_toggle_looting to no

 

Thanks, I will try this and see if it works!

Posted
15 minutes ago, Buzhidao said:

Hmm, use imprison = ROOT and also move this command below set_defacto_liege just in case.

More specifically,

on_success = {
	FROM = { imprison = ROOT }
}
on_reverse_demand = { # If you want consequences for failing the war
	ROOT = { imprison = FROM }
}
Posted
20 minutes ago, lockeslylcrit said:

More specifically,


on_success = {
	FROM = { imprison = ROOT }
}
on_reverse_demand = { # If you want consequences for failing the war
	ROOT = { imprison = FROM }
}

Yes, that is correct.

Posted
40 minutes ago, Rascalov1337 said:

Is 450x150 are biggest event picture size for all types of events? Any way to put a bigger one?

All events can be expanded with modification to the interface file.

 

For example, this file:

zdw_narrative_eventwindow.gui

when put into your interface folder, will expand the narrative_event window to fit a LOT more text and a picture size of 450x440. Note that you'll also need the graphics files for the event window modified as well.

 

Should be noted that narrative_event is only used rarely by the base vanilla game (Charlemagne DLC and later), making it an ideal candidate for file modification. Probably not a good idea to modify character_event files, as you'll have a LOT of events that just use dead space.

 

An example of the size of the window:image.png.60fab9eb2b8f1131f21c568e149811f7.png

Posted
3 minutes ago, lockeslylcrit said:

All events can be expanded with modification to the interface file.

 

For example, this file:

zdw_narrative_eventwindow.gui

when put into your interface folder, will expand the narrative_event window to fit a LOT more text and a picture size of 450x440

Do you have it in DWTweaks? If yes, do i need to add this file if my mod is dependent on yours anyway?

Posted
2 minutes ago, Rascalov1337 said:

Do you have it in DWTweaks? If yes, do i need to add this file if my mod is dependent on yours anyway?

Yes, it was in vanilla Dark World Reborn, and thus is fully integrated into DWTweaks as a result.

No, you don't need to include it if your mod is a dependency of either DWTweaks or Dark World Reborn.

Posted
Just now, lockeslylcrit said:

Yes, it was in vanilla Dark World Reborn, and thus is fully integrated into DWTweaks as a result.

No, you don't need to include it if your mod is a dependency of either DWTweaks or Dark World Reborn.

Good, thanks!

So, i just put a bigger picture if using "narrative_event", no additional coding needed?

Posted
2 minutes ago, Rascalov1337 said:

Good, thanks!

So, i just put a bigger picture if using "narrative_event", no additional coding needed?

Correct!

The only thing you need to do is make sure the event is narrative_event, and the size of the picture you are using is 450x440 or less (I prefer 440x440, to keep things nice and square).

The picture WILL cover up everything if you accidentally use a character_event, so watch out.

 

Posted
9 minutes ago, lockeslylcrit said:

Correct!

The only thing you need to do is make sure the event is narrative_event, and the size of the picture you are using is 450x440 or less (I prefer 440x440, to keep things nice and square).

The picture WILL cover up everything if you accidentally use a character_event, so watch out.

 

Thanks again!

Now i just need to find a bunch of good pictures, too much porn everywhere, lol

Posted
5 minutes ago, lockeslylcrit said:

pinterest is a good start

Thanks, it's amazing, already found couple good pics. Hope i will find something fitting for events i already wrote there, or maybe for planned ones, also would be good.

Posted

How to make event only fire several days after becoming adult, not right on an adulthood? mean_time_to_happen doesn't do anything, and weight_multiplier, suggested by wiki for on_actions events, stops event from firing at all for me

event (no "picture" line, as i don't have one yet):

narrative_event = {
	id = tont_tails.1
	desc = tont_tails_event_01
	title = tont_tails_event_01_title
	is_triggered_only = yes
	trigger = {
		trait = kitsune
		NOR = {
			trait = one_tail
			trait = two_tails
			trait = three_tails
			trait = four_tails
			trait = five_tails
			trait = six_tails
			trait = seven_tails
			trait = eight_tails
			trait = nine_tails
		}
	}
	option = {
		name = tont_addtail_confirm
		hidden_tooltip = {
			add_trait = one_tail
		}
	}
}

on_actions file:

on_adulthood = {
	events = {
		tont_tails.1 # Gives first tail to adult kitsunes
		}
}

It works fine in this form, but i need little delay added, and i don't understand how to do it

Posted
20 minutes ago, Rascalov1337 said:

It works fine in this form, but i need little delay added, and i don't understand how to do it

 

Add a "ping" event.

 

on_adulthood = {
	events = {
		tont_tails.2 # Ping event to give adult kitsunes tails
	}
}
narrative_event = {
	id = tont_tails.1
	desc = tont_tails_event_01
	title = tont_tails_event_01_title
	is_triggered_only = yes
	option = {
		name = tont_addtail_confirm
		hidden_tooltip = {
			add_trait = one_tail
		}
	}
}	

character_event = { # Checks the requirements and then "pings" to the appropriate event some days later
	id = tont_tails.2
	hide_window = yes
	trigger = {
		trait = kitsune
		NOR = {
			trait = one_tail
			trait = two_tails
			trait = three_tails
			trait = four_tails
			trait = five_tails
			trait = six_tails
			trait = seven_tails
			trait = eight_tails
			trait = nine_tails
		}
	}
	immediate = {
		narrative_event = { id = tont_tails.1 days = 3 }
	}
}

 

Posted
15 minutes ago, lockeslylcrit said:

 

Add a "ping" event.

 


on_adulthood = {
	events = {
		tont_tails.2 # Ping event to give adult kitsunes tails
	}
}

narrative_event = {
	id = tont_tails.1
	desc = tont_tails_event_01
	title = tont_tails_event_01_title
	is_triggered_only = yes
	option = {
		name = tont_addtail_confirm
		hidden_tooltip = {
			add_trait = one_tail
		}
	}
}	

character_event = { # Checks the requirements and then "pings" to the appropriate event some days later
	id = tont_tails.2
	hide_window = yes
	trigger = {
		trait = kitsune
		NOR = {
			trait = one_tail
			trait = two_tails
			trait = three_tails
			trait = four_tails
			trait = five_tails
			trait = six_tails
			trait = seven_tails
			trait = eight_tails
			trait = nine_tails
		}
	}
	immediate = {
		narrative_event = { id = tont_tails.1 days = 3 }
	}
}

 

I actually never even thought about this, which is funny, because i already use similar thing for cooldown thingy for my magic decisions.

 

Big thanks to you, @lockeslylcrit, i highly appreciate all help you and other people in this thread provides to me.

Posted

Is this correct usage of "if" statement?

option = {
		name = tont_addtail_confirm
		if = {
			limit = {
				trait = three_tails
			}
			hidden_tooltip = {
				remove_trait = three_tails
				add_trait = four_tails
			}
			break = yes
		}
		else_if = {
			limit = {
				trait = five_tails
			}
			hidden_tooltip = {
				remove_trait = five_tails
				add_trait = six_tails
			}
			break = yes
		}
		else_if = {
			limit = {
				trait = seven_tails
			}
			hidden_tooltip = {
				remove_trait = seven_tails
				add_trait = eight_tails
			}
			break = yes
		}
	}

Validator doesn't complain, but i still want to check if i understood it right.

 

And another question related to "if":

Is this possible to compress these decisions in one or two by using similar structure, and if yes: Is it even worth it, or i can keep them separate without any problems (perfomance, etc.)?

Lots of code in spoiler:

Spoiler

decisions = {

	tont_get_second_tail = { 
		potential = {
			trait = kitsune
			trait = one_tail
		}
		allow = {
			piety = 400
			age = 20
		}
		effect = {
			piety = -400 # Half of this piety will be refunded
			narrative_event = {
				id = tont_tails.20
			}
		}
	}
	
	tont_get_third_tail = {
		potential = {
			trait = kitsune
			trait = two_tails
		}
		allow = {
			piety = 800 
			age = 30
			}
		effect = {
			piety = -800 # Half of this piety will be refunded
			character_event = {
				id = tont_tails.30
			}
		}
	}
	
	tont_get_fourth_tail = {
		potential = {
			trait = kitsune
			trait = three_tails
		}
		allow = {
			piety = 1200
			age = 40
			}
		effect = {
			piety = -1200 # Half of this piety will be refunded
			narrative_event = {
				id = tont_tails.40
			}
		}
	}
	tont_get_fifth_tail = {
		only_playable = yes
		potential = {
			trait = kitsune
			trait = four_tails
		}
		allow = {
			piety = 1600
			age = 50
			}
		effect = {
			piety = -1600 # Half of this piety will be refunded
			character_event = {
				id = tont_tails.50
				}
		}
	}
	tont_get_sixth_tail = {
		only_playable = yes
		potential = {
			trait = kitsune
			trait = five_tails
		}
		allow = {
			piety = 2000
			age = 60
			}
		effect = {
			piety = -2000 # Half of this piety will be refunded
			narrative_event = {
				id = tont_tails.60
			}
		}
	}
	tont_get_seventh_tail = {
		only_playable = yes
		potential = {
			trait = kitsune
			trait = six_tails
		}
		allow = {
			piety = 2400
			age = 70
			}
		effect = {
			piety = -2400 # Half of this piety will be refunded
			character_event = {
				id = tont_tails.70
			}
		}
	}
	tont_get_eight_tail = {
		only_playable = yes
		potential = {
			trait = kitsune
			trait = seven_tails
		}
		allow = {
			piety = 3000
			age = 80
			}
		effect = {
			piety = -3000 # One third of this piety will be refunded
			narrative_event = {
				id = tont_tails.80
			}
		}
	}
	tont_get_ninth_tail = { # Final tail
		only_playable = yes
		potential = {
			trait = kitsune
			trait = eight_tails
		}
		allow = {
			piety = 4000 
			age = 90
			}
		effect = {
			piety = -4000 # This piety will not be refunded
			narrative_event = {
				id = tont_tails.90
			}
		}
	}
}

 

ps. I don't need code examples for the last question, just yes or no, or whatever answer will be

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...