Window Disappear with Instant Cast

IMG_20231216_185344.png

Welcome. This probably have simple fix but i have no clue so ask help. I want to make scan skill that show information about enemy with message box. Problem is that i don't want player spend turn for it so i put Yanfly's Instant Cast https://yanflychannel.wordpress.com/rmvxa/battle-scripts/instant-cast/ but after skill worked i have situation with image, so my question is how load actor window again
What script are you using for the enemy scan?
The instant cast should not have caused this effect.
What script are you using for the enemy scan?
The instant cast should not have caused this effect.
1702966067117.png
1702966073649.png
1702966078524.png
1702966082534.png
1702966094023.png
1702966162929.png


Recreated setup on fresh project, same effect, here's all scripts and skill itself
It's because you use a common event with a show text command which causes the status window to close.
This is an unexpected process that was not accounted for.
Ruby:
class Scene_Battle < Scene_Base
  alias r2_restore_status_instant_cast    show_instant_action_windows
  def show_instant_action_windows
    r2_restore_status_instant_cast
    @status_window.open
  end
end

Also if you don't want the message for no damage to show for this skill use this script I just made and put a note tag on the skill <no dam msg>
Spoiler: No Damage Message
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Show no log for HP damage    ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║   Script Function                   ║    19 Dec 2023     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Requires: nil                                            ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Stops the log window from showing a message when no      ║
# ║ message is desired for the skill                         ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Add note tag on skill                                  ║
# ║    <NO_DAM_MSG> or <no dam msg> or <nodammsg>            ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║ 1.00 - 22 Nov 2023 - Script finished                     ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker except nudity             ║
# ╚══════════════════════════════════════════════════════════╝

module R2_STOP_DAM_MSG
    
    NO_DAM_MSG = /<(?:NO_DAM_MSG|no dam msg|nodammsg)>/i
    
end

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
 
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_r2_no_dmg_msg load_database; end
  def self.load_database
    load_database_r2_no_dmg_msg
    load_notetags_r2_no_dmg_msg
  end
 
  #--------------------------------------------------------------------------
  # new method: load_notetags_antifail
  #--------------------------------------------------------------------------
  def self.load_notetags_r2_no_dmg_msg
    groups = [$data_skills, $data_items]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_no_dmg_msg
      end
    end
  end
 
end # DataManager

#==============================================================================
# ■ RPG::UsableItem
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :nodmgmsg
 
  #--------------------------------------------------------------------------
  # common cache: load_notetags_nomsg
  #--------------------------------------------------------------------------
  def load_notetags_no_dmg_msg
    @nodmgmsg = false
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when R2_STOP_DAM_MSG::NO_DAM_MSG
        @nodmgmsg = true
      #---
      end
    } # self.note.split
    #---
  end
 
end # RPG::UsableItem

class Window_BattleLog < Window_Selectable
  #--------------------------------------------------------------------------
  # * Display HP Damage
  #--------------------------------------------------------------------------
  alias r2_no_hp_damage_msg   display_hp_damage
  def display_hp_damage(target, item)
    return if item.nodmgmsg
    r2_no_hp_damage_msg
  end
  #--------------------------------------------------------------------------
  # * Display MP Damage
  #--------------------------------------------------------------------------
  alias r2_no_mp_damage_msg   display_mp_damage
  def display_mp_damage(target, item)
    return if item.nodmgmsg
    r2_no_mp_damage_msg
  end
  #--------------------------------------------------------------------------
  # * Display TP Damage
  #--------------------------------------------------------------------------
  alias r2_no_tp_damage_msg   display_tp_damage
  def display_tp_damage(target, item)
    return if item.nodmgmsg
    r2_no_tp_damage_msg
  end
end
Okay, finally was able to test it and both works juuust fine:no 0 damage message + status window return after message box. Thanks!
Edit:after testing i noticed that hp/mp/tp bar seems to be loaded...twice? like it gets second layer, but when i press cancel to fight/escape option, it became back again
1702999616235.png
1702999751634.png
Edit:after testing i noticed that hp/mp/tp bar seems to be loaded...twice? like it gets second layer, but when i press cancel to fight/escape option, it became back again
So you need to say what scripts you have. What causes your status to look like the right image?
The default is the left.
So you need to say what scripts you have. What causes your status to look like the right image?
The default is the left.
1703003777805.png
1703003835843.png
1703003869892.png


i spelled it wrong. I wanted to say that hp/mp/tp bar double loading happens in both test project with these 5 scripts and in my game, i just used these 2 images as showcase of it (zoomed for better visual example)
happens in both test project with these 5 scripts and in my game,
Impossible. this does not occur in the default game. You have something else causing this.
Impossible. this does not occur in the default game. You have something else causing this.
1703011765958.png

1703011787018.png

ezgif-4-caf07eda86.gif

recreated it on your project. It isn't really that important cus, again, it's fixed by pressing x, but still wonder how it's happen
View attachment 288647
View attachment 288649
ezgif-4-caf07eda86.gif

recreated it on your project. It isn't really that important cus, again, it's fixed by pressing x, but still wonder how it's happen
All you are showing me here is that it doesn't happen. You're zooming on the hp bar and nothing happens.
Maybe it's a graphical issue with your computer?
From what I can gather of the OP's examples there, I believe they're referring to how the text/outlines of the HP/MP labels are doubling up on top of each other once the instant skill is used. Which is most evident with the outline becoming thicker/more prominent after the cast, right?
From what I can gather of the OP's examples there, I believe they're referring to how the text/outlines of the HP/MP labels are doubling up on top of each other once the instant skill is used. Which is most evident with the outline becoming thicker/more prominent after the cast, right?
Yes, that, sorry if my wording doesn't explain it
From what I can gather of the OP's examples there, I believe they're referring to how the text/outlines of the HP/MP labels are doubling up on top of each other once the instant skill is used. Which is most evident with the outline becoming thicker/more prominent after the cast, right?
I never would have considered that a problem. From my perspective it looks better with the double. (if you could call it that)
I don't think there is anything to be done there. The window gets redrawn when it is reopened. they literally should be the exact same since it's the same code that draws it, but somehow the viewport is changed (just a guess).
No clue.

Out of curiosity are you using a 17" monitor so that the resolution is low and you can see the difference?
Really how can people see such a tiny change when the window doesn't change instantly . it's closed then opened, how can there be any way to see that?
I never would have considered that a problem. From my perspective it looks better with the double. (if you could call it that)
I don't think there is anything to be done there. The window gets redrawn when it is reopened. they literally should be the exact same since it's the same code that draws it, but somehow the viewport is changed (just a guess).
No clue.

Out of curiosity are you using a 17" monitor so that the resolution is low and you can see the difference?
Really how can people see such a tiny change when the window doesn't change instantly . it's closed then opened, how there be any way to see that?
23,8" actually. I noticed it randomly just because I was recording video for showcase and resolution was automatically high enough because fullscreen++ so, yeah.
It's not really that important, I just was curious, that's all.
So far it seems to be "normal" as long as the values don't change, but what if they do?
Do you see any weird stuff taking place then?
So far it seems to be "normal" as long as the values don't change, but what if they do?
Do you see any weird stuff taking place then?
not sure what you mean by that:change max parameters/change current hp? just double outline. Only thing is that if you add new members they will not have double outline
1703078797286.png

Edit:i have noticed you added hime error tracker that gives extended error explanation but i know it has bug upon pressing f12
1703078899848.png

Now i may not be professional but i managed to fix it and still have extended error, so i just wonder what's the point of lines i commented
1703078944029.png
(Was)
1703078954684.png
(The Fix)
I think if we just refresh the status window that would fix it.
Ruby:
class Scene_Battle < Scene_Base
  alias r2_restore_status_instant_cast    show_instant_action_windows
  def show_instant_action_windows
    r2_restore_status_instant_cast
    @status_window.open
    @status_window.refresh
  end
end

What you have done with the backtracer is removed it's function for the default.
Either leave it as it was intended or don't use it at all.
Pressing F12 is a restart but often has issues. It is often recommended to not use F12, instead using a script to block it so players can't accidentally restart the game and cause errors.
I think if we just refresh the status window that would fix it.
Ruby:
class Scene_Battle < Scene_Base
  alias r2_restore_status_instant_cast    show_instant_action_windows
  def show_instant_action_windows
    r2_restore_status_instant_cast
    @status_window.open
    @status_window.refresh
  end
end

What you have done with the backtracer is removed it's function for the default.
Either leave it as it was intended or don't use it at all.
Pressing F12 is a restart but often has issues. It is often recommended to not use F12, instead using a script to block it so players can't accidentally restart the game and cause errors.
Okay that one fix doesn't have double layout, so we cool, for f12 one...well as i mentioned it still have it's error log part so it works at least

Original thread: https://forums.rpgmakerweb.com/threads/window-disappear-with-instant-cast.163958/