I don't know what that has to do with the situation. This has nothing to do with turning a passive state on and off, unless you put this mark as a passive state on every single enemy in your game and code it as a damage reaction, which is probably the least efficient thing you could do.
Well since the idea was of a condition is based on a active passive. If Actor 01 is stated with state ID.032 -
Magic Hand. That give this actor a attack state (mark) ID.033 - Magic Mark which apply it to the enemy, if was hit by the normal attack.
This magic mark state should be removed after any damage. ( Default option: which do in MV but not in MZ.)
So i thought, if it not work by default way to remove it, try a passive state condition.
I don't know why you think that I don't know what engine this thread is for - all of those functions are from MZ's code.
That i never said or think. Since you link me a MV thread of Damage Formula and i was test it in mv and mz, which confirm me, it work in mv but not in mz. I just mentioned, it may be a different behavior what not work in mz, since it's original from MV base and just emphasized
I use the mz.
I just made an MZ project, put that into the damage formula of my attack skill, and it works perfectly. If it doesn't work for you, you have copied it incorrectly or you have some other plugins or changes that are modifying the skill's behavior.
So again, i tried again a brand new mz and mv project for testing. Same outcome.
The copied code from you, for the default attack skill i use:
JavaScript:
if (a.states().includes($dataStates[32])) {b.isStateAffected(33) ? b.removeState(33) : b.addState(33)}; a.atk * 4 - b.def * 2
I just made an MZ project, put that into the damage formula of my attack skill, and it works perfectly.
That's really weird, at my side not at all.
you have copied it incorrectly
you have some other plugins
or changes that are modifying the skill's behavior.
All of this works just fine for me, so something is wrong on your end.
Unfortunately it don't help me if you look the error continuing just on my side. As mentioned before 3x times was testing it on a fresh brand new project, with my outcome. Without testing to be sure, if it on me, i wouldn't say that.
Of course there may be something that i haven't noticed yet. (no one can be 100% sure or right.) But your mentioned examples of error cases are actually incorrect, since it was tested on a new project.
Again, I encourage you to start a new thread, because (as I said before) you need to post screenshots of your skills and states.
Seems so, ^^ thought it were a simple thing to achieve it via notetags. Didn't wanted to discuss it that extensively.
Either way, I'm done. Good luck with your game.
Alright, anyway again thanks for trying to help, it much appreciated.
Edit:
@Choraß, I don't have an issue with you continuing to ask for support in here if you provide screenshots of your states/skills as ATT_Turan requested
Thanks, good to know. Hm it was more a test around of a passive for now. Not really into on the battle system yet. (No priority)
I strongly suggest you trust that the people helping you know what they're doing with the engine rather than assuming it isn't working because *they* aren't understanding it.
It's not about trust or not trust. Just can react and try to explain it, based at my outcome. I also not assuming that "it isn't working because *they* aren't understanding it." Again, just can react and explain at my outcome. It have nothing to do about any personal aspects, because it's out of place here.