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

Multiple effects and multiple items in effect block #2

Closed Jaco-Daan closed 7 months ago

Jaco-Daan commented 7 months ago

There is a problem when reading the history files:

When there are 2 effects inside the same date, such as:

3711.4.3 = {
    birth = yes        
    effect = {
        learn_language = language_sindarin
        learn_language = language_quenya
    }    
    give_nickname = nick_the_tall
    effect = {
        add_character_flag = {
            flag = had_nickname_event
        }
        add_trait_xp = {
            trait = blood_of_numenor
            value = 100
        }
    }
}

It only evaluates the first effect block, thereby skipping the second effect block (which in this case holds the piece of code that we wanted to extract, namely the "add_trait_xp" part)

Another issue is that the code assumes the "add_trait_xp" (or whatever you're searching for inside the effect blocks) is the first thing in the effect block, so in cases like this:

3713.2.12 = {
    birth = yes        
    effect = {
        learn_language = language_sindarin
        learn_language = language_quenya
        add_trait_xp = {
            trait = blood_of_numenor
            value = 100
        }
    }    
}

It will evaluate the "learn_language = ..." and skip over the "add_trait_xp" part

de-longhi commented 7 months ago

Would you please confirm whether the bug has been fixed with the recent commit.

Jaco-Daan commented 7 months ago

Can confirmed it's been fixed.