Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Wraith89 on December 21, 2020, 03:16:45 am

Title: [XP]Refreshing Battle Scene Earlier
Post by: Wraith89 on December 21, 2020, 03:16:45 am
A peculiar quirk (bug?) with the default battle system of RPG Maker XP is that some things seem to update after the next turn. For example, if my character is inflicted with a status that lasts for one turn like Stun, the Stun status indicator will remain for that turn, and will remain even until the next turn until I select actions. This stuff usually isn't that problematic, but it does when you have statuses or battle events that desperately needs to be resolved in that turn something has been inflicted, like magic reflect shield being put up on the first turn, and should run out at that same turn when used, but persists in display until you select your action the next turn, or if you cut your character's max HP and the HP bar overflows until you do something, or to remove a particular buff immediately when your character reaches 0 SP and not at the beginning of next turn after selecting actions, etc. Basically I'm saying the window doesn't refresh immediately when the turn ends so it can make for some awkward looking battles. Is there a way to change this? I'm looking at Scene_Battle 1 and I guess the frame update section ties with this. Thank you.
Title: Re: [XP]Refreshing Battle Scene Earlier
Post by: Blizzard on December 22, 2020, 04:31:53 am
Actually it's a quirk of how status effects are treated. The engine checks for the status effect counter when the actor does an action rather than at the end of an actual turn in battle. e.g. If your actor is poisoned and the counter is already 0, the actor will stay poisoned until their next action in battle where the status effect will then be removed and no poison damage will be applied.

I actually did some custom changes for my own game as well. If you want to change this behavior, you need to remove the "@active_battler.remove_states_auto" call from Scene_Battle#update_phase4_step1 and you should add an iteration of all battlers and call "remove_states_auto" further above before to call of "start_phase2". Something like this should do the trick:

($game_party.actors | $game_troop.enemies).each {|battler| battler.remove_states_auto}

I can't remember if you need to do any additional things.
Title: Re: [XP]Refreshing Battle Scene Earlier
Post by: Wraith89 on December 22, 2020, 01:31:49 pm
What you posted definitely got me started in the right direction. The battle scenes look a bit better now but I still have some more testing to do. It's definitely a quirk in the default engine, but I feel such information would be helpful to a lot of other people who may find this feature jarring. Thank you for your help!