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.
What happens extremely rarely is that when an item is used as an instant cast, the battle HUD vanishes.

Can anyone work out why this happens?
Thanks.
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
# 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.

Can anyone work out why this happens?
Thanks.
Last edited by a moderator:

