Status
Not open for further replies.

Mykindofidiot

Veteran
Veteran
Joined
May 14, 2020
Messages
40
Reaction score
7
First Language
English
Primarily Uses
RMMZ
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
4,675
Reaction score
1,323
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
45,509
Reaction score
16,407
First Language
English
Primarily Uses
RMMV

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

 

Mykindofidiot

Veteran
Veteran
Joined
May 14, 2020
Messages
40
Reaction score
7
First Language
English
Primarily Uses
RMMZ
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
4,675
Reaction score
1,323
First Language
English
Primarily Uses
RMVXA
Script updated above
 

Mykindofidiot

Veteran
Veteran
Joined
May 14, 2020
Messages
40
Reaction score
7
First Language
English
Primarily Uses
RMMZ
Works perfectly now
Roninator once again to the rescue, thank you very much
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,509
Reaction score
16,407
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 Threads

Latest Profile Posts

I've got good news and bad news. The good news is, there aren't any bad news to report. The bad news is, there aren't any good news to report.

Or as others say, yesterday was uneventful.


I am curious that can you "understand/get the point" about what does this place do generally?
(ARPG game)
If anyone knows any C# programmers, please send them my way.
Chilling at night in a tavern.
ChillingAtTavern.png

After 'multiple breakdowns', it's finally over. 10/10 will do this again.
Ever notice that villains can reform and become better people, but heroes can only ever die... or live long enough to see themselves become villains?

Isn't that interesting?

Forum statistics

Threads
129,845
Messages
1,205,688
Members
171,011
Latest member
TheUndeadFlowers
Top