[VX Ace][SOLVED] Game stuck in loop when state change happens while custom Jump attack is being used
BMM Archive · July 15, 2026
Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: [VX Ace][SOLVED] Game stuck in loop when state change happens while custom Jump attack is being used
- Original author: The_Fireplace
- Original date: November 12, 2017
- Source thread: https://forums.rpgmakerweb.com/threads/vx-ace-solved-game-stuck-in-loop-when-state-change-happens-while-custom-jump-attack-is-being-used.87115/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Script Support
Summary
Hello, I am working on a modified version of Ellye's Combat Interface that includes animation for a custom Jump attack. The attack works, but if any battler's state changes (friend or foe, it doesn't matter) while a character is in the air, the game freezes. Spoiler: Script Code:
Archived First Post
Hello,
I am working on a modified version of Ellye's Combat Interface that includes animation for a custom Jump attack. The attack works, but if any battler's state changes (friend or foe, it doesn't matter) while a character is in the air, the game freezes.
Here's a sample project. Just run it, and it will put you in a battle with Eric as the dragoon, and Ryoma so someone can be hit by attacks. Have Eric Jump, and the enemies will blind Ryoma when they attack him. At that point, the game will freeze.
If someone could help me figure out why it freezes, that would be very much appreciated.
One other thing I've noticed is that even though it's frozen, it doesn't say "Game has stopped responding" or anything like that, which leads me to think it could be an infinite loop that it gets stuck on (I don't know how it would handle one).
I am working on a modified version of Ellye's Combat Interface that includes animation for a custom Jump attack. The attack works, but if any battler's state changes (friend or foe, it doesn't matter) while a character is in the air, the game freezes.
Code:
#-------------------------------------------------------------------
# Ellye's Combat Interface (Modified)
# A Combat UI script made by Ellye and modified by The_Fireplace.
# This is a free script for all use, provided "as is", no warranties.
#-------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Custom Bugfix: Load actor sprite when an actor is added during battle.
#--------------------------------------------------------------------------
class Game_Party
alias :old_add_actor :add_actor
def add_actor(actor_id)
old_add_actor(actor_id)
if($game_party.in_battle)
members[-1].on_battle_start
end
end
end
class Game_BaseItem
#Custom: make action id readable.
attr_reader :item_id
end
class Game_BattlerBase
#Custom variable: in_air for jump attacks
attr_accessor :in_air
end
class Sprite_Battler
#Custom: Make sure the sprite doesn't show up when the actor is in the air
def init_visibility
@battler_visible = @battler.alive? && !@battler.in_air
self.opacity = 0 unless @battler_visible
end
end
#--------------------------------------------------------------------------
# * Uses charset sprites as Actor battlers sprites
#--------------------------------------------------------------------------
class Game_Actor
attr_accessor :screen_x
attr_accessor :screen_y
attr_accessor :screen_z
alias :old_initialize :initialize
def initialize(actor_id)
old_initialize(actor_id)
@screen_x = 0
@screen_y = 0
end
def screen_z
return 100
end
def use_sprite?
return true
end
alias :old_on_battle_start :on_battle_start
def on_battle_start
old_on_battle_start
#Custom: modified to display them all on one row
@screen_x = 180 + (109 * self.index)
@screen_y = 340
end
end
class Sprite_Battler
def update_bitmap
char_w = 32
char_h = 32
if @battler.battler_name == "" && @battler.character_name != ""
@battler.character_index < 4 ? rect_y = char_h*3 : rect_y = char_h*7 #Selecting correct row for the sprite (Standard size)
rect_x = char_w + (char_w*3*(@battler.character_index % 4)) #Selecting correct column for the sprite (Standard size)
new_bitmap_cs = Cache.character(@battler.character_name) #Load charset
new_bitmap = Bitmap.new(char_w, char_h) #Make empty, standard character sized, bitmap
new_bitmap.blt(0, 0, new_bitmap_cs, Rect.new(rect_x, rect_y, char_w, char_h)) #Copies the sprite from the charset to the new bitmap
else
new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
end
if bitmap != new_bitmap
self.bitmap = new_bitmap
init_visibility
end
end
#--------------------------------------------------------------------------
# * Changing the duration of some effects, and adding a new :pounce effect for physical attacks
#--------------------------------------------------------------------------
def start_effect(effect_type)
@effect_type = effect_type
case @effect_type
when :appear
@effect_duration = 32
@battler_visible = true
when :disappear
@effect_duration = 64
@battler_visible = false
when :pounce
@effect_duration = 32
@battler_visible = true
when :leap#Custom: For jump attacks
@effect_duration = 64
@battler.in_air = true
when :fall#Custom: For jump attacks, part 2
@effect_duration = 64
@battler.in_air = false
when :whiten
@effect_duration = 32
@battler_visible = true
when :blink
@effect_duration = 40
@battler_visible = true
when :collapse
@effect_duration = 48
@battler_visible = false
when :boss_collapse
@effect_duration = bitmap.height
@battler_visible = false
when :instant_collapse
@effect_duration = 16
@battler_visible = false
end
revert_to_normal
end
#--------------------------------------------------------------------------
# * Updating the Pounce Effect
#--------------------------------------------------------------------------
def update_effect
if @effect_duration > 0
@effect_duration -= 1
case @effect_type
when :pounce
update_pounce
when :leap#Custom: For jump attacks
update_leap
when :fall#Custom: For fall attacks (Part 2 of Jump)
update_fall
when :whiten
update_whiten
when :blink
update_blink
when :appear
update_appear
when :disappear
update_disappear
when :collapse
update_collapse
when :boss_collapse
update_boss_collapse
when :instant_collapse
update_instant_collapse
end
@effect_type = nil if @effect_duration == 0
end
end
def update_pounce
@effect_duration > 16 ? self.oy += 32 - @effect_duration : self.oy += @effect_duration
end
#Custom: Leap into the air
def update_leap
self.oy += 64*5 - @effect_duration*5
end
#Custom: Fall on the enemy
def update_fall
self.oy += @effect_duration*5
end
alias :old_revert_to_normal :revert_to_normal
def revert_to_normal
old_revert_to_normal
self.oy = bitmap.height
end
end
#--------------------------------------------------------------------------
# * Battle Scene layout
#--------------------------------------------------------------------------
class Scene_Battle
#Custom: Make sure Jump is cancelled
alias :old_start :start
def start
old_start
$game_temp.reserve_common_event(1)
end
alias :old_create_status_window :create_status_window
def create_status_window
old_create_status_window
@status_window.x = 137
@status_window.set_handler(:ok, method(:on_actor_ok)) #We will use the status window for party-targeting
@status_window.set_handler(:cancel, method(:on_actor_cancel)) #We will use the status window for party-targeting
end
alias :old_create_info_viewport :create_info_viewport
def create_info_viewport
old_create_info_viewport
@info_viewport.ox = 0
end
def move_info_viewport(ox)
current_ox = @info_viewport.ox #don't move anymore
end
alias :old_create_actor_command_window :create_actor_command_window
def create_actor_command_window
old_create_actor_command_window
@actor_command_window.x = Graphics.width - @actor_command_window.width
end
def select_actor_selection
@status_window.refresh
@status_window.activate #We will use the status window for party-targeting
end
def on_actor_ok
BattleManager.actor.input.target_index = @status_window.index #We will use the status window for party-targeting
@actor_window.hide
@skill_window.hide
@item_window.hide
next_command
end
def abs_wait_short
abs_wait(20)
end
def execute_action
#Custom: Check for jump/fall attacks before using pounce/whiten
if @subject.current_action.item.note.include? "<leap>"
@subject.sprite_effect_type = :leap
elsif @subject.current_action.item.note.include? "<fall>"
@subject.sprite_effect_type = :fall
elsif @subject.actor?
@subject.sprite_effect_type = :pounce #changed to the custom pounce effect
else
@subject.sprite_effect_type = :whiten #enemies still look better with whiten
end
use_item
abs_wait_short #Slowing things down a bit
@log_window.wait_and_clear
end
end
#--------------------------------------------------------------------------
# * Battle Status Window layout
# * Modified by The_Fireplace to display 4 in one row. (Original Script: 3)
#--------------------------------------------------------------------------
class Window_BattleStatus
def initialize
super(0, 0, window_width, window_height)
refresh
self.openness = 0
self.opacity = 0
end
def window_width
436
end
def window_height
120
end
def col_max
return 4
end
def spacing
return 6
end
def standard_padding
return 0
end
def item_height
return 48
end
def item_rect(index)
rect = Rect.new
rect.width = item_width
rect.height = item_height
rect.x = index % col_max * (item_width + spacing)
rect.y = 8 + (index / col_max * (item_height + 16))
rect
end
def draw_vertical_actor_icons(actor, x, y, height = 24)
icons = (actor.state_icons + actor.buff_icons)[0, height / 24]
icons.each_with_index {|n, i| draw_icon(n, x, y + 24*i) }
end
def draw_item(index)
actor = $game_party.battle_members[index]
rect = item_rect(index)
draw_actor_hp(actor, rect.x, rect.y+40, rect.width)
draw_vertical_actor_icons(actor, rect.x, rect.y)
if $data_system.opt_display_tp
draw_actor_mp(actor, rect.x, rect.y+60, (rect.width/2)-1)
draw_actor_tp(actor, rect.x+(rect.width/2)+2, rect.y+60, (rect.width/2)-1)
else
draw_actor_mp(actor, rect.x, rect.y+60, rect.width)
end
end
end
#--------------------------------------------------------------------------
# * Battle Log - slowing it down a bit
#--------------------------------------------------------------------------
class Window_BattleLog
def display_action_results(target, item)
if target.result.used
last_line_number = line_number
display_critical(target, item)
display_damage(target, item)
display_affected_status(target, item)
display_failure(target, item)
wait if line_number > last_line_number
end
end
def wait_and_clear
wait while @num_wait < 4 if line_number > 0
clear
end
end
Here's a sample project. Just run it, and it will put you in a battle with Eric as the dragoon, and Ryoma so someone can be hit by attacks. Have Eric Jump, and the enemies will blind Ryoma when they attack him. At that point, the game will freeze.
If someone could help me figure out why it freezes, that would be very much appreciated.
One other thing I've noticed is that even though it's frozen, it doesn't say "Game has stopped responding" or anything like that, which leads me to think it could be an infinite loop that it gets stuck on (I don't know how it would handle one).
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
1
view
Topic Summary
Loading summary...