질문과 답변

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 12391
기타 대사 밀림 해결방법 1 file ktxz999 2013.04.02 1075
RMVXA 커맨드 입력받아서 그림 삭제하기 2 IZEN 2013.04.02 943
RMVXA 캐릭터를 따라가는 화면 이동.. 1 file yellowcat 2013.04.03 1147
RMVXA 요 문장을 출력하는 메세지 바 색 어찌 바꾸나요? 1 file 타락한마왕 2013.04.03 1053
RMVXA 전투 방식 2 file 빵씨 2013.04.03 1396
RMXP RPGXP, F1을 누르면 이상한 언어가 나옵니다 4 file 에이미 2013.04.04 1235
RMVXA 그림이 표시된후 사라지게 하고 싶은데... 3 IZEN 2013.04.04 967
RPG만들기중 테이터베이스 한글화 적용하면 캐릭터가 사라지네요; 1 짜농 2013.04.05 827
RMVX 화이트 페이드인, 아웃 2 Thyella 2013.04.05 1540
RMXP 이건..왜..저만 튕기죠... 3 file 구름인간 2013.04.05 808
RMVXA 타이틀화면 나오기전에 동영상재생 문제질문요.. 4 윌리웡기 2013.04.06 998
RMVXA vxace 대쉬시 달리기모션.. 8 yellowcat 2013.04.07 1574
RMVX 캐릭터 배치 어떻게 하나요. 2 로렐 2013.04.07 814
RM2k3 RPG2003을 시작하면 검은색 맵 [아무것도 없는]만 보입니다. 1 엑스트라 2013.04.08 1592
RMVXA 프로세스 인식 스크립트가 궁금합니다 mona 2013.04.08 980
RMVXA 요즘 혜성 같이 나타난 RPG VX ACE 치트오메틱에 대해서입니다. 1 g223k 2013.04.10 11965
RMXP 상점 처리할때요, 플레이어가 특정 아이템만 팔 수 있도록 지정하는법좀.. 스크립트라도.. 1 팅코 2013.04.10 856
RMVXA 아이템 설명은 3줄 이상 못늘리나요? IZEN 2013.04.11 763
RMVX 이벤트를 한번 처리 한걸 삭제 시키고 싶은데 어떻게 해야 하나요? 4 AQUA 2013.04.11 848
RMVX 세이브 메뉴에 캐릭터 페이스를 넣고 싶습니다 4 야나기 2013.04.11 826
Board Pagination Prev 1 ... 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 ... 516 Next
/ 516