Crusader Kings III

Crusader Kings III

Divine Intervention Cheat Menu
Trait Indexing, Exclusions, and other interesting behaviour how does it work?
Thanks for the awsome mod, i love the automatic indexing/ listing of traits, unfortunatly im a bit of a mod junkie so i have a few to many mods, some of them use traits as progress markers or other things, for example agot. i dont really like having all those useless traits in the other category so i wanted to figure out a way to do that.
Found out that the game has
has_trait_flag

i wanted to use that to exclude some of the traits, so i used the falgs of the mods or added onse that i can use to exclude them unfortunatly that did not work as i expected/ at all

### Create a list of all traits ### DI_trait_loader_sgui = { scope = character saved_scopes = { trait # selected trait tracked # bool, yes if trait has a track, no if not } effect = { if = { limit = { scope:tracked = flag:no scope:trait = { has_trait_flag = zz_item_template has_trait_flag = zz_item_modifier has_trait_flag = zz_province_modifier has_trait_flag = zz_sword_type has_trait_flag = zz_ring_type has_trait_flag = zz_building has_trait_flag = artifact_scaling_effect has_trait_flag = exclude_from_cheat } } add_to_global_variable_list = { name = DI_all_traits target = scope:trait } if = { limit = { scope:trait = { has_trait_category = health } } add_to_global_variable_list = { name = DI_health_traits target = scope:trait } } else_if = { limit = { scope:trait = { OR = { has_trait_category = commander has_trait_category = winter_commander } } } add_to_global_variable_list = { name = DI_commander_traits target = scope:trait } } else_if = { limit = { scope:trait = { has_trait_category = fame } } add_to_global_variable_list = { name = DI_fame_traits target = scope:trait } } else_if = { limit = { scope:trait = { has_trait_category = lifestyle } } add_to_global_variable_list = { name = DI_lifestyle_traits target = scope:trait } } else = { add_to_global_variable_list = { name = DI_misc_traits target = scope:trait } } } else_if = { limit = { scope:tracked = flag:yes } add_to_global_variable_list = { name = DI_tracked_traits target = scope:trait } } } }

This is my code, but i noticed that the variable list dont really align with the tabs in the character editor, aswell that the performance really takes a hit when opening the trait menu in a new window with the right click, so much so that i get lags of minutes while the small one has barely any performance impact. except for the first startup after opening the game for about 1 sec. Trait new window has lags every time i switch tags, so i was wondering if i even use the current implementation of the trait search or if there are other ones, that i did not find.


Well and also to report the bug with the trait window, that also happens without my modifications and sometimes even crashes ourtight without them which intrestingly enough it did not do with mine, but then i have more patience when im trubleshooting my own code, so maybe i did not wait long enough. (also probaly a compunding factor of my 56 mod long mod list.)
< >
Visar 1-5 av 5 kommentarer
LRNZ 20 okt @ 11:14 
Well i just started a new game, and it actually did something, what it did is remove all non tracked traits but, at least its injecting correctly.
LRNZ 20 okt @ 11:19 
well the the big window still works, and its showing all the traits even the ones i wanted to block so now i know for certian that there is 2 implementations, and one of them i borked and the other one is broked/ very inefficient compared to the one i borked.
Lithane  [utvecklare] 20 okt @ 13:20 
Ursprungligen skrivet av LRNZ:
well the the big window still works, and its showing all the traits even the ones i wanted to block so now i know for certian that there is 2 implementations, and one of them i borked and the other one is broked/ very inefficient compared to the one i borked.
Indeed, the big trait window is actually the initial implementation of the trait window, it's a whole different file. Me being the lazy coder that I am left it in place. What you are experiencing with the uber lag is why I made the new system, which works by essentially hiding any trait that doesn't have a name (which mods like AGOT don't do for all their traits they use to keep track of things). The proper implementation of the traits window can be found in the gui/DI_character_editor_templates/DI_ce_traits_tab.gui file.

There are quite a few differences between the two systems. The old one is essentially going through the ENTIRE trait list several times every time you open the trait menu, where as the new one is loading the traits into lists via SGUI on the first time you open the menu, then it is cached and you don't need to load it again, at least until you restart the game I think.
Senast ändrad av Lithane; 20 okt @ 13:28
Lithane  [utvecklare] 20 okt @ 16:31 
Ursprungligen skrivet av LRNZ:
well the the big window still works, and its showing all the traits even the ones i wanted to block so now i know for certian that there is 2 implementations, and one of them i borked and the other one is broked/ very inefficient compared to the one i borked.
I fixed the big trait window for the next update, it will just be a bigger version of the smaller one, like it should have been, rather than a left over old implementation.
Lithane  [utvecklare] 30 okt @ 18:35 
Ursprungligen skrivet av LRNZ:
i wanted to use that to exclude some of the traits, so i used the falgs of the mods or added onse that i can use to exclude them unfortunatly that did not work as i expected/ at all



### Create a list of all traits ### DI_trait_loader_sgui = { scope = character saved_scopes = { trait # selected trait tracked # bool, yes if trait has a track, no if not } effect = { if = { limit = { scope:tracked = flag:no scope:trait = { has_trait_flag = zz_item_template has_trait_flag = zz_item_modifier has_trait_flag = zz_province_modifier has_trait_flag = zz_sword_type has_trait_flag = zz_ring_type has_trait_flag = zz_building has_trait_flag = artifact_scaling_effect has_trait_flag = exclude_from_cheat } } add_to_global_variable_list = { name = DI_all_traits target = scope:trait }

I was just looking over your code again and I think what you are wanting to do should be possible, but the code looks a tad wrong for the way you described it working.

Rather than excluding those trait flags, it looks to me like you are actually checking that all of them are true (which means this loader should be empty, since I doubt all of those flags are on any trait at the same time). If you wanted to exclude them, I would expect to see

limit = { scope:tracked = flag:no NOT = { scope:trait = { OR = { has_trait_flag = zz_item_template has_trait_flag = zz_item_modifier has_trait_flag = zz_province_modifier has_trait_flag = zz_sword_type has_trait_flag = zz_ring_type has_trait_flag = zz_building has_trait_flag = artifact_scaling_effect has_trait_flag = exclude_from_cheat } } } }

Inside a limit, there is an implied AND. So having limit with all the has_trait_flags is like saying AND { all the trait flags must be true }
< >
Visar 1-5 av 5 kommentarer
Per sida: 1530 50