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.)
< >
Showing 1-4 of 4 comments
LRNZ 20 Oct @ 11:14am 
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 Oct @ 11:19am 
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  [developer] 20 Oct @ 1:20pm 
Originally posted by 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.
Last edited by Lithane; 20 Oct @ 1:28pm
Lithane  [developer] 20 Oct @ 4:31pm 
Originally posted by 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.
< >
Showing 1-4 of 4 comments
Per page: 1530 50