VXAce Self caused damage causes the game to crash

Hi,

New to the forum so i hope i am posting this in the right place.

I dont know if its an easy solution to fix but ill go through the details as best i can (on phone at work);

I had an idea to have Maces cause confusion, turned out that if enemies struck themselves and was killed by it, it caused the game to crash. I dont remember the error message but i can find out once i get home if needed.

For another character, i had intended for him to have counterattack, but that also crashes the game if the enemy dies from that specific damage.
The error message i got for that was line 446 in yanflys at/stamina script.

Anyone knows a way to fix it? Im absolutely clueless when it comes to coding so as much details as possible is appreciated.
Please find that out. The more information we get the better it'll be.
Please find that out. The more information we get the better it'll be.

I just got home from work and this is the error messages i get from deaths by confusion or counter (they were the same);
1757537951212.png

And this is what the script looks like;

1757538144643.png



What i have done is that i have added said states to the classes per se, Confusion for clerics (which are using maces) and Counterattack for Berserker.
That is most likely the issue aint it now that im thinking about it?

I just tried to put the ex-parameter "CNT" to actor instead of class, but still gave me the same error so maybe its not related to the class.
As far as I can see, the @actions array does exist BUT it's empty. :S

Try modifying that line to make it look like the following:
Ruby:
@stamina -= @actions[0].stamina_cost if @actions[0]

This will prevent it from crashing. Yet, I don't know if the skill was supposed to reduce the battler's stamina at all.
As far as I can see, the @actions array does exist BUT it's empty. :S

Try modifying that line to make it look like the following:
Ruby:
@stamina -= @actions[0].stamina_cost if @actions[0]

This will prevent it from crashing. Yet, I don't know if the skill was supposed to reduce the battler's stamina at all.

That did the trick it seems! Thank you so very much!

As they will be "passive skill" for the berserker class & weapon "proficency" (i guess you called it), it wont consume any stamina.

But i reckon if it was supposed to, i would have to change the "0" to a percentage number?

Original thread: https://forums.rpgmakerweb.com/threads/self-caused-damage-causes-the-game-to-crash.180026/