CloudTheWolf

Lurking Wolf
Member
Joined
Sep 8, 2013
Messages
19
Reaction score
6
First Language
English
Primarily Uses
RMVXA
So I have been using the ATB System by Moghunter and noticed that the Poison status effect would be removed from the player after a short while, even though this is set to never auto-remove.

After some digging in the code I think I found the issue and fixed it.

Note, this worked for me, however may not work for you as required.
Before making any changes BACK UP YOUR PROJECT!

So, the issue I found looks to be on within the remove_states_auto_atb method.

This cycles through all effects applied to battlers and checks if the state should be removed.
After doing some initial checks (Checking state turns and restrictions) it then checks the auto removal timing and max turn.

This is where is issue looks to be:

Ruby:
unless state.auto_removal_timing == 2 and state.max_turns <= 1
    remove_state(state.id)
end

As we see here, this will remove the state unless the auto removal time is 2 and the max turns is less than or equal to 1.

This is where the problem looks to be.

For those that don't know, auto removal time 0 = Never Remove, 1 = Action End, and 2 = Turn End.

So to fix this, all you need to do is change this to following and this should fix it!

Ruby:
unless state.auto_removal_timing == 0 and state.max_turns <= 1
    remove_state(state.id)
end

Ps. In my project I tweaked it a bit more as shown below but that was just personal preference:

Ruby:
next if state.auto_removal_timing == 0
next if state.max_turns <= 1
remove_state(state.id)
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,756
Reaction score
892
First Language
English
Primarily Uses
RMXP
Normally, you would create a new method for the state class as a way to let it handle those checks while only calling the state's contents once from that condition. It's not mandatory but serves as a good example of encapsulation of that process.
 

CloudTheWolf

Lurking Wolf
Member
Joined
Sep 8, 2013
Messages
19
Reaction score
6
First Language
English
Primarily Uses
RMVXA
I have encountered another issue of the back of this, in that if the Battlers HP hits 0 by status effect, they don't die until they are damaged by a skill :/
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,756
Reaction score
892
First Language
English
Primarily Uses
RMXP
RPG immortality achieved by the scripter! :o
That's as dangerous as claiming a non existing penalty during a match. :S

Double check that just in case that's not the only issue there.
 
Last edited:

CloudTheWolf

Lurking Wolf
Member
Joined
Sep 8, 2013
Messages
19
Reaction score
6
First Language
English
Primarily Uses
RMVXA
So I found the issue and not sure what would cause it (I have disabled all the battle scripts I have and it still happens so maybe a default thing?

Poison will leave the player with at least 1HP during battle, at it looks like "K.O by slip damage" was being disabled by my base troop event
 

Latest Threads

Latest Posts

Latest Profile Posts

ThereseIdleWIP2.gif
Design finished. Onto finishing the entire sprite sheet and alternative colours now
What does it say about you when a mushroom is your best friend?
If a game had a moral-choice system at the beginning 3 chapters where defeating an on-screen encounter grants a "-2" at the end of the level whereas evading it granted "+2" at the end of the chapter, and then each chapter also had a dialogue choice that'd give/take points depending on the answer the player gives, how many points would you expect to gain from the dialogue choices?
Dynamic.png

My next plugin will be:

DYNAMIC SWITCHES! (For RPG MAKER MZ)

What does this plugin allow?

Basically it allows you to create switches that work even though the game is closed.

Example of use:

You can make a system that you can only run a mini game once a day (or an event or whatever you want) and you have to wait 24 hours to play again.

I open thread here...
Brain: Hey! Let's draw something inspired by Tangela.
Result: Hartestant.png

Brain: What the hell man! That's it, I'm out!

Forum statistics

Threads
134,798
Messages
1,250,752
Members
177,592
Latest member
ywio2587
Top