So I've been doing some light plugin development within the last few months and recently I've been trying to make a plugin that allows for the modification of a state's infliction chance with note tags
I'm getting into a semi-usable state however I'm encountering an issue where a skill's state will be inflicted regardless of the if it passed the check to do so.
^ - Ignore the "normal chance: 1", that was for the enemy using the guard command.
^ - the 'normal math.random' is only visible because I setup the math.random to a variable and had the log appear before it so I could see with my eyes that chance was NOT greater than math.random
If you look at my attached plugin with the pictures, the state is applied without ever sending the chance variable to the console using console.log which means it failed the check and the state shouldn't have been added, but it was anyway. The skill itself doesn't use any action sequence or evals or anything else that would apply the state and bypass the check, and the equipment doesn't have a chance to apply the state so nothing else should be impacting this.
I assumed it must have been another plugin causing a conflict but there was only one plugin (yanfly battle engine core) which did use it, but even after I commented out the potentially offending code from that plugin it still happened. I went back to the 'rpg_' js files to see if anything else used the addstate function but there was nothing else that I could find that I think would be causing this issue. I went over my code and my plugin list again but again there was nothing, I carried my plugin over to a default project and it still happened.
This issue has left me stumped, so I'm putting this here before I go to work in case someone else can see the issue.
I'm getting into a semi-usable state however I'm encountering an issue where a skill's state will be inflicted regardless of the if it passed the check to do so.
^ - Ignore the "normal chance: 1", that was for the enemy using the guard command.
^ - the 'normal math.random' is only visible because I setup the math.random to a variable and had the log appear before it so I could see with my eyes that chance was NOT greater than math.random
I assumed it must have been another plugin causing a conflict but there was only one plugin (yanfly battle engine core) which did use it, but even after I commented out the potentially offending code from that plugin it still happened. I went back to the 'rpg_' js files to see if anything else used the addstate function but there was nothing else that I could find that I think would be causing this issue. I went over my code and my plugin list again but again there was nothing, I carried my plugin over to a default project and it still happened.
This issue has left me stumped, so I'm putting this here before I go to work in case someone else can see the issue.