Yami Order Battlers Strange Escape Bug + Vertical Gauge?

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,535
Reaction score
854
First Language
English
Primarily Uses
RMVXA
Got the top 8 showing. Now to just figure out why the order doesn't match
Almost had it. in your clean project it is a bit off.

Inspecting the order glitch - I see that the original script is not correct.
I removed everything I made and it still does not show the correct icon when selecting the enemy.
So it's not me. The script does not align the correct battler to the icon shown.
*tested PCTB option and it worked fine.
 
Last edited:

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
342
Reaction score
766
First Language
English
Primarily Uses
RMVXA
Got the top 8 showing. Now to just figure out why the order doesn't match
Almost had it. in your clean project it is a bit off.

Inspecting the order glitch - I see that the original script is not correct.
I removed everything I made and it still does not show the correct icon when selecting the enemy.
So it's not me. The script does not align the correct battler to the icon shown.
*tested PCTB option and it worked fine.

What do you mean PCTB order?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,535
Reaction score
854
First Language
English
Primarily Uses
RMVXA
Its the one you didn't want right from the start.
That's why I wrote the extra scripts. You don't want PCTB you want DTB.
When I tested the PCTB in default horizontal mode, it work perfectly.
When I tested DTB in horizontal it did not. Probably a fault in the script since PCTB tells you who is next and you do the action for that actor. It doesn't move the icons for selecting the enemy.
But the DTB does move the icons, and it's not aligning.

What I'm seeing is that the attack order right now in my test is correct for the icons, but the enemy selection is not correct. When you choose to attack the bat, the icon for the slime move out. When you select the rat the bat move out. The enemy window is not getting passed to the battle order to tell it what icon to highlight when selecting the enemy (or actor).

I would like to figure this out as much as you, but it's making me go in circles looking for where the data is not correct.
 

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
342
Reaction score
766
First Language
English
Primarily Uses
RMVXA
Its the one you didn't want right from the start.
That's why I wrote the extra scripts. You don't want PCTB you want DTB.
When I tested the PCTB in default horizontal mode, it work perfectly.
When I tested DTB in horizontal it did not. Probably a fault in the script since PCTB tells you who is next and you do the action for that actor. It doesn't move the icons for selecting the enemy.
But the DTB does move the icons, and it's not aligning.

What I'm seeing is that the attack order right now in my test is correct for the icons, but the enemy selection is not correct. When you choose to attack the bat, the icon for the slime move out. When you select the rat the bat move out. The enemy window is not getting passed to the battle order to tell it what icon to highlight when selecting the enemy (or actor).

I would like to figure this out as much as you, but it's making me go in circles looking for where the data is not correct.

Well after some inspection it's not that the icons are wrong. It's just that it's displaying the icons we can't see past the border.

They're still counted even when they're invisible, because killing 3 bats to lower the icon count back to 8 makes it display normally.

(For reference this is with my code and not your I > 7 array code)
 
Last edited:

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
342
Reaction score
766
First Language
English
Primarily Uses
RMVXA
I... have come up with a way to turn it on and off!

if self.y > 27 && $game_switches[980] == false
self.opacity = 255 unless @battler.hidden? || (!@show_dead && @battler.dead?)
@first_time = true
else
self.opacity = -255
@update_ordergauge = true
end

-

next if i <= 2 unless $game_switches[980] == true
next if i > 7 unless $game_switches[980] == false

So what this is:

If this switch is on, it will cut the extra icons if there are more than 8 battlers, leaving only the top eight visible since reversing the original array did that for some reason.

If it's off, then it will display like normal for fights with less than 8 battlers.

Tweaking my code is proving that it is possible for 8+ battlers to properly work, but I haven't gotten it down pat. The icons work at turn 0 and they update when the turn actually starts, but they stay glitched and weird when you choose actions. Likely because they just stack on each other and don't actually move forward.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,535
Reaction score
854
First Language
English
Primarily Uses
RMVXA
I took part of what you did and combined it with mine.

I got the selecting the correct icons working, but now I actual realize that the order is incorrect.
Working on it.

Do you have the icons showing the correct order?

I've tried putting this into my project and only had to make one small adjustment.
I was surprised. I use Victor Sant Animated Battlers and it still worked.
Now to decide if I want to use it.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,535
Reaction score
854
First Language
English
Primarily Uses
RMVXA
@RCXDan
Thy these in your project.
Ruby:
# if you get an error under Order Battlers Line 677 put a # there

# if @actor_command_window.current_symbol == :attack #&& !BattleManager.actor.input.attack?
# Order patch by Roninator2

module R2_Turn_Gauge_Display
  SWITCH = 10
end

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Enemy Appear
  #--------------------------------------------------------------------------
  def command_335
    iterate_enemy_index(@params[0]) do |enemy|
      enemy.appear
      $game_switches[R2_Turn_Gauge_Display::SWITCH] = true
      $game_troop.make_unique_names
    end
  end
  #--------------------------------------------------------------------------
  # * Enemy Transform
  #--------------------------------------------------------------------------
  def command_336
    iterate_enemy_index(@params[0]) do |enemy|
      enemy.transform(@params[1])
      $game_switches[R2_Turn_Gauge_Display::SWITCH] = true
      $game_troop.make_unique_names
    end
  end
end
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # new method: update spriteset
  #--------------------------------------------------------------------------
  def update_spriteset_order
    @spriteset_order = []
    if $imported["YSA-PCTB"] && YSA::PCTB::CTB_MECHANIC[:predict] == 1
      @active_order_sprite = Sprite_OrderBattler.new(@spriteset.viewportOrder, nil, :pctb2)
    end
    if $imported["YSA-PCTB"] && YSA::PCTB::CTB_MECHANIC[:predict] == 2
      num = YSA::PCTB::CTB_MECHANIC[:pre_turns]
      i = 0
      num.times {
        order = Sprite_OrderBattler.new(@spriteset.viewportOrder, nil, :pctb3, i)
        @spriteset_order.push(order)
        i += 1
      }
      return
    end
    for battler in $game_party.members + $game_troop.members
      battle_type = :dtb
      battle_type = :pctb if BattleManager.btype?(:pctb)
      battle_type = :catb if BattleManager.btype?(:catb)
      order = Sprite_OrderBattler.new(@spriteset.viewportOrder, battler, battle_type)
      @spriteset_order.push(order)
    end
  end
  #--------------------------------------------------------------------------
  # alias method: update
  #--------------------------------------------------------------------------
  alias update_order_guage update
  def update
    update_spriteset_order if $game_switches[R2_Turn_Gauge_Display::SWITCH] == true
    $game_switches[R2_Turn_Gauge_Display::SWITCH] = false
    update_order_guage
  end
end
class Game_Battler < Game_BattlerBase
  alias r2_enemy_revive_order_gauge   revive
  def revive
    r2_enemy_revive_order_gauge
    $game_switches[R2_Turn_Gauge_Display::SWITCH] = true
  end
end
*updated
Ruby:
class Sprite_OrderBattler < Sprite_Base
  def update_dtb_style
    #---
    actor_window = SceneManager.scene.actor_window
    enemy_window = SceneManager.scene.enemy_window
    if actor_window.active
      battler = actor_window.actor
      if battler == @battler
        @move_x = 36
      else
        @move_x = 24
      end
    end
    if enemy_window.active
      battler = enemy_window.enemy
      if battler == @battler
        @move_x = 36
      else
        @move_x = 24
      end
    end
    if !actor_window.active && !enemy_window.active
      @move_x = 24
    end
    #---
    return if !@move_x && !@move_y
    if @battler.hidden? || (!@show_dead && @battler.dead?)
      self.opacity = -20
    end
    if self.y != @move_y && @move_y
      if @move_y > self.y
        @move_x = 16
      elsif @move_y < self.y
        @move_x = 34
      else
        @move_x = 20
      end
      self.z = (@move_y < self.y) ? 7500 : 8500
      if @move_y >= self.y
        self.y += [@move_rate_y, @move_y - self.y].min
      else
        self.y -= [@move_rate_y, - @move_y + self.y].min
      end
    end
    if self.x != @move_x && @move_x
      self.x += (self.x > @move_x) ? -@move_rate_x : @move_rate_x
    end
    if self.y == @move_y && @move_y
      @first_time = false if @first_time
      @move_y = nil
    end
    if self.x == @move_x && @move_x
      @move_x = nil
    end
  end
 
  alias r2_update_opacity update
  def update
    r2_update_opacity
    self.opacity = 0 if self.y < 0
    self.opacity = 255 if self.y >= 0
  end
 
  def make_dtb_destination
    #---
    BattleManager.performed_battlers = [] if !BattleManager.performed_battlers
    array = BattleManager.performed_battlers.reverse
    action = BattleManager.action_battlers.reverse - BattleManager.performed_battlers.reverse
    array += action
    action.uniq!
    array.uniq!
    #---
    result = []
    for member in array
      next if member.hidden?
      result.push(member) unless member.dead?
      action.delete(member) if member.dead? and !@show_dead
    end
    if @show_dead
      for member in array
        next if member.hidden?
        result.push(member) if member.dead?
      end
    end
    #---
    limit = result.size
    move_limit = limit - 7
    index = result.index(@battler).to_i
    index = index - move_limit if limit > 8
    index = -4 if @battler.dead?
    index = -4 if @battler.hidden?
    @move_y = 24 + index * 24
    if BattleManager.in_turn?
      @move_y += 6 if action.include?(@battler)
      @move_y += 6 if (index + 1 == result.size) and action.size > 1
    end
    den = @first_time ? 12 : 24
    @move_rate_y = [((@move_y - self.y)/den).abs, 1].max
  end
 
end
class Scene_Battle < Scene_Base
  alias order_gauge_party_update update
  def update
    order_gauge_party_update
    if @party_command_window.active
      @update_ordergauge = true
    end
  end
end
 
Last edited:

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
342
Reaction score
766
First Language
English
Primarily Uses
RMVXA
@RCXDan
Thy these in your project.
Ruby:
# if you get an error under Order Battlers Line 677 put a # there

# if @actor_command_window.current_symbol == :attack #&& !BattleManager.actor.input.attack?
# Order patch by Roninator2

module R2_Turn_Gauge_Display
  SWITCH = 10
end

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Enemy Appear
  #--------------------------------------------------------------------------
  def command_335
    iterate_enemy_index(@params[0]) do |enemy|
      enemy.appear
      $game_switches[R2_Turn_Gauge_Display::SWITCH] = true
      $game_troop.make_unique_names
    end
  end
  #--------------------------------------------------------------------------
  # * Enemy Transform
  #--------------------------------------------------------------------------
  def command_336
    iterate_enemy_index(@params[0]) do |enemy|
      enemy.transform(@params[1])
      $game_switches[R2_Turn_Gauge_Display::SWITCH] = true
      $game_troop.make_unique_names
    end
  end
end
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # new method: update spriteset
  #--------------------------------------------------------------------------
  def update_spriteset_order
    @spriteset_order = []
    if $imported["YSA-PCTB"] && YSA::PCTB::CTB_MECHANIC[:predict] == 1
      @active_order_sprite = Sprite_OrderBattler.new(@spriteset.viewportOrder, nil, :pctb2)
    end
    if $imported["YSA-PCTB"] && YSA::PCTB::CTB_MECHANIC[:predict] == 2
      num = YSA::PCTB::CTB_MECHANIC[:pre_turns]
      i = 0
      num.times {
        order = Sprite_OrderBattler.new(@spriteset.viewportOrder, nil, :pctb3, i)
        @spriteset_order.push(order)
        i += 1
      }
      return
    end
    for battler in $game_party.members + $game_troop.members
      battle_type = :dtb
      battle_type = :pctb if BattleManager.btype?(:pctb)
      battle_type = :catb if BattleManager.btype?(:catb)
      order = Sprite_OrderBattler.new(@spriteset.viewportOrder, battler, battle_type)
      @spriteset_order.push(order)
    end
  end
  #--------------------------------------------------------------------------
  # alias method: update
  #--------------------------------------------------------------------------
  alias update_order_guage update
  def update
    update_spriteset_order if $game_switches[R2_Turn_Gauge_Display::SWITCH] == true
    $game_switches[R2_Turn_Gauge_Display::SWITCH] = false
    update_order_guage
  end
end
class Game_Battler < Game_BattlerBase
  alias r2_enemy_revive_order_gauge   revive
  def revive
    r2_enemy_revive_order_gauge
    $game_switches[R2_Turn_Gauge_Display::SWITCH] = true
  end
end
*updated
Ruby:
class Sprite_OrderBattler < Sprite_Base
  def update_dtb_style
    #---
    actor_window = SceneManager.scene.actor_window
    enemy_window = SceneManager.scene.enemy_window
    if actor_window.active
      battler = actor_window.actor
      if battler == @battler
        @move_x = 36
      else
        @move_x = 24
      end
    end
    if enemy_window.active
      battler = enemy_window.enemy
      if battler == @battler
        @move_x = 36
      else
        @move_x = 24
      end
    end
    if !actor_window.active && !enemy_window.active
      @move_x = 24
    end
    #---
    return if !@move_x && !@move_y
    if @battler.hidden? || (!@show_dead && @battler.dead?)
      self.opacity = -20
    end
    if self.y != @move_y && @move_y
      if @move_y > self.y
        @move_x = 16
      elsif @move_y < self.y
        @move_x = 34
      else
        @move_x = 20
      end
      self.z = (@move_y < self.y) ? 7500 : 8500
      if @move_y >= self.y
        self.y += [@move_rate_y, @move_y - self.y].min
      else
        self.y -= [@move_rate_y, - @move_y + self.y].min
      end
    end
    if self.x != @move_x && @move_x
      self.x += (self.x > @move_x) ? -@move_rate_x : @move_rate_x
    end
    if self.y == @move_y && @move_y
      @first_time = false if @first_time
      @move_y = nil
    end
    if self.x == @move_x && @move_x
      @move_x = nil
    end
  end
 
  alias r2_update_opacity update
  def update
    r2_update_opacity
    self.opacity = 0 if self.y < 0
    self.opacity = 255 if self.y >= 0
  end
 
  def make_dtb_destination
    #---
    BattleManager.performed_battlers = [] if !BattleManager.performed_battlers
    array = BattleManager.performed_battlers.reverse
    action = BattleManager.action_battlers.reverse - BattleManager.performed_battlers.reverse
    array += action
    action.uniq!
    array.uniq!
    #---
    result = []
    for member in array
      next if member.hidden?
      result.push(member) unless member.dead?
      action.delete(member) if member.dead? and !@show_dead
    end
    if @show_dead
      for member in array
        next if member.hidden?
        result.push(member) if member.dead?
      end
    end
    #---
    limit = result.size
    move_limit = limit - 7
    index = result.index(@battler).to_i
    index = index - move_limit if limit > 8
    index = -4 if @battler.dead?
    index = -4 if @battler.hidden?
    @move_y = 24 + index * 24
    if BattleManager.in_turn?
      @move_y += 6 if action.include?(@battler)
      @move_y += 6 if (index + 1 == result.size) and action.size > 1
    end
    den = @first_time ? 12 : 24
    @move_rate_y = [((@move_y - self.y)/den).abs, 1].max
  end
 
end
class Scene_Battle < Scene_Base
  alias order_gauge_party_update update
  def update
    order_gauge_party_update
    if @party_command_window.active
      @update_ordergauge = true
    end
  end
end

Holy hell I think we've finally cracked it. Testing proves that it does in fact work!

@Roninator2 I can't really thank you enough for this. This was pretty much all I needed.. I'm sorry for putting you through the wringer though, like yikes. :kaoswt2:

I'll definitely keep you (and Trihan for something else) in mind for when my games go commercial or something similarly momentous since you guys have pulled me out of some terrible spots.
 

Latest Threads

Latest Posts

Latest Profile Posts

Awright ya marshmallows! :kaopride: Here's a peek of what Alice's 8-bit Gothic gonna be like! EXPECT IT! (...in 2025?) :kaoswt:

alice_gothictiles.png
SF_People3_4 added!
index.php

Finds notes for an old side project... Oh, that's right, the two tracks that sounded really cool and gave inspiration for the big bad in that game... Spends day working on cutscene from old notes, looks okay, now lets slot in the first track... um... I did have those tracks??? It was a year or so ago but I did buy them didn't I?
CA9mtHJ.gif

Everything is really confusing for me

Forum statistics

Threads
118,588
Messages
1,117,149
Members
155,655
Latest member
Pepperboi
Top