I'm coming back to CK2 after a uh....rather long time not playing it. The last time I played it, I spent an inordinate, stupid amount of time trying to convert the 'reincarnation' event to trigger for ANY dynasty member, whereas its vanilla state is for only men to be reincarnated from other men.
When I tried then, the scopes were father_even_if_dead or mother_even_if_dead, and I couldn't get my head around the if-then loops, because its been a long time since I've even done psuedocode, and I wasn't sure where everything was pointing to. But now they have a scope "random_dynasty_member_even_if_dead" - and I'm thinking I could put that in there and cut out most of the nested loops, right? In theory, it would be much better code then vanilla, since you could be the reincarnation of dead cousins or siblings, but .... even with that in mind, there is just SO MUCH GOING ON I can't figure out what they are doing to re-write it. And I've stared at this before.
Could someone explain to me what each of these if loops are doing?
I think the psuedocode below means:
if the baby's father has the supernatural events trigger and if his father's father is dead, then set his father's father as his reincarnation. Otherwise, if limit is-reincarnated is no (what does that mean?) set it to his father, if he's dead.
Do I have that right?
Then it checks for the mother's grandfather and father.
Right?
Code:
immediate = {
if = {
limit = {
father = {
supernatural_events_trigger = yes
}
}
if = {
limit = {
father = {
father_even_if_dead = {
father_even_if_dead = {
is_alive = no
}
}
}
}
father = {
father_even_if_dead = {
father_even_if_dead = {
ROOT = {
set_reincarnation = THIS
}
}
}
}
}
if = {
limit = {
is_reincarnated = no
}
father = {
father_even_if_dead = {
ROOT = {
set_reincarnation = THIS
}
}
}
}
father = {
character_event = {
id = ancrel.0271
days = 3
}
}
}
if = {
limit = {
mother = {
supernatural_events_trigger = yes
}
is_reincarnated = no
}
if = {
limit = {
mother = {
father_even_if_dead = {
father_even_if_dead = {
is_alive = no
}
}
}
}
mother = {
father_even_if_dead = {
father_even_if_dead = {
ROOT = {
set_reincarnation = THIS
}
}
}
}
}
if = {
limit = {
is_reincarnated = no
}
mother = {
father_even_if_dead = {
ROOT = {
set_reincarnation = THIS
}
}
}
}
mother = {
character_event = {
id = ancrel.0271
days = 3
}
}
}
}
Assuming I'm understanding the psuedocode, it still seems like a really, really wierd way to implement it. I mean, if it were me, I'd just have it plunk down a randomn dead dynasty member, and thats that. I wouldn't check to see if it was someone they knew, as most of the cultures which believed in this kept good records. I'd assume they'd have some way of handling nested reincarnations (like the Dalai Llama) but I don't see it.