RPG Maker Forums

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.

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top