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,763
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,763
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

I'm pretty sure me watching Netflix while having sushi just led to me eating the tail of my tempura shrimp.
1696004095642.png
...and now he even makes resources, too! xD
OMG Y'all. I found an alternate Google Drive I 100% forgot I had. All my crusty old game files from 2014 (when I signed up) are in there. When I like...maybe actually make a prototype thread it's gonna be so much fun taking everyone down my memory lane.
We are at the finish line!!! Thank you COMMUNITY!!!
GameCompletion.jpg

Forum statistics

Threads
134,905
Messages
1,251,765
Members
177,723
Latest member
DemonHitmaker
Top