de-longhi / Realms_in_Exile_Tools

This repository is has the purpose of serving as a universal place for all the small tools I write for my mate @Jaco-Daan whom is working on the Realms in Exile mod for the steam game: Crusader Kings 3.
MIT License
0 stars 1 forks source link

XP added even if alive #4

Closed Jaco-Daan closed 7 months ago

Jaco-Daan commented 7 months ago

The effect does not check whether the character is dead or alive, which means that any character that is alive in the history will have double the amount of XP than what they are supposed to have.

For example, in this first image:

20240319150901_1

we can that the character has level 6, where-as he's supposed to have level 3, as in the following image:

20240319150904_1

An easy fix for this is possible, by generating this IF statement inside the character id, as follows:

OLD:

character:lineofcastamir48 = {
        add_trait_xp = {
                trait = blood_of_numenor
                value = 60
        }
}

NEW:

character:lineofcastamir48 = {
        if = {
                limit = { is_alive = no }
                add_trait_xp = {
                        trait = blood_of_numenor
                        value = 60
                }
        }
}

The "new" code will ensure that only characters that are dead will receive the XP, which is what is intended with the overall effect.

Jaco-Daan commented 7 months ago

Tested, and the generated files correctly add the if statement.