Hello, I'm trying to make it so that critical hit's inflict a state on a target. I found this tutorial by Yanfly to apply buffs and debuffs with critical hits, and I thought I could just replace the debuff with a state, however it doesn't seem to be working even if I use the provided code or a new project with no plugins other than the ones required. Am I doing something wrong, or is the tutorial just outdated? And if so is there another way to do this?
MV Critical Hit Effects?
Javascript/Plugin SupportTo my knowledge, there should be no problems with following that tutorial right now. I don't know of any changes that would make it inoperable.
We can't know what went wrong with your attempt to adjust the code without seeing it, but my speculation would be that addState only takes one argument (the database ID of the state) as opposed to addBuff taking two (the ID of the param to modify and a duration in turns). Turn duration is an innate property of states, so it isn't defined when you add the state this way. Try removing the "turns" variable definitions and any references to them.
edit: Not sure if you already accounted for this, but the tutorial text also seems to have a typo at the start. The full first line should read: <Custom Establish Effect>
We can't know what went wrong with your attempt to adjust the code without seeing it, but my speculation would be that addState only takes one argument (the database ID of the state) as opposed to addBuff taking two (the ID of the param to modify and a duration in turns). Turn duration is an innate property of states, so it isn't defined when you add the state this way. Try removing the "turns" variable definitions and any references to them.
edit: Not sure if you already accounted for this, but the tutorial text also seems to have a typo at the start. The full first line should read: <Custom Establish Effect>
I tried and it still doesn't work. Also even if I don't edit the code, it doesn't even apply the buffs/debuffs
Sorry, I noticed after posting, but did not edit quickly enough. There also seems to be a typo in the tutorial code. Hopefully I'm not just telling you something you already know, but the full first line should read: <Custom Establish Effect>
Ah, that was the problem. Thank you!
Original thread: https://forums.rpgmakerweb.com/threads/critical-hit-effects.150270/