I want characters with my trate to live for 200 years and not age, but only visually.
What is the easiest way to do this?
What is the easiest way to do this?
- 1
I want characters with my trate to live for 200 years and not age, but only visually.
What is the easiest way to do this?
immortal = yes in the trait definition. This will stop them from ageing from the time they receive the trait, though if you need to later change their visual age, you can use set_immortal_age in an event, on action, or scripted effect.# common/on_action/example.txt
on_birthday = {
effect = {
if = {
limit = { age = 200 }
death = natural
}
}
}
# common/on_action/example.txt
on_birthday = {
effect = {
if = {
limit = { age = 200 }
trigger_event = {
on_action = example_kill_character
days = { 1 365 }
}
}
}
}
example_kill_character = {
effect = {
death = natural
}
}
# for example, assuming the same example_kill_character on action as above is defined in common/on_action
add_trait = kill_after_200_years
trigger_event = {
on_action = example_kill_character
years = 200
}
thanks, it looks great.I'll try it now. But if I want death to occur in more than one year.Code:# common/on_action/example.txt on_birthday = { effect = { if = { limit = { age = 200 } trigger_event = { on_action = example_kill_character days = { 1 365 } } } } } example_kill_character = { effect = { death = natural } }
The line days = { 1 365 } says how far in the future it should happen: at least 1 day, at most 365 (= one year). So you could put days = { 1 5475 } to make it a random day between now and 15 years. (5475 = 15 times 365)thanks, it looks great.I'll try it now. But if I want death to occur in more than one year.
And on some random day for 15 years. What should I add here?
Code:
Code:# common/on_action/example.txt on_birthday = { effect = { if = { limit = { age = 200 } trigger_event = { on_action = example_kill_character days = { 1 365 } } } } } example_kill_character = { effect = { death = natural } }
same question(5475 = 15 times 365)
if = {
limit = {
scope:real_father = { has_trait = homelander }
}
#one of the two should be randomly selected
(
add_trait = Variant1
OR
add_trait = Variant2
)
}
You can use a random_list, I think.okay, it definitely works. But as a person who has a paranoid trait, how about productivity. I don't know how this thing works. Does he read it when starting the game and remember it?Or will he check all the characters for compliance every day? Or does it not have much effect?
same question
What should I write here so that one of the traits is randomly selected at birth?Code:if = { limit = { scope:real_father = { has_trait = homelander } } #one of the two should be randomly selected ( add_trait = Variant1 OR add_trait = Variant2 ) }
random_list = {
50 = { # Change these numbers to affect the random distribution. These are not percentages.
add_trait = trait_1
}
50 = {
add_trait = trait_2
}
50 = {
trigger = { # Use triggers to include/exclude some list options in the random function dependent on its triggers
has_trait = paranoid
}
add_trait = trait_3
}
}
this
Code:krivemod = { krivemod = { traits = { krivetrait } dna_modifiers = { color = { gene = eye_color mode = replace x = 0.982 y = 0.151 } color = { gene = skin_color mode = replace x = 0.451 y = 0.4647 } color = { gene = hair_color mode = replace x = 0.43 y = 0.22 } morph = { mode = replace gene = gene_bs_bust template = bust_clothes value = 60065 } morph = { mode = replace gene = gene_height template = normal_height value = 0.88 } } } }
No, I have 4 appearance options written down this way. this should work 100 percent if you didn't make any mistakes and put your file in the right place. You should have your trait and I suppose the file name should end with " _trait_modifiers"Is there another dependent code or txt file I need somewhere to link
But as a person who has a paranoid trait, how about productivity. I don't know how this thing works. Does he read it when starting the game and remember it?Or will he check all the characters for compliance every day? Or does it not have much effect?
on_birthday on action fires for every character on their birthdays anyway. Since the effect immediately hits a conditional check that tells it only to proceed if the character is 200—and præsumably only characters with this trait should ever live that long to trigger it—there shouldn't be any noticeable performance hit. Now that it's pointed out, however, if you ever do anything else that might create immortal characters, or otherwise extend their lifespans, without wanting to kill them after 200 years, you might want to add another check in the limit block to check if they have your trait, so you don't accidentally kill any of your other duocentenarian characters.limit = {
age = 200
has_trait = yourtrait
}
No, I have 4 appearance options written down this way. this should work 100 percent if you didn't make any mistakes and put your file in the right place. You should have your trait and I suppose the file name should end with " _trait_modifiers"
View attachment 851460
effect = {
every_ruler = { limit = { has_relation_friend = root } save_scope_as = friendmaker }
every_ruler = { limit = { has_relation_friend = root } set_relation_friend = scope:friendmaker }
}
Very simple decision to make all of root's friends also become friends to each other:
Code:effect = { every_ruler = { limit = { has_relation_friend = root } save_scope_as = friendmaker } every_ruler = { limit = { has_relation_friend = root } set_relation_friend = scope:friendmaker } }
Sort of works, but not quite as intended. It picks out one friend and makes him befriend everyone else, but doesn't make the others become friends among each other. How do you do these "everyone in a given group doing something with everyone else in a given group" scenarios work in CK3 scripting? In CK2, I'd just have used a scope defining the group and then the command with a PREV, but CK3 doesn't have PREV, I believe.
every_relation = {
type = friend
add_to_temporary_list = all_roots_friends
}
every_in_list = {
list = all_roots_friends
every_in_list = {
list = all_roots_friends
if = {
limit = { can_set_relation_friend_trigger = { CHARACTER = prev } }
set_relation_friend = prev
}
}
}
That's a good idea, but wouldn't it be simpler to replacelimit = { NOR = { this = prev has_relation_friend = prev } }withlimit = { can_set_relation_friend_trigger = { CHARACTER = prev } }?
Also, I never tried usingset_relation_friendon a rival, does it override it or just return an error?
Oh man, that's such a smart use of lists.CK3 definitely has PREV. You don't need to use it, as you could just save scopes the way you do, anyway, but it should certainly simplify things regardless.
This would be my instinctive approach to this problem (I'll also note that your code only targets friends who are rulers, not every friend; I'm not sure if that was intentional, but if so, you could still adapt my code to check if a character is landed):—
Code:every_relation = { type = friend add_to_temporary_list = all_roots_friends } every_in_list = { list = all_roots_friends every_in_list = { list = all_roots_friends if = { limit = { NOT = { has_relation_friend = prev } } set_relation_friend = prev } } }
Oh man, that's such a smart use of lists.
That's a good idea, but wouldn't it be simpler to replaceCode:every_relation = { type = friend add_to_temporary_list = all_roots_friends } every_in_list = { list = all_roots_friends every_in_list = { list = all_roots_friends if = { limit = { NOR = { this = prev has_relation_friend = prev } } set_relation_friend = prev } } }
limit = { NOR = { this = prev has_relation_friend = prev } } with limit = { can_set_relation_friend_trigger = { CHARACTER = prev } }?set_relation_friend on a rival, does it override it or just return an error?That's a good idea, but wouldn't it be simpler to replacelimit = { NOR = { this = prev has_relation_friend = prev } }withlimit = { can_set_relation_friend_trigger = { CHARACTER = prev } }?
Also, I never tried usingset_relation_friendon a rival, does it override it or just return an error?
Good point. Sounds like the idea was to force friendship in this case, so your solution is better.assuming the goal isn't to override rivalries.
Just tested it, it does override it. In fact, there doesn't seem to be any restriction to theTo your question, I'm also not sure. I'd hope it would override it, but it's a good question, 'cause it's possible it would error instead.
set_relation_ effect. It's even possible to have several best friends/soulmates or make a lover with the wrong sexuality. And not a single error in the log.REFORM_RELIGION_MIN_AUTHORITY = 0.5, -- Moral authority required to reform a pagan faith
REFORM_RELIGION_MIN_HOLY_SITES = 3, -- Number of holy sites you must control to reform a pagan faith
REFORM_RELIGION_PIETY_COST = 750, -- Piety cost of reforming a pagan faith