Dynamic Traits and Effects

AddTrait class $gameParty.targetActor()._classId TRAIT_EQUIP_WTYPE 3

You left out the class keyword. What I gave you was what to put instead of the class id.
AddTrait class $gameParty.targetActor()._classId TRAIT_EQUIP_WTYPE 3

You left out the class keyword. What I gave you was what to put instead of the class id.
Ah, it turned out to be so, I really appreciate your help!
Is there an MZ plugin that lets you add traits mid-game like this? I can't seem to find anything.
I believe one of the VisuStella core plugins will do it
I believe one of the VisuStella core plugins will do it

That was my assumption, but I'm not seeing it anywhere. It's totally possible I'm missing it in the loooong explanations and lists of notetags and JS coding. But so far, even searching "traits" on several of the Yanfly/VS plugin pages hasn't turned anything up.
Hello, I believe the downlaod link is broken...
Hello, I believe the downlaod link is broken...
Nope, working fine for me.
Weird... Maybe is my browser, it's not loading pastebin. Thanks for the reply.
Hello, I'm having trouble using this plugin. I'm trying to give one of my classes a new Skill Type, but no matter what I do it won't change!
I've tried it as an actor `AddTrait actor 3 TRAIT_STYPE 8` and as a class `AddTrait class 4 TRAIT_STYPE 8`

But neither seem to work!
I've tried it as an actor `AddTrait actor 3 TRAIT_STYPE 8`
You're missing a third of your trait code. It should be TRAIT_STYPE_ADD, per the chart in the first post.
I'm using this succesfully for elemental rates, for example:

AddTrait actor 1 TRAIT_ELEMENT_RATE 6 0.85

But i seem to do something wrong for state rates? If use
AddTrait actor 1 TRAIT_STATE_RESIST 61 0.9 or AddTrait actor 1 TRAIT_STATE_RESIST 61 90 or AddTrait actor 1 TRAIT_STATE_RESIST 61 110, the state resist always changes to 0%?

Edit: found the issue, had to use TRAIT_STATE_RATE instead of TRAIT_STATE_RESIST
Im having a huge issue about the plugin. cant seem to make it work in anyway i want. So far what i could do is to make an item act as something that can be used to give a trait to the actor 1 in this case but what i want is, instead of giving it to actor one like AddTrait actor 1 TRAIT_STYPE_ADD 9 i want to make it so that which ever character that i use on it will have the effect. been working on this to understand how it works for 6-7 hours. im completely lost and i need this badly. wouldve been awesome if there were some examples or sample.
Im having a huge issue about the plugin. cant seem to make it work in anyway i want.
It would help if you provided screenshots of what you've tried so far. The first post, plugin file itself, and the rest of this thread do have examples.

Without any knowledge of what you have so far, anyone helping you is starting at making an item and the code from scratch.
So far this is what i did. Ive created an item and gave it a common event for plugin command to act as a source of the skill stype trait and this is the only thing i could do with the given informations (as far as i could process in my mind) but when i do this it gives to a specified actor even if i use it on another actor because i only know how to write that kind of plugin command. im not sure how can i make the command work in a way that whom ever i use it on gets the trait.
ss 1.png
So far this is what i did.
Okay...that's not super helpful because you're not showing the contents of the event where you're trying to actually use the plugin command. So we don't know if your syntax is correct at all.

But the trick here is that a common event has no way of knowing which battler was targeted by a skill. So you need to give it some point of reference.

For example:
1 - Give your skill an Add State at the top of its Effects list (any blank, dummy state)
2 - In the common event, you use a series of Conditional Branches
Conditional Branch -> Actor 1 Has dummy state
- type in the plugin command targeting actor 1
- remove dummy state from actor 1
Conditional Branch -> Actor 2 has dummy state
- type in the plugin command targeting actor 2
- remove dummy state from actor 2
etc.
Im sorry im very new to all these. Pretty noob about the subject. Its not a matter of syntax i just dont know how to write it in that way. "AddTrait actor 1 TRAIT_STYPE_ADD 9" in a plugin command. this is all i did. Im still learning everyday about how plugins work. I will try your method and see if that does anything. Sorry for late response i was very busy.
been redirected to ask my question here (didnt cross my mind immediately lol), i wanna have an event that lets the party "learn" a new skill type (i.e. at some point they learn magic when before they had just been using physical attacks) but the code and plugin commands are all very intimidating and i dont really understand the wording, how do i simply make the party gain access to a new skill type? they start without it so it would be added, not unhidden or anything. thanks
the code and plugin commands are all very intimidating and i dont really understand the wording, how do i simply make the party gain access to a new skill type?
That's not much of an improvement over your other post. As I already pointed out to you, simply saying "I don't really understand" doesn't give us any clue what you don't understand.

As there are already instructions, without you telling us which words you are confused by, we don't know what to do aside from giving you the same instructions again.

From the first post, and the instructions within the plugin, the command to add a trait is:
Code:
AddEffect class id effectCode dataId [value1] [value2]

And then there are explanations of what each of those words mean with charts to reference.
Hello, when I was trying to load a new save created with this plugin enabled, nothing happened and the following error message popped up:

TypeError: Cannot set property 'traits' of undefined

I tried disabling this plugin first (which worked), then I tried disabling all the other plugins mentioned in the error message one at a time--disabling Yanfly's autosave plugin also worked. With one or the other disabled, it was loading fine. For the hell of it, I tried enabling them both again, and now it's loading save files and the error isn't popping up anymore. Any idea what might have happened or what I can do to prevent it in the future?

In all cases, I hadn't even made use of the plugin yet--only enabled it. Thanks!
Aparrently there's a bug


1743992687077.png

1743992706343.png

1743992737280.png


I was create a game, and in the middle of gameplay I have an idea to add Flicker Light item and skill to database. So I save the game first, add it, and reload it, and then equip the item. But turns out, it doesn't load the skill that I've made

The expected result should be like this when equip the item. This is on test map with new game
1743992821583.png


When I look into the code, there's a function regarding database change. I comment it and it work as expected
1743992920173.png


Here's the result if I comment all DataManager content
1743992978740.png


Idk which function that cause data break, but this is all I got

Original thread: https://forums.rpgmakerweb.com/threads/dynamic-traits-and-effects.51533/