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,549
Reaction score
859
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,647
Reaction score
15,742
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,549
Reaction score
859
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,647
Reaction score
15,742
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

A woman gave me her number without me even asking for it. Then she left because she had other patients to see.
oh, hey, I forgot about all this!

my old project got abandoned after I started working too much on stuff I'd already worked on - plus, starting to hate the story I wrote for it. Then, well, a lot of serious life **** went down. I ended up moving across the country, cutting off some people, etc. - **** was rough.

So, uh, I guess I'm back for now? Funny how things work.
I'm glad I'm sticking to my guns on having fighting game mechanics in my game, from what I've read, it's not for everyone. but for the most part, I've made it so you don't have to use them motion inputs for attacks if you don't want to.
And my project's just entered the Lunar New Year Sale 2022... Let's see if it reaches it's goal of $ 7,77.
Ohmygoodness I played Dicey Dungeons for the first time last night. Gave me SO MANY IDEAS for how to fix Heidi.

Forum statistics

Threads
118,729
Messages
1,118,282
Members
155,881
Latest member
falsekithe
Top