MV Compatibility: Dynamic Traits + YEP Plugins

Hi there, I'm running into compatibility issues with Shaz's Dynamic Traits and Effects plugin any time I try to load a save file. I don't believe the author is active anymore, so I'm looking for a compatibility patch.

1722386235025.png


Trying to load a game does nothing and checking the console reveals the following:

TypeError: Cannot set property 'traits' of undefined

This only happens when the plugin is running in conjunction with Yanfly's ItemCore and/or YEP X Autosave. The other plugin mentioned above, "ChainCommand," doesn't appear to make any difference whether it's enabled or not. Disabling Dynamic Traits will allow me to load saves normally, or disabling ItemCore/Autosave will allow me to load saves normally.

I don't have to make use of the plugin in any way for this error to occur. I'm just wondering if anyone can recognize the issue and knows of a way to make a simple patch to work around the problem. Thanks!
Did you add the plugin after you made the save file? Have you tried starting a new game and saving it then loading it?
To add on to above, whenever you make a new save, many plugins write in info into the save itself only at that point in time in order to function.
When you try to add a plugin that does that to a pre-existing save, you get all kinds of error for trying to manipulate nonexistent data. just like the error you have right there.

does this happen only when you load that save? or does it happen when you make a new save file, save, and load then it
Well YEP plugins have a behavior that changes $dataSomething. So if another plugin uses the same part of code it may cause problems.
For example, if the game has 10 items, but YEP item core extends it to 20 items, then the trait plugin adds 20 traits and saves. The game loads a save, it has 10 items before YEP code takes effect but the trait plugin tries to add its 20 traits back to the items and the error occours.
None of these issues are anything to do with existing saves.
None of these issues are anything to do with existing saves.
just had to be sure. many people make saves, play around with plugins, and then noad up their save expecting them to still work


This only happens when the plugin is running in conjunction with Yanfly's ItemCore and/or YEP X Autosave
ive just added Shaz's plugin to my main project which uses both yanflys item core and autosave. i havent ran into that issue you described. can you show a screenshot of your plugin manager
ive just added Shaz's plugin to my main project which uses both yanflys item core and autosave. i havent ran into that issue you described. can you show a screenshot of your plugin manager
Well, you can see it... whether you can make sense of it or not is another matter...

For what it's worth, Shaz's plugin was the last piece of this puzzle, and without it everything else appeared to play nicely for many years.

Plugin List.png
Well, you can see it... whether you can make sense of it or not is another matter...

For what it's worth, Shaz's plugin was the last piece of this puzzle, and without it everything else appeared to play nicely for many years.

View attachment 313263
Wow, the YEP plugins are all over the place... have you tried placing them in order and all other plugins after them?
Well, you can see it... whether you can make sense of it or not is another matter...
its the load order. try loading it last as an example and see if it works. when i first did it, it was my last plugin. i moved it before the message core as you did and i got your error, i then moved it after the item core and it worked fine

EDIT:
Wow, the YEP plugins are all over the place... have you tried placing them in order and all other plugins after them?
i stopped looking at the yanfly plugin load order halfway. i didnt doublecheck but offhand, they seemed roughly in order
its the load order. try loading it last as an example and see if it works. when i first did it, it was my last plugin. i moved it before the message core as you did and i got your error, i then moved it after the item core and it worked fine
Thanks Robro. At first, changing the load order caused another error on loading saves, but this led me down a rabbit hole that ultimately brought me to the heart of the problem: it didn't like my on-load common event via Yanfly's Utility Common Events. This was somehow disagreeing with the Shaz plugin. Fingers crossed, everything appears to be working at the moment.

Original thread: https://forums.rpgmakerweb.com/threads/compatibility-dynamic-traits-yep-plugins.170756/