Using instant cast item removes battle HUD

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Of the scripts I am using, the only ones I think are relevant to my problem are:


Yanfly's Battle Engine


Yanfly's Instant Cast


The modification in the spoiler which restricts the ability to instant cast an item to one specific actor.

#=============================================================
# Moogle_X given on rpgmakerweb.com forum 29 July 2015
# Enables Yanfly's Instant Cast script to apply to using an item
# as the instant action.
# Restricts to one instant action per turn.
# Restricts to one actor ID at line #60
# Put below Yanfly's Instant Cast script.
#===========================================================
 
class Game_Actor < Game_Battler


  attr_accessor :already_instant
 
  alias moogle_setup_instant setup
  def setup(actor_id)
    moogle_setup_instant(actor_id)
    @already_instant = false
  end
 
  #--------------------------------------------------------------------------
  # * Processing at Start of Battle
  #--------------------------------------------------------------------------
  def on_battle_start
    super
    @already_instant = false
  end
 
  #--------------------------------------------------------------------------
  # * Processing at End of Battle
  #--------------------------------------------------------------------------
  def on_battle_end
    super
    @already_instant = false
  end
 
  #--------------------------------------------------------------------------
  # * Processing at End of Turn
  #--------------------------------------------------------------------------
  def on_turn_end
    super
    @already_instant = false
  end
 
end # Game_Actor


#==============================================================================
# ¡ Scene_Battle
#==============================================================================


class Scene_Battle < Scene_Base
 
  #--------------------------------------------------------------------------
  # new method: instant_action?
  #--------------------------------------------------------------------------
  def instant_action?
    return false if BattleManager.actor.nil?
    return false if BattleManager.actor.input.nil?
    action = BattleManager.actor.input.item
    if action.is_a?(RPG::Item)
      return false if BattleManager.actor.id != 3 # <= CHANGE THIS TO ACTOR ID.
    end
    return false if action.nil?
    return false if BattleManager.actor.already_instant == true
    return action.instant
  end


 
  #--------------------------------------------------------------------------
  # new method: perform_instant_action
  #--------------------------------------------------------------------------
  def perform_instant_action
    hide_instant_action_windows
    @subject = BattleManager.actor
    @subject.check_instant_action
    if @subject.current_action.valid?
      execute_action
      @subject.already_instant = true
    end
    
    process_event
    loop do
      @subject.remove_current_action
      break if $game_troop.all_dead?
      break unless @subject.current_action
      @subject.current_action.prepare
      execute_action if @subject.current_action.valid?
    end
    process_action_end
    @subject.make_actions
    @subject.restore_instant_action
    @subject = nil
    show_instant_action_windows
  end


end





What happens extremely rarely is that when an item is used as an instant cast, the battle HUD vanishes.


Missing HUD.png


Can anyone work out why this happens?


Thanks.
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
When you say "Battle HUD" which parts of the HUD you mean?


I can see that there is no status window there, but aside from that, is there anything else missing?


Are you in command selection mode in the screenshot or that window just happened to not hide itself somehow?


That script you wrote in the spoiler overwrites a lot of methods in the Game_Actor class. Some of them are used by other scripts pretty often. Don't know if this is relevant to your issue, just something I noticed.


There are 2 methods which seems to be messing with the windows, the hide_instant_action_windows and the show_instant_action_windows, but checking those methods, I can't see how would these methods do anything even remotely relevant to their method names (most of the code there only shows windows, not hide them)...

def show_instant_action_windows
if $imported["YEA-BattleEngine"]
@info_viewport.visible = true
@status_window.show # <-- Line added here!
end
start_actor_command_selection
status_redraw_target(BattleManager.actor)
next_command unless BattleManager.actor.inputable?
end

Try to add that line I added in the above method found in the Instant Cast script.


No idea if this will fix your issue or not, but in theory, it should make sure that the status window will get shown at the end of an instant cast skill/item processing.
 
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Sixth What's missing is the section showing the actors' faces, HP, MP and TP bars - everything to the left of the bit remaining in the screen shot.  As far as I can see, everything else that should be there is there.


I just want to be clear, because I don't want it to appear that I'm claiming credit for someone else's work, that the script in the spoiler is by Moogle_X, not by me.


I'm in command selection mode when it happens.  The normal sequence is: I choose use an item for the actor with that ability. He uses it and I then get to choose his ordinary action.  What happens, but only very rarely, is that the item is used and then what is shown in the screen shot happens.


I dropped that line into Yanfly's script and will now have to wait to see if the problem recurs.  Because it's so rare, I can't easily replicate it for testing purposes.


Thank you for your answer.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top