RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
339
Reaction score
758
First Language
English
Primarily Uses
RMVXA
This is different from the other thread since I've technically already found what I want, but after testing I've found two interesting... caveats with Yami's Order Battlers script, to say the least.

Here's the code: YSA Order Battlers

The first problem is that using the "enemy transform" function to change an enemy into another doesn't update the icon. This is pretty terrible, as there's a function in the script itself that lets you give enemies custom icons.

The second much larger problem is that hidden enemies showing up through "enemy appear" just... don't have icons at all? They're an empty space between the player and enemy icons yet are still counted in the turn order. This exact same thing happens when players or enemies are revived, since it removes their icons.

Maybe people who are better at Ruby than me can come up with some quick fixes for this? From what I understand there needs to be refresh/update coding that tells the game the icons have changed, as the script already gets rid of dead actors/enemies from the turn order. Maybe that can be reverse engineered for this.

This is not a compatibility error, as I've stripped it down to just Yanfly Battle Engine (which itself I have not changed other than some colors and fonts) and Order Battlers in a fresh project and it still crops up unfortunately. If you guys can fix this, you'll have my infinite gratitude. :kaohi:
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,513
Reaction score
848
First Language
English
Primarily Uses
RMVXA
Try this
Ruby:
# if you get an error under Order Battlers Line 679 put a # there

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

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Enemy Appear
  #--------------------------------------------------------------------------
  def command_335
    iterate_enemy_index(@params[0]) do |enemy|
      enemy.appear
      BattleManager.make_ctb_battler_order
      $game_troop.make_unique_names
    end
  end
  #--------------------------------------------------------------------------
  # * Enemy Transform
  #--------------------------------------------------------------------------
  def command_336
    iterate_enemy_index(@params[0]) do |enemy|
      enemy.transform(@params[1])
      BattleManager.make_ctb_battler_order
      $game_troop.make_unique_names
    end
  end
end
module BattleManager
  #--------------------------------------------------------------------------
  # alias method: turn_start
  #--------------------------------------------------------------------------
  def self.sort_battlers(cache = false)
    if btype?(:pctb)
      battlers = []
      for battler in ($game_party.members + $game_troop.members)
        next if battler.dead? || battler.hidden?
        battlers.push(battler)
      end
      battlers.sort! { |a,b|
        if a.pctb_ctr(cache) != b.pctb_ctr(cache)
          a.pctb_ctr(cache) <=> b.pctb_ctr(cache)
        elsif a.pctb_prediction != b.pctb_prediction
          b.pctb_prediction <=> a.pctb_prediction
        elsif a.agi != b.agi
          b.agi <=> a.agi
        elsif a.screen_x != b.screen_x
          a.screen_x <=> b.screen_x
        else
          a.name <=> b.name
        end
      }
      return battlers
    end
  end
end
 

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
339
Reaction score
758
First Language
English
Primarily Uses
RMVXA
class Game_Interpreter #-------------------------------------------------------------------------- # * Enemy Appear #-------------------------------------------------------------------------- def command_335 iterate_enemy_index(@params[0]) do |enemy| enemy.appear BattleManager.make_ctb_battler_order $game_troop.make_unique_names end end #-------------------------------------------------------------------------- # * Enemy Transform #-------------------------------------------------------------------------- def command_336 iterate_enemy_index(@params[0]) do |enemy| enemy.transform(@params[1]) BattleManager.make_ctb_battler_order $game_troop.make_unique_names end end end


Where in the script am I supposed to put this? Above and below outside of it just seem to make the game crash with this error message when actors are revived or enemies are un-hidden:

uA3R0ZN.png


Same thing happens in the "has no scripts but yanfly battle engine and YSA Order Battlers" project.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,513
Reaction score
848
First Language
English
Primarily Uses
RMVXA
I have Yanfly Core
Yanfly Battle
Yami PCTB
Yami Order Battlers
my fix

I don't get any errors.
 

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
339
Reaction score
758
First Language
English
Primarily Uses
RMVXA
I have Yanfly Core
Yanfly Battle
Yami PCTB
Yami Order Battlers
my fix

I don't get any errors.

... Ooh, there's the problem. I am using Order Battlers as a standalone as Yami PCTB just... kinda screws up the game. I was not really intending on using an ATB or CTB system, just the function that lets you see who goes first.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,513
Reaction score
848
First Language
English
Primarily Uses
RMVXA
So your turn based with a view order? Then your yanfly battle system is set to dtb?
 

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
339
Reaction score
758
First Language
English
Primarily Uses
RMVXA
So your turn based with a view order? Then your yanfly battle system is set to dtb?

Yes, it is turn-based with a view order. It is set to :dtb.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,513
Reaction score
848
First Language
English
Primarily Uses
RMVXA
Ok, try this. Below Order Battlers. Set the Switch to the switch you will reserve for this script.
Ruby:
# if you get an error under Order Battlers Line 679 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
module BattleManager
  #--------------------------------------------------------------------------
  # alias method: turn_start
  #--------------------------------------------------------------------------
  def self.sort_battlers(cache = false)
    battlers = []
    for battler in ($game_party.members + $game_troop.members)
      next if battler.dead? || battler.hidden?
      battlers.push(battler)
    end
    battlers.sort! { |a,b|
      if a.agi != b.agi
        b.agi <=> a.agi
      else
        a.name <=> b.name
      end
    }
    return battlers
  end
end
class Scene_Battle < Scene_Base
  alias r2_order_gauge_create_all_windows create_all_windows
  def create_all_windows
    r2_order_gauge_create_all_windows
    update_spriteset
  end
  #--------------------------------------------------------------------------
  # new method: update spriteset
  #--------------------------------------------------------------------------
  def update_spriteset
    @spriteset_order = []
    h = []
    $game_troop.members.each do |enemy|
      h << enemy if enemy.hidden?
    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)
      next if h.include?(battler)
      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_order_guage
    update_spriteset if $game_switches[R2_Turn_Gauge_Display::SWITCH] == true
    $game_switches[R2_Turn_Gauge_Display::SWITCH] = false
  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
 
Last edited:

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
339
Reaction score
758
First Language
English
Primarily Uses
RMVXA
So excellent news, @Roninator2 - it works! Enemy transform and enemy appear are completely fixed now!

You're a god for doing this. :MV1:

... Only problem is that revived enemies/actors still lose their icons. :kaoswt2:
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,646
Reaction score
15,728
First Language
English
Primarily Uses
RMMV

I've moved this thread to RGSSx Script Support. Thank you.

 

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
339
Reaction score
758
First Language
English
Primarily Uses
RMVXA
Thank you so much, @Roninator2 ! It works now! Now to test more things about it.
 
Last edited:

RCXDan

Champion of Brightmoon Tor
Veteran
Joined
Jan 4, 2019
Messages
339
Reaction score
758
First Language
English
Primarily Uses
RMVXA
So @Roninator2 we've pretty much quashed all of the bugs this thread was made for.

I'd say we're finished here. Thanks for your help!
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

I have never felt so attacked by a tree before :LZSlol: it took 10++ hours to make but at least it looks pretty LOL

Untitled-1.png
now seems like the worst time for me to need a better computer with how much stuff is costing. that and I don't thing there's much else I can do to make MV run any better with what I have.
Sigh... to have some variety in this weather. More than just sun and rain and wind and thunder.
In the meantime, I've discovered that I'm slowly becoming fatigued from the many sleepless nights my neighbors cause. Or at least their dogs. Always barking at something.
I might need a day to just sleep and recharge.
After the initial success with one event, I set up four different events on the same map to detect who is in which slot in my current party, and fortunately it managed to work as intended, with the events changing image to match the party members even as I swapped their positions around in formation. This will be a great tool for immersive scene design.

Forum statistics

Threads
118,450
Messages
1,116,073
Members
155,425
Latest member
thealchemist222
Top