Odd drawing glitch on Yanfly's Battle Engine script.
RGSSx Script SupportI've used Yanfly's scripts a lot and never seen something like this.
Are you using any other scripts that could conflict with it? If so, try disabling them one by one to see which one is causing the problem.
Also: Have you modified the original script in any way?
Are you using any other scripts that could conflict with it? If so, try disabling them one by one to see which one is causing the problem.
Also: Have you modified the original script in any way?
OK, I think I found it. YanFly Compatible Customisable ATB/Stamina Based Battle System Script by Fomar0153 caused the glitch. This was odd...
Is there an alternative to that? (Don't recomend me Yami's Classic ATB, it broke the balance of the fights (especially when somebody was poisoned).
Is there an alternative to that? (Don't recomend me Yami's Classic ATB, it broke the balance of the fights (especially when somebody was poisoned).
Have you checked ALL scripts? My best -uninformed- guess would be that Fomar's script is clashing with a third script in order to cause that bug, because I've used hist ATB and never had any problem like that....
If you want to change your atb script, there are Mog's and Victor's. But their compatibility isn't as great as Yanfly's (particularly Victor's).
If you want to change your atb script, there are Mog's and Victor's. But their compatibility isn't as great as Yanfly's (particularly Victor's).
I am not sure...
Most of the scripts that I use are from Yanfly's, so that rules out some (I think?). The only non-Yanfly scripts are Kread-EX's Skill Upgrade, Galv's Visual Novel Choices and Timed Button Presses, and some patches both from Luna Engine and on Github.
If you want to take a look at my scripts, here's the link:
http://1drv.ms/1y3eDX8
Most of the scripts that I use are from Yanfly's, so that rules out some (I think?). The only non-Yanfly scripts are Kread-EX's Skill Upgrade, Galv's Visual Novel Choices and Timed Button Presses, and some patches both from Luna Engine and on Github.
If you want to take a look at my scripts, here's the link:
http://1drv.ms/1y3eDX8
In case anyone else wants to check this, you need to get the TRGSSX.dll for one of the KGC scripts on the list, before ploping this in a blank project.
I believe that the problem comes from Fomar's script not working well with more than 4 party members in battle (and obviously with Yanfly's party script in that regard). Here's the thing, though, if you don't have anyone in the reserves, the bug won't occur: it only happens when you have 5+ party members and at least one inactive party member.
-----------
Anyway, random findings aside, as a non scripter all I can say is that it seems you'll need either to request a compatibility script, move to another atb system...or try out other mutiple party systems, though I doubt that Fomar's script would be more receptive to those. Who knows?
Good luck, and I hope you find someone more helpful. 😛
I believe that the problem comes from Fomar's script not working well with more than 4 party members in battle (and obviously with Yanfly's party script in that regard). Here's the thing, though, if you don't have anyone in the reserves, the bug won't occur: it only happens when you have 5+ party members and at least one inactive party member.
-----------
Anyway, random findings aside, as a non scripter all I can say is that it seems you'll need either to request a compatibility script, move to another atb system...or try out other mutiple party systems, though I doubt that Fomar's script would be more receptive to those. Who knows?
Good luck, and I hope you find someone more helpful. 😛
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Please add a link to the script so people don't have to go hunting it up themselves, and state any other scripts that may also be affecting it.
The only way you can be sure whether it's that script or not is by starting a brand new project and adding just that one script and seeing if it still happens. Then disable that same script in your current project and see if disabling it causes the issue to stop. It could be an incompatibility between two scripts, or the way you have things set up.
Please add a link to the script so people don't have to go hunting it up themselves, and state any other scripts that may also be affecting it.
The only way you can be sure whether it's that script or not is by starting a brand new project and adding just that one script and seeing if it still happens. Then disable that same script in your current project and see if disabling it causes the issue to stop. It could be an incompatibility between two scripts, or the way you have things set up.
So, I was testing the scripts one by one, and the game crashes with SystemStack error stack too deep.
And from the scripts that I tested, nothing caused the glitch. Could be a UI script?
EDIT: Stack Error was caused by placing some scripts below the Revival/Item Fix. My bad.
EDIT 2: Tested most of the scripts. Can't find what causes the issue. I have no idea what causes this (I even moved around the scripts, nothing works.) I am left clueless.
And from the scripts that I tested, nothing caused the glitch. Could be a UI script?
EDIT: Stack Error was caused by placing some scripts below the Revival/Item Fix. My bad.
EDIT 2: Tested most of the scripts. Can't find what causes the issue. I have no idea what causes this (I even moved around the scripts, nothing works.) I am left clueless.
Although I haven't found the root cause of the issue, I've quite some evidence that it's related to the method item_rect under class Window_BattleStatus(YEA-BattleEngine):
I've checked that BATTLESTATUS_CENTER_FACES is set as true, so in order to reproduce your glitch screenshot, $game_party.members.size must return 6, as the 3rd and 4th actors are at the center of the status window.
I still don't know how it's even possible, but the method battle_members under class Game_Party(YEA-PartySystem) might be related to that:
If the size of @battle_members_array is greater than max_battle_members due to something that shouldn't be possible, $game_party.members.size can return 6.
Another observation is that the positions of all atb bars and those of everything of the selected actor in your glitch screenshot are correct, meaning $game_party.members.size returns 6 right before drawing everything of all actors in the status window but returns 5 right before just drawing the atb bars and right before drawing everything of the selected actor. I'm still investigating on this though 🙂
Also, I think the positions are wrong already when the battle has just begun. Otherwise the issue will become even more strange to me as the atb bars are drawn whenever the atb updates. It would mean $game_party.members.size can dangle between 6 and 5 whenever the atb updates, and this should be outright impossible.
To try to "fix"(without guarantee) the issue without knowing the root cause(like taking a painkiller without dealing with the cause of the pain), you can either try this snippet:
Or, more desperately, try to set BATTLESTATUS_CENTER_FACES as false.
Off topic: I'd like to know why Yami's Classic ATB will break the balance of the fights 😀
def item_rect(index) rect = Rect.new rect.width = contents.width / $game_party.max_battle_members rect.height = contents.height rect.x = index * rect.width if YEA::BATTLE::BATTLESTATUS_CENTER_FACES rect.x += (contents.width - $game_party.members.size * rect.width) / 2 end rect.y = 0 return rect end
I still don't know how it's even possible, but the method battle_members under class Game_Party(YEA-PartySystem) might be related to that:
def battle_members initialize_battle_members if initialize_battle_members? array = [] for actor_id in @battle_members_array break if array.size > max_battle_members next if actor_id.nil? next if $game_actors[actor_id].nil? next unless $game_actors[actor_id].exist? array.push($game_actors[actor_id]) end return array end
Another observation is that the positions of all atb bars and those of everything of the selected actor in your glitch screenshot are correct, meaning $game_party.members.size returns 6 right before drawing everything of all actors in the status window but returns 5 right before just drawing the atb bars and right before drawing everything of the selected actor. I'm still investigating on this though 🙂
Also, I think the positions are wrong already when the battle has just begun. Otherwise the issue will become even more strange to me as the atb bars are drawn whenever the atb updates. It would mean $game_party.members.size can dangle between 6 and 5 whenever the atb updates, and this should be outright impossible.
To try to "fix"(without guarantee) the issue without knowing the root cause(like taking a painkiller without dealing with the cause of the pain), you can either try this snippet:
class Game_Party < Game_Unit def battle_members initialize_battle_members if initialize_battle_members? array = [] for actor_id in @battle_members_array break if array.size >= max_battle_members # Changed to make it more secure next if actor_id.nil? next if $game_actors[actor_id].nil? next unless $game_actors[actor_id].exist? array.push($game_actors[actor_id]) end return array endend
Off topic: I'd like to know why Yami's Classic ATB will break the balance of the fights 😀
The snippet did not work (unless I did something wrong, I placed underneath the almost all other scripts), but turning off BATTLESTATUS_CENTER_FACES fixed it. I guess Formar's script cannot handle more than 5 party members (with at least one party member not participating). And it happens even when the project has only Yanfly Engine, Battle Engine, Party System and the ATB system, so the script was the culprit.
About the broken balance, well, I am a bit exagerreting, since the first time, I forgot to set it up to mimic Formar's function on my project, which resulted in infuriating combat. To be exact, the game wouldn't pause to give the player time to react to the button presses or select a comand without being harased by the enemies. After some tweaking, I managed to almost mimic the function, but it broke the states (states were gone in seconds), and after an action, any character with HP/MP Recovery or being poisoned to either get more hp or lose some after that (and not in intervals as in games like Final Fantasy). Plus I got frustrated setting up Luna Engine on my project, so I had to scrap it and fall back to the old system (ie the one that I am right now).
About the broken balance, well, I am a bit exagerreting, since the first time, I forgot to set it up to mimic Formar's function on my project, which resulted in infuriating combat. To be exact, the game wouldn't pause to give the player time to react to the button presses or select a comand without being harased by the enemies. After some tweaking, I managed to almost mimic the function, but it broke the states (states were gone in seconds), and after an action, any character with HP/MP Recovery or being poisoned to either get more hp or lose some after that (and not in intervals as in games like Final Fantasy). Plus I got frustrated setting up Luna Engine on my project, so I had to scrap it and fall back to the old system (ie the one that I am right now).
It's indeed a compatibility issue between Fomar0153-CBS and YEA-PartySystem.
If BATTLESTATUS_CENTER_FACES is true and the number of the party members is greater than that of those in battles, the glitch will likely occur.
It's because when starting a battle, everything will be drawn on the status window even before the battle scene is shown. At that time, $game_party.members will return $game_party.all_members instead of $game_party.battle_members as $game_party.in_battle hasn't been set to true yet. Unless the status window will be redrawn shortly afterwards, it'll cause the glitch if BATTLESTATUS_CENTER_FACES is true and the number of the party members is greater than that of those in battles.
Normally, right after setting $game_party.in_battle as true, everything will be drawn on the status window again with $game_party.members returning $game_party.battle_members, however. As the battle scene is shown after that, the glitch will be corrected even before it can be seen. The correction is done by method start_party_command_selection under class Scene_Battle:
But Fomar0153-CBS has rewritten that to this:
Normally the method refresh_status under class Scene_Battle is this:
But YEA-BattleEngine has rewriiten that to this:
Combining all the above, the status window won't be redrawn after setting $game_party.in_battle as true but before revealing the battle scene, causing the glitch to be untouched before it can be seen.
To fix the compatibility issue, you can either delete or comment out the entire Fomar0153-CBS's method start_party_command_selection under class Scene_Battle:
Or use this snippet:
Removing the method should be the safer solution although it costs a bit more resources as refreshing the status window generally consumes quite some resources, while using my snippet is the exact opposite. It's up to you to choose(just don't use both as it's obviously the worst choice) 🙂
If BATTLESTATUS_CENTER_FACES is true and the number of the party members is greater than that of those in battles, the glitch will likely occur.
It's because when starting a battle, everything will be drawn on the status window even before the battle scene is shown. At that time, $game_party.members will return $game_party.all_members instead of $game_party.battle_members as $game_party.in_battle hasn't been set to true yet. Unless the status window will be redrawn shortly afterwards, it'll cause the glitch if BATTLESTATUS_CENTER_FACES is true and the number of the party members is greater than that of those in battles.
Normally, right after setting $game_party.in_battle as true, everything will be drawn on the status window again with $game_party.members returning $game_party.battle_members, however. As the battle scene is shown after that, the glitch will be corrected even before it can be seen. The correction is done by method start_party_command_selection under class Scene_Battle:
alias start_party_command_selection_abe start_party_command_selection def start_party_command_selection @status_window.refresh unless scene_changing? start_party_command_selection_abe end
def start_party_command_selection unless scene_changing? refresh_status @status_window.unselect @status_window.open if BattleManager.input_start @actor_command_window.close @party_command_window.setup else @party_command_window.deactivate turn_start end end end
def refresh_status @status_window.refresh end
def refresh_status; return; end
To fix the compatibility issue, you can either delete or comment out the entire Fomar0153-CBS's method start_party_command_selection under class Scene_Battle:
def start_party_command_selection unless scene_changing? refresh_status @status_window.unselect @status_window.open if BattleManager.input_start @actor_command_window.close @party_command_window.setup else @party_command_window.deactivate turn_start end end end
class Scene_Battle < Scene_Base alias battle_start_abs_atb_compatibility battle_start def battle_start battle_start_abs_atb_compatibility @status_window.refresh endend
Fixed now. Thanks a lot!
On a side note, I've just accidentally found this:
http://forums.rpgmakerweb.com/index.php?/topic/34738-yanfly-compatible-customisable-atbstamina-based-battle-system-script-by-fomar0153-version-14/
Your version is 1.2 while the newest one is 1.4.
I've briefly checked and it seems to me that it won't fix your glitch though, so you'll have to apply the changes to the 1.4 version as well if you want to use it without having the glitch 🙂
http://forums.rpgmakerweb.com/index.php?/topic/34738-yanfly-compatible-customisable-atbstamina-based-battle-system-script-by-fomar0153-version-14/
Your version is 1.2 while the newest one is 1.4.
I've briefly checked and it seems to me that it won't fix your glitch though, so you'll have to apply the changes to the 1.4 version as well if you want to use it without having the glitch 🙂
It seems that it got fixed in Version 1.4 . I'll do a few more tests just to be sure.
Marked as solved.
Thanks again DoubleX!
Marked as solved.
Thanks again DoubleX!
After I've thought about the entire issue again, I've found that my previous judgment was dead wrong as the issue has nothing to do with Yanfly's Party System. Instead, it's a bug of Fomar's ATB.
It's because I only used Yanfly's Ace Battle Engine and Fomar's ATB(with the v1.4 version as well, as expected), but I can still reproduce the glitch. Fortunately, my above solution and rest of my above analysis still apply.
Off topic:
This method is called by method create_all_windows under class Scene_Battle(default script):
Which is called by method start under class Scene_Battle(default script):
Which is called by method main under class Scene_Base(default script):
On the other hand, $game_party.in_battle is set to true by method on_battle_start under class Game_Unit(default script):
This method is called by method battle_start under module BattleManager(Yanfly's Ace Battle Engine):
Which is called by method battle_start under class Scene_Battle🙁default script)
Which is called by method post_start under class Scene_Battle(default script):
Which is called after calling method start under Scene_Battle.
Combining all the above, it's clear that method create_info_viewport draws the status window before $game_party.in_battle is set to true, causing the window to be drawn incorrectly if the number of party members is greater than that of battle party members and BATTLESTATUS_CENTER_FACES is set to true.
It means drawing the status window in that method is completely redundant as it's to be drawn again after $game_party.in_battle is set to true to ensure that it's drawn correctly. But as Yanfly is an exceptionally excellent scripter, I wonder why he/she'll alias that method in the first place. It seems to me that the sole purpose of method refresh under class Window_BattleStatus is to draw the status window(default script).
It's because I only used Yanfly's Ace Battle Engine and Fomar's ATB(with the v1.4 version as well, as expected), but I can still reproduce the glitch. Fortunately, my above solution and rest of my above analysis still apply.
Off topic:
I don't understand what's the need to draw the status window in method create_info_viewport under class Scene_Battle(Yanfly's Ace Battle Engine):
alias scene_battle_create_info_viewport_abe create_info_viewport def create_info_viewport scene_battle_create_info_viewport_abe @status_window.refresh end
alias scene_battle_create_info_viewport_abe create_info_viewport def create_info_viewport scene_battle_create_info_viewport_abe @status_window.refresh end
def create_all_windows create_message_window create_scroll_text_window create_log_window create_status_window create_info_viewport create_party_command_window create_actor_command_window create_help_window create_skill_window create_item_window create_actor_window create_enemy_window end
def start super create_spriteset create_all_windows BattleManager.method_wait_for_message = method🙂wait_for_message) end
def main start post_start update until scene_changing? pre_terminate terminate end
def on_battle_start members.each {|member| member.on_battle_start } @in_battle = true end
def self.battle_start $game_system.battle_count += 1 $game_party.on_battle_start $game_troop.on_battle_start return unless YEA::BATTLE::MSG_ENEMY_APPEARS $game_troop.enemy_names.each do |name| $game_message.add(sprintf(Vocab::Emerge, name)) end if @preemptive $game_message.add(sprintf(Vocab:😛reemptive, $game_party.name)) elsif @surprise $game_message.add(sprintf(Vocab::Surprise, $game_party.name)) end wait_for_message end
def battle_start BattleManager.battle_start process_event start_party_command_selection end
def post_start super battle_start end
Combining all the above, it's clear that method create_info_viewport draws the status window before $game_party.in_battle is set to true, causing the window to be drawn incorrectly if the number of party members is greater than that of battle party members and BATTLESTATUS_CENTER_FACES is set to true.
It means drawing the status window in that method is completely redundant as it's to be drawn again after $game_party.in_battle is set to true to ensure that it's drawn correctly. But as Yanfly is an exceptionally excellent scripter, I wonder why he/she'll alias that method in the first place. It seems to me that the sole purpose of method refresh under class Window_BattleStatus is to draw the status window(default script).
Original thread: https://forums.rpgmakerweb.com/threads/odd-drawing-glitch-on-yanflys-battle-engine-script.35811/
