Status
Not open for further replies.
Joined
May 14, 2020
Messages
34
Reaction score
6
First Language
English
Primarily Uses
RMVXA
I'm using:
- Yanfly Battle Engine
- Yanfly Free Turn Battle
- Yanfly Battle Command List

I want to disable the Confirm window completely. So, when you press Right while the last actor is selected, nothing should happen.
Same for pressing Left and going to Party command window. Don't need either of those, just want to be able to select actors by pressing left and right

tried doing that myself by messing with next_command and prior_command, but couldn't figure it out
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,510
Reaction score
847
First Language
English
Primarily Uses
RMVXA
In command list script above # Scene_Battle or class Scene_Battle < Scene_Base
Line 748
place this
__END__
underscore + underscore + END (all caps) + underscore +underscore

Then put this in a script slot below command list.
Ruby:
module BattleManager
  #--------------------------------------------------------------------------
  # * To Previous Command Input
  #--------------------------------------------------------------------------
  def self.prior_command
    begin
      if !actor || !actor.prior_command
        @actor_index -= 1
        if @actor_index < 0
          @actor_index = $game_party.members.size - 1
        end
      end 
    end until actor.inputable?
    return true
  end
  #--------------------------------------------------------------------------
  # * To Next Command Input
  #--------------------------------------------------------------------------
  def self.next_command
    cnt = 0
    begin
      if !actor || !actor.next_command
        @actor_index += 1 
        if @actor_index > $game_party.members.size - 1
          @actor_index = 0
        end
        cnt += 1
        return false if cnt > $game_party.members.size
        return false if @actor_index >= $game_party.members.size
      end 
    end until actor.inputable?
    return true
  end
end

class Scene_Battle < Scene_Base
  def prior_command
    if BattleManager.prior_command
      start_actor_command_selection
    else
      refresh_status
    end
  end
 
  #--------------------------------------------------------------------------
  # alias method: create_party_command_window
  #--------------------------------------------------------------------------
  alias create_party_command_window_bcl create_party_command_window
  def create_party_command_window
    create_party_command_window_bcl
    process_custom_party_commands
  end
  
  #--------------------------------------------------------------------------
  # new method: process_custom_party_commands
  #--------------------------------------------------------------------------
  def process_custom_party_commands
    for command in YEA::BATTLE_COMMANDS::PARTY_COMMANDS
      next unless YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS.include?(command)
      called_method = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][3]
      @party_command_window.set_handler(command, method(called_method))
    end
  end
  
  #--------------------------------------------------------------------------
  # alias method: create_actor_command_window
  #--------------------------------------------------------------------------
  alias create_actor_command_window_bcl create_actor_command_window
  def create_actor_command_window
    create_actor_command_window_bcl
    @actor_command_window.set_handler(:use_skill, method(:command_use_skill))
    @actor_command_window.set_handler(:use_item, method(:command_use_item))
  end
  
  #--------------------------------------------------------------------------
  # alias method: start_actor_command_selection
  #--------------------------------------------------------------------------
  alias start_actor_command_selection_bcl start_actor_command_selection
  def start_actor_command_selection
    @confirm_command_window.hide unless @confirm_command_window.nil?
    start_actor_command_selection_bcl
    @actor_command_window.show
  end
  
  #--------------------------------------------------------------------------
  # new method: command_use_skill
  #--------------------------------------------------------------------------
  def command_use_skill
    @skill = $data_skills[@actor_command_window.current_ext]
    BattleManager.actor.input.set_skill(@skill.id)
    BattleManager.actor.last_skill.object = @skill
    status_redraw_target(BattleManager.actor)
    if $imported["YEA-BattleEngine"]
      $game_temp.battle_aid = @skill
      if @skill.for_opponent?
        select_enemy_selection
      elsif @skill.for_friend?
        select_actor_selection
      else
        next_command
        $game_temp.battle_aid = nil
      end
    else
      if !@skill.need_selection?
        next_command
      elsif @skill.for_opponent?
        select_enemy_selection
      else
        select_actor_selection
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: command_use_item
  #--------------------------------------------------------------------------
  def command_use_item
    @item = $data_items[@actor_command_window.current_ext]
    BattleManager.actor.input.set_item(@item.id)
    status_redraw_target(BattleManager.actor)
    if $imported["YEA-BattleEngine"]
      $game_temp.battle_aid = @item
      if @item.for_opponent?
        select_enemy_selection
      elsif @item.for_friend?
        select_actor_selection
      else
        next_command
        $game_temp.battle_aid = nil
      end
    else
      if !@item.need_selection?
        next_command
      elsif @item.for_opponent?
        select_enemy_selection
      else
        select_actor_selection
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_actor_ok
  #--------------------------------------------------------------------------
  alias scene_battle_on_actor_ok_bcl on_actor_ok
  def on_actor_ok
    scene_battle_on_actor_ok_bcl
    return if !@confirm_command_window.nil? && @confirm_command_window.visible
    @actor_command_window.show
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_actor_cancel
  #--------------------------------------------------------------------------
  alias scene_battle_on_actor_cancel_bcl on_actor_cancel
  def on_actor_cancel
    scene_battle_on_actor_cancel_bcl
    case @actor_command_window.current_symbol
    when :use_skill, :use_item
      @help_window.hide
      @status_window.show
      @actor_command_window.activate
      status_redraw_target(BattleManager.actor)
    end
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_enemy_ok
  #--------------------------------------------------------------------------
  alias scene_battle_on_enemy_ok_bcl on_enemy_ok
  def on_enemy_ok
    scene_battle_on_enemy_ok_bcl
    return if !@confirm_command_window.nil? && @confirm_command_window.visible
    @actor_command_window.show
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_enemy_cancel
  #--------------------------------------------------------------------------
  alias scene_battle_on_enemy_cancel_bcl on_enemy_cancel
  def on_enemy_cancel
    scene_battle_on_enemy_cancel_bcl
    case @actor_command_window.current_symbol
    when :use_skill, :use_item
      @help_window.hide
      @status_window.show
      @actor_command_window.activate
      status_redraw_target(BattleManager.actor)
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: status_redraw_target
  #--------------------------------------------------------------------------
  def status_redraw_target(target)
    return unless target.actor?
    @status_window.draw_item($game_party.battle_members.index(target))
  end
  
  #--------------------------------------------------------------------------
  # new method: on_confirm_cancel
  #--------------------------------------------------------------------------
  def on_confirm_cancel
    @confirm_command_window.hide unless @confirm_command_window.nil?
    @actor_command_window.show
    @actor_command_window.setup(BattleManager.actor)
    @status_window.select(BattleManager.actor.index)
    prior_command unless BattleManager.actor.inputable?
  end
  
  #--------------------------------------------------------------------------
  # new method: prompt_next_actor?
  #--------------------------------------------------------------------------
  def prompt_next_actor?
    index = @status_window.index
    last_index = $game_party.battle_members.size - 1
    for member in $game_party.battle_members.reverse
      break if member.inputable?
      last_index -= 1
    end
    if index >= last_index
      actor = $game_party.battle_members[index]
      return true if prompt_ftb_action?(actor)
      return true if actor.next_command_valid?
      return false if YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW
    end
    return true
  end
  
  #--------------------------------------------------------------------------
  # new method: prompt_ftb_action?
  #--------------------------------------------------------------------------
  def prompt_ftb_action?(actor)
    return false unless $imported["YEA-BattleEngine"]
    return false unless $imported["YEA-BattleSystem-FTB"]
    return false unless BattleManager.btype?(:ftb)
    return actor.current_action.valid?
  end
  
end # Scene_Battle
 
Last edited:

Shaz

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

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

 
Joined
May 14, 2020
Messages
34
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Then put this in a script slot below command list.
Did that
Works well for Left arrow key, but Right arrow key still skips turn

edit:
Also, the game completely froze when Escape was pressed, while only 1 active actor remained (the other one was out of actions)
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,510
Reaction score
847
First Language
English
Primarily Uses
RMVXA
Script updated above
 
Joined
May 14, 2020
Messages
34
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Works perfectly now
Roninator once again to the rescue, thank you very much
 

Shaz

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

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Profile Posts

Been playing through Skies of Arcadia again, and it really makes me wanna see someone try to implement how ship battles were done in the game into RPG Maker (or really just in general).
split.png
split view of both versions of the pocket city you traverse through. there's differences like areas only being accessible in one version of Autumn Bay. or events that only happen in one or the other.
theortically if there were a developer who spied on people's game playthroughs and changed things in real time to make it harder for them, what might be said game developer's motivation?
Hi everyone! Enjoying this nice long weekend. How are you all doing? :)
I just successfully tested having events check if specific actors are in a particular party slot and then changing image to match. This will let me make scenes take into account who is in the party at the time and arrange them accordingly - this is important since I'll have extra actors beyond current party. The script used is the same from MV and is compatible with my current core plugin setup in MZ. Thank goodness.

Forum statistics

Threads
118,433
Messages
1,115,913
Members
155,391
Latest member
dndrself
Top