Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Removing Party Command window

I would like to skip the Party Command window at the start of each turn in a battle, (The one that says "Fight" and "Escape") and also add an escape command to the Actor Command windows. However, I'm also using an icon commands script, and need the new escape command to be compatible with it.
Screen shots:
About what it should look like: link
The icon command script I'm using:
Code:
###################################################

# Idea Cntest Command Window

#

# In place of the command window which appears in while fighting

# It reaches the point where the window which arranges the idea contest is indicated.

# As for the idea contest picture being to have searched from the idea contest folder of ツクール

# When you prepare the picture by your, with ツクール please import in the idea contest.

#

# 2005.8.15 バグ修正

# When fighting and thrust, correcting the fact that the instant idea contest is indicated on the left.

#

# 2006.2.17

# Way enlargement reduction function can be set in detail.

 

if true  #  <- In one for debugging true validity, with false invalidity

 

module Momo_IconCommand

  # Idea contest file name setting

  ATTACK_ICON_NAME = "001-Weapon01" # Attack

  SKILL_ICON_NAME = "044-Skill01"   # Skill

  GUARD_ICON_NAME = "009-Shield01"  # Defense

  ITEM_ICON_NAME = "032-Item01"     # Item

  # X coordinate revision of window

  X_PLUS = -45

  # Y-coordinate revision of window

  Y_PLUS = -85

  # Operation at time of idea contest selection

  # 0: Flash 1: Enlargement

  SELECT_TYPE = 0

  # Color at time of flash

  FLASH_COLOR = Color.new(255, 255, 255, 128)

  # The time when you spend on the flash (the frame)

  FLASH_DURATION = 10

  # The flash the interval which is done (the frame)

  FLASH_INTERVAL = 20

 

  ZOOM_MAX = 1.5      # Maximum magnification ratio (1.0 or more)

  ZOOM_MIN = 1.0      # The smallest magnification ratio (1.0 or less)

  ZOOM_INTERVAL1 = 4  # Identical dimensions -> the number of frames which are bet on maximum magnification ratio

  ZOOM_INTERVAL2 = 4  # Maximum magnification ratio -> the number of frames which are bet on this time

  ZOOM_INTERVAL3 = 4  # Identical dimensions -> the number of frames which are bet on the smallest magnification ratio

  ZOOM_INTERVAL4 = 4  # The smallest magnification ratio -> the number of frames which are bet on this time

  ZOOM_TYPE = true   # If enlargement -> reduction if true and reduction -> enlargement false

 

  # Whether or not the command character string is indicated

  COM_NAME_DROW = true

  # Whether or not the character string is let flow

  COM_NAME_MOVE = true

  # The character string which it indicates

  ATTACK_NAME = "Attack"    # Attack

  SKILL_NAME = "Skill"   # Skill

  GUARD_NAME = "Defend"     # Defense

  ITEM_NAME = "Item"  # Item

  # Character string color

  COM_NAME_COLOR = Color.new(255, 255, 255, 255)

  # Coordinate revision in command character string

  COM_NAME_X_PLUS = 20

  COM_NAME_Y_PLUS = 0

end

 

class Window_CommandIcon < Window_Selectable

  attr_accessor :last_index

  #--------------------------------------------------------------------------

  # ● Object initialization

  #--------------------------------------------------------------------------

  def initialize(x, y, commands)

    super(x, y, 32, 32)

    # Appointing the null line to the window skin, try not to draw the window

    self.windowskin = RPG::Cache.windowskin("")

    @item_max = commands.size

    @commands = commands

    @column_max = commands.size

    @index = 0

    @last_index = nil

    @name_sprite = nil

    @sprite = []

    refresh

  end

  def dispose

    super

    for sprite in @sprite

      sprite.dispose unless sprite.nil?

    end

    @name_sprite.dispose unless @name_sprite.nil?

  end

  #--------------------------------------------------------------------------

  # ● Refreshment

  #--------------------------------------------------------------------------

  def refresh

    @name_sprite.dispose unless @name_sprite.nil?

    for sprite in @sprite

      sprite.dispose unless sprite.nil?

    end

    @name_sprite = nil

    draw_com_name if Momo_IconCommand::COM_NAME_DROW

    @sprite = []

    for i in 0...@item_max

      draw_item(i)

    end

  end

  #--------------------------------------------------------------------------

  # ● Drawing of item

  #--------------------------------------------------------------------------

  def draw_item(index)

    @sprite[index] = Sprite_Icon.new(nil, @commands[index])

    @sprite[index].z = self.z + 1

  end

  def draw_com_name

    @name_sprite = Sprite_Comm_Name.new(nil, get_com_name)

   

  end

 

  # æ›´æ–°

  def update

    super

    icon_update

    com_name_update if Momo_IconCommand::COM_NAME_DROW

    if move_index?

      @last_index = self.index

    end

  end

  # Renewal of idea contest

  def icon_update

    for i in [email=0...@sprite.size]0...@sprite.size[/email]

      @sprite[i].active = (self.index == i)

      @sprite[i].x = self.x + i * 24

      @sprite[i].y = self.y + 0

      @sprite[i].z = (self.index == i) ? self.z + 2 : self.z + 1

      @sprite[i].visible = self.visible

      @sprite[i].update

    end

  end

  # Renewal of command name

  def com_name_update

    if move_index?

      @name_sprite.name = get_com_name

    end

    @name_sprite.x = self.x - 12 + Momo_IconCommand::COM_NAME_X_PLUS

    @name_sprite.y = self.y - 40 + Momo_IconCommand::COM_NAME_Y_PLUS

    @name_sprite.z = self.z + 1

    @name_sprite.active = self.active

    @name_sprite.visible = self.visible

    @name_sprite.update

  end

  def get_com_name

    make_name_set if @name_set.nil?

    name = @name_set[self.index]

    name = "" if name.nil?

    return name

  end

  def make_name_set

    @name_set = []

    @name_set[0] = Momo_IconCommand::ATTACK_NAME

    @name_set[1] = Momo_IconCommand::SKILL_NAME

    @name_set[2] = Momo_IconCommand::GUARD_NAME

    @name_set[3] = Momo_IconCommand::ITEM_NAME

  end

  def move_index?

    return self.index != @last_index

  end

  def need_reset

    @name_sprite.need_reset = true if Momo_IconCommand::COM_NAME_DROW

  end

end

 

# Sprite for idea contest

class Sprite_Icon < Sprite

  attr_accessor :active

  attr_accessor :icon_name

  #--------------------------------------------------------------------------

  # ● Object initialization

  #--------------------------------------------------------------------------

  def initialize(viewport, icon_name)

    super(viewport)

    @icon_name = icon_name

    @last_icon = @icon_name

    @count = 0

    @zoom_in = Momo_IconCommand::ZOOM_TYPE

    self.bitmap = RPG::Cache.icon(@icon_name)

    self.ox = self.bitmap.width / 2

    self.oy = self.bitmap.height / 2

    @active = false

  end

  #--------------------------------------------------------------------------

  # ● Release

  #--------------------------------------------------------------------------

  def dispose

    if self.bitmap != nil

      self.bitmap.dispose

    end

    super

  end

  #--------------------------------------------------------------------------

  # ● Frame renewal

  #--------------------------------------------------------------------------

  def update

    super

    if @icon_name != @last_icon

      @last_icon = @icon_name

      self.bitmap = RPG::Cache.icon(@icon_name)

    end

    if @active

      case Momo_IconCommand::SELECT_TYPE

      when 0

        icon_flash

      when 1

        icon_zoom

      end

    else

      icon_reset

    end

  end

  def icon_flash

    if @count % Momo_IconCommand::FLASH_INTERVAL == 0 or @count == 1

      self.flash(Momo_IconCommand::FLASH_COLOR, Momo_IconCommand::FLASH_DURATION)

    end

    @count += 1

  end

  # Enlargement reduction

  def icon_zoom

    if @zoom_in

      interval1 = Momo_IconCommand::ZOOM_INTERVAL1

      interval2 = Momo_IconCommand::ZOOM_INTERVAL2

      zoom_max = Momo_IconCommand::ZOOM_MAX

      zoom_in(zoom_max, interval1, interval2)

    else

      interval1 = Momo_IconCommand::ZOOM_INTERVAL3

      interval2 = Momo_IconCommand::ZOOM_INTERVAL4

      zoom_min = Momo_IconCommand::ZOOM_MIN

      zoom_out(zoom_min, interval1, interval2)

    end

    @count += 1

    if @count >= interval1 + interval2

      @count = 0

      @zoom_in ^= true

    end

  end

  # Enlargement processing

  def zoom_in(zoom_max, interval1, interval2)

    if interval1 >= @count

      zoom = 1.0 + (zoom_max - 1.0) * (1.0 * @count / interval1)

    else

      zoom = zoom_max - (zoom_max - 1.0) * (1.0 * (@count - interval1) / interval2)

    end

    self.zoom_x = zoom

    self.zoom_y = zoom

  end

  # Reduction processing

  def zoom_out(zoom_min, interval1, interval2)

    if interval1 >= @count

      zoom = 1.0 - (1.0 - zoom_min) * (1.0 * @count / interval1)

    else

      zoom = zoom_min + (1.0 - zoom_min) * (1.0 * (@count - interval1) / interval2)

    end

    self.zoom_x = zoom

    self.zoom_y = zoom

  end

  def icon_zoom000

    case @count

    when 1..10

      zoom = 1.0 + @count / 10.0

    when 11..20

      zoom = 2.0 - (@count - 10) / 10.0

    end

    self.zoom_x = zoom

    self.zoom_y = zoom

  end

  def icon_reset

    @count = 0

    self.zoom_x = 1.0

    self.zoom_y = 1.0

  end

end

 

# Sprite for command name

class Sprite_Comm_Name < Sprite

  attr_accessor :active

  attr_accessor :name

  attr_accessor :need_reset

  #--------------------------------------------------------------------------

  # ● Object initialization

  #--------------------------------------------------------------------------

  def initialize(viewport, name)

    super(viewport)

    @name = name

    @last_name = nil

    @count = 0

    @x_plus = 0

    @opa_plus = 0

    @need_reset = false

    @active = false

    self.bitmap = Bitmap.new(160, 32)

  end

  #--------------------------------------------------------------------------

  # ● Release

  #--------------------------------------------------------------------------

  def dispose

    if self.bitmap != nil

      self.bitmap.dispose

    end

    super

  end

  #--------------------------------------------------------------------------

  # ● Frame renewal

  #--------------------------------------------------------------------------

  def update

    super

    if @active

      if need_reset?

        @need_reset = false

        @last_name = @name

        text_reset

      end

      move_text if Momo_IconCommand::COM_NAME_MOVE

    end

  end

  def move_text

    @count += 1

    @x_plus = [@count * 8, 80].min

    self.x = self.x - 80 + @x_plus

    self.opacity = @count * 25

  end

  def text_reset

    @count = 0

    @x_plus = 0

    self.bitmap.clear

    self.bitmap.font.color = Momo_IconCommand::COM_NAME_COLOR

    self.bitmap.draw_text(0, 0, 160, 32, @name)

  end

  def need_reset?

    return (@name != @last_name or @need_reset)

  end

end

 

class Scene_Battle

  #--------------------------------------------------------------------------

  # ● Pre- battle phase start

  #--------------------------------------------------------------------------

  alias scene_battle_icon_command_start_phase1 start_phase1

  def start_phase1

    com1 = Momo_IconCommand::ATTACK_ICON_NAME

    com2 = Momo_IconCommand::SKILL_ICON_NAME

    com3 = Momo_IconCommand::GUARD_ICON_NAME

    com4 = Momo_IconCommand::ITEM_ICON_NAME

    @actor_command_window = Window_CommandIcon.new(0, 0, [com1, com2, com3, com4])

    @actor_command_window.y = 160

    @actor_command_window.back_opacity = 160

    @actor_command_window.active = false

    @actor_command_window.visible = false

    @actor_command_window.update

    scene_battle_icon_command_start_phase1

  end

  #--------------------------------------------------------------------------

  # ● Setup of actor command window

  #--------------------------------------------------------------------------

  alias scene_battle_icon_command_phase3_setup_command_window phase3_setup_command_window

  def phase3_setup_command_window

    scene_battle_icon_command_phase3_setup_command_window

    # Setting the position of the actor command window

    @actor_command_window.x = command_window_actor_x(@actor_index)

    @actor_command_window.y = command_window_actor_y(@actor_index)

    @actor_command_window.need_reset

  end

  def command_window_actor_x(index)

    $game_party.actors[index].screen_x + Momo_IconCommand::X_PLUS

  end

  def command_window_actor_y(index)

    $game_party.actors[index].screen_y + Momo_IconCommand::Y_PLUS

  end

end

end

 
I'm not using an SDK, so please make sure that the script will work without one.

Thank you for your time, and thanks in advance if you're willing to help me.
 
It's momomomo? Icon Command window, right?

To add command - XRXS Lib7:
Code:
 

# ▽△▽ XRXS. コマンドウィンドウ追加機構 ▽△▽

# by 桜雅 在土

 

#==============================================================================

# --- XRXS.コマンドウィンドウ追加機構 ---

#==============================================================================

module XRXS_Window_Command

  #--------------------------------------------------------------------------

  # ○ コマンドを追加

  #--------------------------------------------------------------------------

  def add_command(command)

    #

    # 初期化されていない場合、無効化判別用の配列 @disabled の初期化

    #

    @disabled = [] if @disabled.nil?

    if @commands.size != @disabled.size

      for i in 0...@commands.size

        @disabled[i] = false

      end

    end

    #

    # 追加

    #

    @commands.push(command)

    @disabled.push(false)

    @item_max = @commands.size

    self.y -= 32

    self.height += 32

    self.contents.dispose

    self.contents = nil

    self.contents = Bitmap.new(self.width - 32, @item_max * 32)

    refresh

    for i in 0...@commands.size

      if @disabled[i]

        disable_item(i)

      end

    end

  end

  #--------------------------------------------------------------------------

  # ○ 項目の無効化

  #     index : 項目番号

  #--------------------------------------------------------------------------

  def disable_item(index)

    @disabled = [] if @disabled.nil?

    @disabled[index] = true

    draw_item(index, disabled_color)

  end

  #--------------------------------------------------------------------------

  # ○ 項目の有効化

  #     index : 項目番号

  #--------------------------------------------------------------------------

  def enable_item(index)

    @disabled = [] if @disabled.nil?

    @disabled[index] = false

    draw_item(index, normal_color)

  end

end

class Window_Command < Window_Selectable

  #--------------------------------------------------------------------------

  # ○ インクルード

  #--------------------------------------------------------------------------

  include XRXS_Window_Command

  #--------------------------------------------------------------------------

  # ● 項目の無効化

  #--------------------------------------------------------------------------

  def disable_item(index)

    super

  end

end

 

And compatibility script for this and momomomo? Icon Command Window can be found here: http://members.at.infoseek.co.jp/Tetra_ ... d_co_x.htm

To add Escape command(I butchered XRXS65...XD), like:
Code:
 

class Scene_Battle

  alias xrxs65_start_phase1 start_phase1

  def start_phase1

    # 呼び戻す

    xrxs65_start_phase1

    @cp_escape_actor_command_index = @actor_command_window.height/32 - 1

    # アクターコマンドウィンドウに追加

    @actor_command_window.add_command("Run")

    if !$game_temp.battle_can_escape

      @actor_command_window.disable_item(@cp_escape_actor_command_index)

    end

  end

  #--------------------------------------------------------------------------

  # ● パーティコマンドフェーズ開始

  #--------------------------------------------------------------------------

  alias xrxs65_start_phase2 start_phase2

  def start_phase2

    # 呼び戻す

    xrxs65_start_phase2

    # パーティコマンドウィンドウを無効化

    @party_command_window.active  = false

    @party_command_window.visible = false

    # 強制的にフェイズ 2 を保持

    @phase = 2

  end

  #--------------------------------------------------------------------------

  # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)

  #--------------------------------------------------------------------------

  alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command

  def update_phase3_basic_command

    # C ボタンが押された場合

    if Input.trigger?(Input::C)

      # アクターコマンドウィンドウのカーソル位置で分岐

      case @actor_command_window.index

      when @cp_escape_actor_command_index # 逃げる

        if $game_temp.battle_can_escape

          # 決定 SE を演奏

          $game_system.se_play($data_system.decision_se)

          # アクションを設定

          @active_battler.current_action.kind = 0

          @active_battler.current_action.basic = 4

          # 次のアクターのコマンド入力へ

          phase3_next_actor

        else

          # ブザー SE を演奏

          $game_system.se_play($data_system.buzzer_se)

        end

        return

      end

    end

    # 呼び戻す

    xrxs_bsp1_update_phase3_basic_command

  end

  #--------------------------------------------------------------------------

  # ● 基本アクション 結果作成

  #--------------------------------------------------------------------------

  alias xrxs65_make_basic_action_result make_basic_action_result

  def make_basic_action_result

    # 呼び戻す

    xrxs65_make_basic_action_result

    # 防御の場合

    if @active_battler.current_action.basic == 1

      @active_battler.guarding = true

      return

    end

    # パーティの逃亡の場合

    if @active_battler.current_action.basic == 4

      # 逃走可能ではない場合

      if $game_temp.battle_can_escape == false

        # ブザー SE を演奏

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      # 逃走処理

      update_phase2_escape

      return

    end

  end

  .......

end

 

You'll need some work to make it work. Above code is just exerpt from XRXS65: CP Battle system, so I'm not sure it will work.

**Geez, looks like it requires more work than I thought.

**Oh, well.. It's compatibility patch for Icon Command Window and XRXS65: http://members.at.infoseek.co.jp/Tetra_ ... xrxs65.htm
However, I can't make 'Run' command icon show when I added all these scripts(Icon Command + XRXS65 + Compatibility Patches).
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top