질문과 답변

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 12392
RMVX 비오는 효과 넣을 수 있을까요? 1 로렐 2013.04.20 748
RMVX 그래픽 소재 어떻게 넣나여 ? 4 신입생나루미 2013.04.20 792
RMVX 주인공 감추기 할 수 있을까요? 9 로렐 2013.04.20 855
RMVX 윈도우 바꾸기/소리 4 조맨나 2013.04.19 1001
RMVX 이벤트 중단좀 도와주세요 8 조맨나 2013.04.17 1180
RMVX 게임 배포할때 용량 줄이는법 6 Thyella 2013.04.17 975
RMVX 특정 맵만 스크립트를 적용 배제하는 방법 있나요? 3 늅뉴비 2013.04.17 625
RMVX 스위치를 켜야하는데 루프가 계속돌아가서 2 원숭이목욕탕 2013.04.15 883
RMVX ESC 키가 안먹네요. 4 로렐 2013.04.14 2681
RMVX 세이브 메뉴에 스크롤을 넣는 방법 야나기 2013.04.13 746
RMVX 장소이동 효과에 대해서 질문입니다 1 욕쟁이스님 2013.04.13 1254
RMVX 맵에 있는 빛줄기 효과는 어떻게 주는건가요? 5 file AQUA 2013.04.11 2142
RMVX 세이브 메뉴에 캐릭터 페이스를 넣고 싶습니다 4 야나기 2013.04.11 826
RMVX 이벤트를 한번 처리 한걸 삭제 시키고 싶은데 어떻게 해야 하나요? 4 AQUA 2013.04.11 848
RMVX 캐릭터 배치 어떻게 하나요. 2 로렐 2013.04.07 814
RMVX 화이트 페이드인, 아웃 2 Thyella 2013.04.05 1540
RMVX 버튼사용시 물건이동방법 6 레고주민 2013.03.31 969
RMVX VX에서 문장넘길때 효과음 넣고 싶은데 어떻게 하나요? 1 메로메로 2013.03.30 637
RMVX RPGVX 에서 캐릭터를 타일칩의 남쪽에 붙이고 싶습니다. 2 file 해크드 2013.03.29 1293
RMVX RVDATA2 파일은 어떤 프로그램으로 열어야하나요? 2 글쓰니안쓰니 2013.03.28 10132
Board Pagination Prev 1 ... 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 ... 127 Next
/ 127