【解決済み】VXAceのようなステータス画面にしたい

アバター
アコルト
記事: 20
登録日時: 2017年2月04日(土) 02:56

【解決済み】VXAceのようなステータス画面にしたい

投稿記事by アコルト » 2019年8月29日(木) 01:17

こんばんは
使用ツールはVXのまま、VXAceのステータス画面のように下部にキャラクターについての説明書きがある配置にしたいのですが、そういったことは可能でしょうか?
スクリプト素材も探してみたのですが、なかなか思うようなものが見つかりませんでしたので投稿させて頂きました
よろしくお願いします
最後に編集したユーザー アコルト on 2020年2月21日(金) 22:25 [ 編集 1 回目 ]

昔にツクールを買ってそれきりになっているのと、
キャラのデフォルメ具合が好きで一生VXから離れられる気がしません。
現在カフェを舞台にした短編ADV、ガチャゲーRPGを鋭意制作中です(2023/08/10)
金田一光彦
記事: 33
登録日時: 2016年7月21日(木) 23:19

Re: 【VX・RGSS2】VXAceのようなステータス画面にしたい

投稿記事by 金田一光彦 » 2019年9月26日(木) 22:24

既にあるステータス画面拡張系のスクリプトから
プロフィール表示部分のみを引用してみるのはどうですか?
Code Crush様は改造物の配布も不可のため試していないのでわかりませんが
Kamesoft様の場合はある程度スクリプトの基礎知識があれば
どうにかなると思います。

こちらにKamesoft様のプロフィール部分を引用したサンプルコードを貼ります。
表示だけを試しに可能かやってみただけなので
位置やその他の設定はご自分で試すか他の方に尋ねてみてください。

コード: 全て選択

#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
# Kamesoft様の◆ 拡張ステータス画面 - KGC_ExtendedStatusScene ◆ VX ◆の
# プロフィール部分だけを引用したサンプル。未完成なのでこの様に改造して
# 完成させてください。
#==============================================================================
######################ここまでKamesoft様##########################
module CHARAPROFILE
  # ◆ プロフィール
  PROFILE = []
  # ここから下に
  #  PROFILE[アクターID] = 'プロフィール'
  # という書式で設定。
  # 改行する場合は、改行したい位置に \| を入力。
  PROFILE[1] =
    'Name: \N[1]\|' +
    '\C[2]プロフィールテスト\C[0]\|' +
    'RTPのキャラ' +
    'RUBY LOVEのRのRALPH'
      PROFILE[2] =
    'Name: \N[2]\|' +
    '\C[2]プロフィールテスト\C[0]\|' +
    'RTPのキャラ' +
    'RUBY LOVEのUのURLIKA'
      PROFILE[3] =
    'Name: \N[3]\|' +
    '\C[2]プロフィールテスト\C[0]\|' +
    'RTPのキャラ' +
    'RUBY LOVEのBのBENETT'
      PROFILE[4] =
    'Name: \N[4]\|' +
    '\C[2]プロフィールテスト\C[0]\|' +
    'RTPのキャラ' +
    'RUBY LOVEのYのYLVAスペルあってる?'
  end
######################ここまでKamesoft様##########################
class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 544, 416)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 128, 0)
    draw_actor_face(@actor, 8, 32)
    draw_basic_info(128, 32)
    draw_parameters(32, 160)
    draw_exp_info(288, 32)
    draw_equipments(288, 160)
    draw_profile(0, 0)         #プロフィール。変更しても位置は変わりません。
  end
  #--------------------------------------------------------------------------
  # ● 基本情報の描画
  #     x : 描画先 X 座標
  #     y : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_basic_info(x, y)
    draw_actor_level(@actor, x, y + WLH * 0)
    draw_actor_state(@actor, x, y + WLH * 1)
    draw_actor_hp(@actor, x, y + WLH * 2)
    draw_actor_mp(@actor, x, y + WLH * 3)
  end
  #--------------------------------------------------------------------------
  # ● 能力値の描画
  #     x : 描画先 X 座標
  #     y : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_parameters(x, y)
    draw_actor_parameter(@actor, x, y + WLH * 0, 0)
    draw_actor_parameter(@actor, x, y + WLH * 1, 1)
    draw_actor_parameter(@actor, x, y + WLH * 2, 2)
    draw_actor_parameter(@actor, x, y + WLH * 3, 3)
  end
  #--------------------------------------------------------------------------
  # ● 経験値情報の描画
  #     x : 描画先 X 座標
  #     y : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_exp_info(x, y)
    s1 = @actor.exp_s
    s2 = @actor.next_rest_exp_s
    s_next = sprintf(Vocab::ExpNext, Vocab::level)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal)
    self.contents.draw_text(x, y + WLH * 2, 180, WLH, s_next)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y + WLH * 1, 180, WLH, s1, 2)
    self.contents.draw_text(x, y + WLH * 3, 180, WLH, s2, 2)
  end
  ######################ここからKamesoft様引用##########################
  #--------------------------------------------------------------------------
  # ○ プロフィール描画
  #--------------------------------------------------------------------------
  def draw_profile(x, y)
    profile = CHARAPROFILE::PROFILE[@actor.id]
    return if profile == nil

    self.contents.font.color = normal_color
    profile.split(/\\\|/).each_with_index { |line, i|
      draw_profile_text(0, WLH * i, line)
    }
  end
  #--------------------------------------------------------------------------
  # ○ プロフィールテキスト描画
  #     x, y : 描画先座標
  #     text : 描画テキスト
  #--------------------------------------------------------------------------
  def draw_profile_text(x, y, text)
    buf = convert_special_characters(text)
    while (c = buf.slice!(/./m)) != nil
      case c
      when "\x01"                       # \C[n]  (文字色変更)
        buf.sub!(/\[(\d+)\]/, "")
        contents.font.color = text_color($1.to_i)
        next
      when "\x02"                       # \G  (所持金表示)
        n  = $game_party.gold.to_s
        cw = contents.text_size(n).width
        contents.draw_text(x, y, cw + 8, WLH, n)
        x += cw
      else                              # 普通の文字
        contents.draw_text(x, y, 40, WLH, c)
        x += contents.text_size(c).width
      end
    end
    contents.font.color = normal_color
  end
  #--------------------------------------------------------------------------
  # ○ 特殊文字の変換
  #     text : 変換対象テキスト 
  #--------------------------------------------------------------------------
  def convert_special_characters(text)
    buf = text.dup
    buf.gsub!(/\\V\[(\d+)\]/i) { $game_variables[$1.to_i] }
    buf.gsub!(/\\V\[(\d+)\]/i) { $game_variables[$1.to_i] }
    buf.gsub!(/\\N\[(\d+)\]/i) { $game_actors[$1.to_i].name }
    buf.gsub!(/\\C\[(\d+)\]/i) { "\x01[#{$1}]" }
    buf.gsub!(/\\G/)           { "\x02" }
    buf.gsub!(/\\\\/)          { "\\" }
    return buf
  end
  ######################ここまでKamesoft様##########################
  #--------------------------------------------------------------------------
  # ● 装備品の描画
  #     x : 描画先 X 座標
  #     y : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_equipments(x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
    for i in 0..4
      draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1))
    end
  end
end
アバター
アコルト
記事: 20
登録日時: 2017年2月04日(土) 02:56

Re: 【VX・RGSS2】VXAceのようなステータス画面にしたい

投稿記事by アコルト » 2020年2月21日(金) 22:24

金田一様ありがとうございました、これにて解決済みとさせて頂きます
昔にツクールを買ってそれきりになっているのと、
キャラのデフォルメ具合が好きで一生VXから離れられる気がしません。
現在カフェを舞台にした短編ADV、ガチャゲーRPGを鋭意制作中です(2023/08/10)

“VX / Ace:質問” へ戻る