질문과 답변

Extra Form

대략 밑의 그림 같은 느낌으로 만들어 졌으면 합니다.

일본쪽 사이트에서 이렇게 해주는 스크립트를 찾긴 했는데 뭔가 꼬인건지 적용이 안되더라구요;;

 해결 부탁드립니다!^^;;

대략 밑의 그림 같은 느낌으로 만들어 졌으면 합니다.

일본쪽 사이트에서 이렇게 해주는 스크립트를 찾긴 했는데 뭔가 꼬인건지 적용이 안되더라구요;;

サンプル

이하 사용해본 스크립트입니다

#==============================================================================
# ■ VX-RGSS-26 ファイル画面-改 [Ver.1.0.0]            by Claimh
#------------------------------------------------------------------------------
# ファイル画面を改変します。
#【変更点】
# ・ファイル構成変更(FileHader化)
# ・現在位置表示追加
# ・顔グラフィック描画追加
#==============================================================================

module SaveEx
  # 顔グラフィックで表示
  USE_FACE = true

  # 現在地の表示
  MAP_NAME = true
  # ツリーの親のマップ名を使用する
  BASE_NAME = true
end

#==============================================================================
# ■ Game_Map 拡張メソッド
#==============================================================================
class Game_Map
  #--------------------------------------------------------------------------
  # ● マップ名取得
  #--------------------------------------------------------------------------
  def map_name
    mapInfo = load_data(sprintf("Data/MapInfos.rvdata"))
    return mapInfo[@map_id].name
  end
  #--------------------------------------------------------------------------
  # ● 親マップID取得
  #--------------------------------------------------------------------------
  def parent_id
    mapInfo = load_data(sprintf("Data/MapInfos.rvdata"))
    return mapInfo[@map_id].parent_id
  end
  #--------------------------------------------------------------------------
  # ● 大元の親マップID取得
  #--------------------------------------------------------------------------
  def base_parent_id
    mapInfo = load_data(sprintf("Data/MapInfos.rvdata"))
    return search_parent_id(mapInfo)
  end
  def search_parent_id(mapInfo)
    m_id = @map_id
    loop do
      p_id = mapInfo[m_id].parent_id
      return m_id if p_id == 0
      m_id = p_id
    end
  end
  #--------------------------------------------------------------------------
  # ● 大元の親マップ名取得
  #--------------------------------------------------------------------------
  def base_map_name
    mapInfo = load_data(sprintf("Data/MapInfos.rvdata"))
    return mapInfo[search_parent_id(mapInfo)].name
  end
end


#==============================================================================
# ■ FileHeader  : セーブファイルヘッダ
#==============================================================================
class FileHeader
  attr_reader :characters       # キャラクター
  attr_reader :faces            # 顔グラフィック
  attr_reader :map_name         # マップ名
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    @characters = []
    @faces = []
    for actor in $game_party.members
      @characters.push([actor.character_name, actor.character_index])
      @faces.push([actor.face_name, actor.face_index])
    end
    @map_name = SaveEx::BASE_NAME ? $game_map.base_map_name : $game_map.map_name
  end
end

#==============================================================================
# ■ Window_SaveFile
#==============================================================================
class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :filename                 # ファイル名
  attr_reader   :file_exist               # ファイル存在フラグ
  attr_reader   :time_stamp               # タイムスタンプ
  attr_reader   :selected                 # 選択状態
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     file_index : セーブファイルのインデックス (0~3)
  #     filename   : ファイル名
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 56 + file_index % 4 * 90, 544, 90)
    @file_index = file_index
    @filename = filename
    load_gamedata
    refresh
    @selected = false
  end
  #--------------------------------------------------------------------------
  # ● ゲームデータの一部をロード
  #    スイッチや変数はデフォルトでは未使用 (地名表示などの拡張用) 。
  #--------------------------------------------------------------------------
  def load_gamedata
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      begin
        @header         = Marshal.load(file)
        @frame_count    = Marshal.load(file)
        @last_bgm       = Marshal.load(file)
        @last_bgs       = Marshal.load(file)
        @game_system    = Marshal.load(file)
        @game_message   = Marshal.load(file)
        @game_switches  = Marshal.load(file)
        @game_variables = Marshal.load(file)
        @total_sec = @frame_count / Graphics.frame_rate
      rescue
        @file_exist = false
      ensure
        file.close
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = Vocab::File + " #{@file_index + 1}"
    self.contents.draw_text(4, 0, 200, WLH, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      SaveEx::USE_FACE ? draw_party_faces(100, -10) : draw_party_characters(152, 58)
      self.contents.draw_text(320-16, 0, 200, WLH, @header.map_name, 2) if SaveEx::MAP_NAME
      draw_playtime(0, 34, contents.width - 4, 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● パーティキャラの描画
  #     x : 描画先 X 座標
  #     y : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_party_characters(x, y)
    for i in 0...@header.characters.size
      name = @header.characters[i][0]
      index = @header.characters[i][1]
      draw_character(name, index, x + i * 48, y)
    end
  end
  #--------------------------------------------------------------------------
  # ● パーティキャラの描画
  #     x : 描画先 X 座標
  #     y : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_party_faces(x, y)
    for i in 0...@header.faces.size
      name = @header.faces[i][0]
      index = @header.faces[i][1]
      draw_face(name, index, x + i * 90, y) # 4人以上だと文字とかぶる…
    end
  end
end


#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     saving     : セーブフラグ (false ならロード画面)
  #     from_title : タイトルの「コンティニュー」で呼び出されたフラグ
  #     from_event : イベントの「セーブ画面の呼び出し」で呼び出されたフラグ
  #--------------------------------------------------------------------------
  def initialize(saving, from_title, from_event, menu_index=4)
    @saving = saving
    @from_title = from_title
    @from_event = from_event
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● 元の画面へ戻る
  #--------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(@menu_index)
    end
  end
  #--------------------------------------------------------------------------
  # ● セーブデータの書き込み
  #     file : 書き込み用ファイルオブジェクト (オープン済み)
  #--------------------------------------------------------------------------
  def write_save_data(file)
    header = FileHeader.new
    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump(header,               file)
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm,            file)
    Marshal.dump(@last_bgs,            file)
    Marshal.dump($game_system,         file)
    Marshal.dump($game_message,        file)
    Marshal.dump($game_switches,       file)
    Marshal.dump($game_variables,      file)
    Marshal.dump($game_self_switches,  file)
    Marshal.dump($game_actors,         file)
    Marshal.dump($game_party,          file)
    Marshal.dump($game_troop,          file)
    Marshal.dump($game_map,            file)
    Marshal.dump($game_player,         file)
  end
  #--------------------------------------------------------------------------
  # ● セーブデータの読み込み
  #     file : 読み込み用ファイルオブジェクト (オープン済み)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    header               = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system         = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches       = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors         = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player         = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
end

 

이걸 사용해서 타이틀 메뉴의 이어하기를 누르면

Script 'save' line 169: NoMethodError occured

undefind method 'faces' for # <Array :0x189d308>

위의 경고문이 뜨며 에러가 납니다

 

으윽...좀 도와주세요..

스크립트에서 어디가 에러 났는지, 혹은 아예 그냥 페이스를 넣는 법을 새로 가르쳐주시면 감사하겠습니다..

 

 

 

Comment '4'
  • profile
    습작 2013.04.11 13:19

    답변자에 입장에서 다소 많이 부족한 질문이 아닌가 싶습니다. 일단 그 구하셨다는 스크립트가 어떤 것인지 알 수 없으며, 그 스크립트를 어떻게 답변자가 구해서 살펴봐야 할지도 알수 없고, 문제가 생긴 질문자님의 프로젝트 상태가 어떻길래 멀쩡한 스크립트가 제대로 작동하지 않는 것인지도 알 수 없습니다.


    1. 사용하신 스크립트 이름

    2. 사용하신 스크립트

    3. 문제가 생긴 프로젝트


    위 세가지에 대해서 보다 추가적인 설명과 자료를 추가하시길 권장합니다.^^

  • ?
    야나기 2013.04.11 13:26
    아...그렇군요. 저는 꼭 그 스크립트를 고쳐달라는 뜻이 아니라 그 스크립트가 안되니까 어떤식으로 페이스를 넣으면 되는가가 질문의 요지 였는데 말이죠;; 질문을 너무 간단하게 하여 제 문장 전달력이 딸렸던 것 같습니다; 일단 스크립트와 어떤 식으로 오류가 나는지 올려두기는 하겠습니다
  • profile
    습작 2013.04.11 14:01
    올려주신 그 스크립트... 잘 작동하네요. 멀쩡한 스크립트입니다. 혹시나 다른 스크립트들과의 사이에서 문제가 생긴 것일 수도 있습니다. 본인의 프로젝트를 살펴보시길 권장합니다.
  • ?
    야나기 2013.04.11 19:58
    아, 문제 해결했습니다. 원래 있던 세이브 파일과 충돌해서 그렇더군요...원래 있던 세이브 파일 지우고 넣어 봤더니 되었습니다. 감사합니다;;

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12393
RMVXA 문장,대화 관련 3 멘마 2013.08.12 826
RMVX 세이브 메뉴에 캐릭터 페이스를 넣고 싶습니다 4 야나기 2013.04.11 826
RMVXA 액터 그래픽 변경 투명해지는 현상 4 xzrjs 2012.11.10 826
RMVX 안녕하세요 질문있습니다. 4 조글링 2011.01.11 826
RMVX [ Vx Vampyr SBABS ] 액알 스크립트에 관해!!!!! 3 히트맨 2010.12.17 826
RMXP 커맨드 관련 질문인데요,, 3 코아 코스튬 2010.10.23 826
RMVX 타이머 시간을 늘려주려고 하면 어떻게 해야하나요? 3 젯젯 2010.09.23 826
RMXP 선택지의 갯수를 늘릴 수 있나요? 2 shsQk 2014.01.27 825
RMXP 애니메이션을 이미지로 만들고 싶습니다 5 file 이룩 2014.01.21 825
RMVXA 모션을 취하는 캐릭터 칩은 어떻게 만드나요? 크로마티안 2014.01.18 825
RMVX vx 타일셋 문제입니다. 8 레모네이드립톤 2013.02.26 825
RMVX RMVX 턴알 턴 메세지 질문입니다. 1 file aeorifji 2013.03.08 825
RMXP NPC 움직임에 대해 다시 질문올려요.(엑박수정) 11 file OdahViing 2013.08.10 825
RMVXA 방금 전까지 멀쩡하던 VX Ace 툴이... 1 file 엿데브 2013.11.17 825
RMXP 투명색 제거하는 방법. 5 스카이워커 2011.02.05 825
RMXP 일러스트 대화창 1 가츄 2010.11.28 825
기타 게임 개발부터 정식 오픈까지.. Gic2000 2013.11.18 825
RMVX 맵을 전체적으로 어둡게 할 수 있을까요? 1 file 빡새 2014.06.04 825
RMXP 맵칩에 대하여 4 file 이비호 2014.05.25 824
RMVX 젤 첨에 캐릭터 선택을 넣어서 그 캐릭터 이미지에 맞게 이벤트와 대화할때 그 이미지가 나오게 하는법 2 REAL 2014.01.01 824
Board Pagination Prev 1 ... 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 ... 516 Next
/ 516