What does this line of script do?

The script inside annotates @ actor_command_window.close on line 69
and adds @actor_command_window.active on line 71

The script inside does not comment out @ actor_command_window.close on line 10
and does not add @actor_command_window.active after line 11

I tried it and found that commented or uncommented, added or No added,
it seems that there is no difference !
So do I need to comment the line @ actor_command_window.close ?
And what is the reason for adding @actor_command_window.active ?


In addition, can someone add a function like that
After skipping the party command, I can press a specific key to return (display? (restart? party command)

Ruby:
    #encoding:utf-8
    #==============================================================================
    # ■ Scene_Battle
    #==============================================================================
 
    class Scene_Battle < Scene_Base
      def update_info_viewport
    #~     move_info_viewport(0)   if @party_command_window.active
        move_info_viewport(128) if @actor_command_window.active
        move_info_viewport(64)  if BattleManager.in_turn?
      end
      def update_message_open
        if $game_message.busy? && !@status_window.close?
          @message_window.openness = 0
          @status_window.close
    #~       @party_command_window.close
          @actor_command_window.close
        end
      end
      def create_all_windows
        create_message_window
        create_scroll_text_window
        create_log_window
        create_status_window
        create_info_viewport
    #~     create_party_command_window
        create_actor_command_window
        create_help_window
        create_skill_window
        create_item_window
        create_actor_window
        create_enemy_window
      end
      def start_party_command_selection
        unless scene_changing?
          refresh_status
          @status_window.unselect
          @status_window.open
          if BattleManager.input_start
    #~        @actor_command_window.close                                       #This Line
    #~         @party_command_window.setup
            @actor_command_window.active                                    #And This Line
            command_fight
          else
    #        @party_command_window.deactivate
            turn_start
          end
        end
      end
      def start_actor_command_selection
        @status_window.select(BattleManager.actor.index)
    #~     @party_command_window.close
        @actor_command_window.setup(BattleManager.actor)
      end
      def turn_start
    #~     @party_command_window.close
        @actor_command_window.close
        @status_window.unselect
        @subject =  nil
        BattleManager.turn_start
        @log_window.wait
        @log_window.clear
      end
    end
Moderator note: Moved to Learning Ruby/RGSS.That board is where most of the code experts hang out, so it's your best shot to get good answers to this.
I haven't used ace in many years, but it seems to be removing the option to select a party member, using a fixed party member instead.
I haven't used ace in many years, but it seems to be removing the option to select a party member, using a fixed party member instead.
I don't think so. Show by test, Regardless of annotated or uncommented,
It still have the option to select a party member. Not use a fixed party member.
it removes the option to check for escape/fight, and goes directly to battler command.
it removes the option to check for escape/fight, and goes directly to battler command.
Yes,it removes the option to check for escape/fight, and goes directly to battler command.
BUT, In the 4 cases below, EVERY SAME removes the option to check for escape/fight, and goes directly to battler command.And I don't see any difference of them!
Ruby:
if BattleManager.input_start

  @actor_command_window.close

#~  @party_command_window.setup

  @actor_command_window.active

  command_fight

else

#~  @party_command_window.deactivate

  turn_start

end
Ruby:
if BattleManager.input_start

#~  @actor_command_window.close

#~  @party_command_window.setup

  @actor_command_window.active

  command_fight

else

#~  @party_command_window.deactivate

  turn_start

end
Ruby:
if BattleManager.input_start

  @actor_command_window.close

#~  @party_command_window.setup

#~  @actor_command_window.active

  command_fight

else

#~  @party_command_window.deactivate

  turn_start

end
Ruby:
if BattleManager.input_start

#~  @actor_command_window.close

#~  @party_command_window.setup

#~  @actor_command_window.active

  command_fight

else

#~  @party_command_window.deactivate

  turn_start

end
if the battle can be played normally in any of those cases, then something else is overriding that, in which case, changing anything doesn't make a difference.
Everything has one line in common, command_fight
So, instead of wondering why it behaves the same, look at that particular command.

Remember, everyone makes a mistake. Do not always take every code posted on the internet as an absolute answer. Maybe, it was an oversight some of the lines are unnecessary to begin with

Code:
  def command_fight
    next_command
  end
In this particular method, we have next_command method, what does this next_command do?

Code:
  def next_command
    if BattleManager.next_command
      start_actor_command_selection
    else
      turn_start
    end
  end
The particular BattleManager.next_command search through your party member if you can input a command to your actor. Otherwise, execute the turn (doing skill, etc).

So, let's take a look at the start_actor_command_selection
Code:
  def start_actor_command_selection
    @status_window.select(BattleManager.actor.index)
    @party_command_window.close
    @actor_command_window.setup(BattleManager.actor)
  end
As you see, this particular method already has @party_command_window.close
That makes it redundant if you added one which you could see you won't see any difference.

But let's take a look at @actor_command_window.setup(BattleManager.actor)
This particular code is defined within Window_ActorCommand
Code:
  def setup(actor)
    @actor = actor
    clear_command_list
    make_command_list
    refresh
    select(0)
    activate
    open
  end
This code implies that if you call setup method, it will activate and open the @actor_command_window similarly if you put @actor_command_window.open and @actor_command_window.activate which is the reason why you see no difference.

Also a side note
The line @actor_command_window.active literally does nothing on its own.
Everything has one line in common, command_fight
So, instead of wondering why it behaves the same, look at that particular command.

Remember, everyone makes a mistake. Do not always take every code posted on the internet as an absolute answer. Maybe, it was an oversight some of the lines are unnecessary to begin with

Code:
  def command_fight
    next_command
  end
In this particular method, we have next_command method, what does this next_command do?

Code:
  def next_command
    if BattleManager.next_command
      start_actor_command_selection
    else
      turn_start
    end
  end
The particular BattleManager.next_command search through your party member if you can input a command to your actor. Otherwise, execute the turn (doing skill, etc).

So, let's take a look at the start_actor_command_selection
Code:
  def start_actor_command_selection
    @status_window.select(BattleManager.actor.index)
    @party_command_window.close
    @actor_command_window.setup(BattleManager.actor)
  end
As you see, this particular method already has @party_command_window.close
That makes it redundant if you added one which you could see you won't see any difference.

But let's take a look at @actor_command_window.setup(BattleManager.actor)
This particular code is defined within Window_ActorCommand
Code:
  def setup(actor)
    @actor = actor
    clear_command_list
    make_command_list
    refresh
    select(0)
    activate
    open
  end
This code implies that if you call setup method, it will activate and open the @actor_command_window similarly if you put @actor_command_window.open and @actor_command_window.activate which is the reason why you see no difference.

Also a side note
The line @actor_command_window.active literally does nothing on its own.
Thank a lots of your explanation, I think that I understand what you said.
And now,I want to get confirms of the below items.

1.No need to annotate the line @actor_command_window.close
2.No need to add the line @actor_command_window.active
3.No need to add the line @actor_command_window.activate

Is that right?
Is that right?
Correct
Thanks you. Have a nice day.

Original thread: https://forums.rpgmakerweb.com/threads/what-does-this-line-of-script-do.121790/