질문과 답변

Extra Form

module Vocab
  def self.formation
    '대열 변경'
  end
end
class Game_Party < Game_Unit
  def swap_order(index1, index2)
    @actors[index1], @actors[index2] = @actors[index2], @actors[index1]
    $game_player.refresh
  end
end
class Window_MenuStatus < Window_Selectable
  attr_reader   :pending_index
  def initialize(x, y)
    if $scene.is_a?(Scene_Menu)
      super(x, y, 384, 416)
    else
      super(x, y, 384, Graphics.height)
    end
    @pending_index = -1
    refresh
    self.opacity = 0
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = 4
    for i in 0...@item_max
      break if i >= $game_party.members.size
      draw_item_background(i)
        x = 0
        y = i * contents.height / @item_max
      draw_actor_face($game_party.members[i], x + 2, y + 2)
      draw_actor_name($game_party.members[i], x + 104, y + 13)
      draw_actor_class($game_party.members[i], x + 224, y + 13)
      draw_actor_level($game_party.members[i], x + 104, y + 37)
      draw_actor_state($game_party.members[i], x + 104, y + 61, 96, 24)
      draw_actor_hp($game_party.members[i], x + 224, y + 37, 120)
      draw_actor_mp($game_party.members[i], x + 224, y + 61, 120)
    end
  end
  def draw_actor_name(actor, x, y)
    self.contents.font.color = hp_color(actor)
    self.contents.draw_text(x, y, 112, 24, actor.name)
  end
  def draw_actor_class(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 112, 24, actor.class.name)
  end
  def draw_actor_level(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 24, Vocab::level_a)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 32, y, 58 - 32, 24, actor.level, 2)
  end
  def draw_actor_state(actor, x, y, width = 96, height = 24)
    count = 0
    for state in actor.states
      draw_icon(state.icon_index, x + 24 * (count % (width / 24)), y + 24 * (count / (width / 24)))
      count += 1
      break if (24 * count > width * (height/24) - 24)
    end
  end
  def draw_face(face_name, face_index, x, y, size = 96)
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * 96 + (96 - 92) / 2
    rect.y = face_index / 4 * 96 + (96 - 92) / 2
    rect.width = 92
    rect.height = 92
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    elsif @index < @item_max
      x = 0
      y = @index * contents.height / @item_max
      self.cursor_rect.set(x, y, contents.width, contents.height/@item_max)
    elsif @index >= 100
      x = 0
      y = (@index - 100) * contents.height/@item_max
      self.cursor_rect.set(x, y, contents.width, contents.height/@item_max)
    else
      self.cursor_rect.set(0, 0, contents.width, contents.height)
    end
  end
  def draw_item_background(index)
    if index == @pending_index
      contents.fill_rect(self.cursor_rect, pending_color)
    end
  end
  def pending_color
    windowskin.get_pixel(80, 80)
  end
  def pending_index=(index)
    last_pending_index = @pending_index
    @pending_index = index
    refresh
  end
end
class Window_MenuGold < Window_Base
  def initialize(x, y, width, height)
    super(x, y, width, height)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.contents.width - 8, WLH, '소지금')
    cx = contents.text_size(Vocab::gold).width
    self.contents.font.color = normal_color
    self.contents.draw_text(4, self.contents.height-WLH, self.contents.width - 8-cx-2, WLH, $game_party.gold, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(4, self.contents.height-WLH, self.contents.width - 8, WLH, Vocab::gold, 2)
  end
end
class Window_Timer < Window_Base
  def initialize(x, y, width, height)
    super(x, y, width, height)
    refresh
  end
  def update
    if @total_sec != Graphics.frame_count / Graphics.frame_rate
      refresh
    end
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.contents.width - 8, WLH, '시간')
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    time_string = sprintf('%02d:%02d:%02d', hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, self.contents.height-WLH, self.contents.width - 8, WLH, time_string, 2)
  end
end
class Window_Location < Window_Base
  def initialize(x, y, width, height)
    super(x, y, width, height)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.contents.width - 8, WLH, '위치')
    self.contents.font.color = normal_color
    map = load_data('Data/MapInfos.rvdata')
    self.contents.draw_text(4, self.contents.height-WLH, self.contents.width - 8, WLH, map[$game_map.map_id].name, 2)
  end
end
class Window_MenuCommand < Window_Command
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @commands[index], 0)
  end
end
class Scene_Menu < Scene_Base
  def start
    super
    create_menu_background
    create_background
    create_command_window
    @gold_window = Window_MenuGold.new(384, 360, 160, 56)
    @timer_window = Window_Timer.new(384, 304, 160, 56)
    @location_window = Window_Location.new(384, 248, 160, 56)
   @status_window = Window_MenuStatus.new(0, 0)
  end
  def create_background
    @menu_background = Sprite.new
    @menu_background.bitmap = Cache.system('menu_bg')
  end
  def dispose_background
    @menu_background.bitmap.dispose
    @menu_background.dispose
  end
  def terminate
    super
    dispose_menu_background
    dispose_background
    @command_window.dispose
    @gold_window.dispose
    @timer_window.dispose
    @location_window.dispose
    @status_window.dispose
  end
  def update
    super
    update_menu_background
    @command_window.update
      @gold_window.update
      @timer_window.update
      @location_window.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  def create_command_window
   @command_window = Window_MenuCommand.new(160, [Vocab::item,Vocab::skill,Vocab::equip,Vocab::status,Vocab::formation,Vocab::save,Vocab::game_end])
   @command_window.x = 384
   @command_window.y = 0
   @command_window.height = 200
    @command_window.index = @menu_index
    if $game_party.members.size == 0
     @command_window.draw_item(0, false)
     @command_window.draw_item(1, false)
     @command_window.draw_item(2, false)
     @command_window.draw_item(3, false)
    end
    if $game_party.members.size < 2
      @command_window.draw_item(4, false)
    end
    if $game_system.save_disabled
      @command_window.draw_item(5, false)
    end
  end
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and [5,6].include?(@command_window.index)
      Sound.play_buzzer
      return
    elsif $game_system.save_disabled and @command_window.index == 5
      Sound.play_buzzer
      return
    end
      Sound.play_decision
      case @command_window.index
      when 0
          $scene = Scene_Item.new
      when 1
          start_actor_selection
      when 2
          start_actor_selection
      when 3
          start_actor_selection
      when 4
          start_actor_selection
      when 5
          $scene = Scene_File.new(true, false, false)
      when 6
          $scene = Scene_End.new
    end
    end
  end
  def update_actor_selection
    if Input.trigger?(Input::B)
      if @command_window.index == 4
        if @status_window.pending_index >= 0
          @status_window.pending_index = -1
          Sound.play_cancel
        else
          Sound.play_cancel
          end_actor_selection
        end
      else
        Sound.play_cancel
        end_actor_selection
      end
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
       when 1
        $scene = Scene_Skill.new(@status_window.index)
        when 2
        $scene = Scene_Equip.new(@status_window.index)
        when 3
        $scene = Scene_Status.new(@status_window.index)
       when 4
          if @status_window.pending_index >= 0
            $game_party.swap_order(@status_window.index, @status_window.pending_index)
            @status_window.pending_index = -1
            @status_window.refresh
          else
            @status_window.pending_index = @status_window.index
          end
       end
      end
    end
  end
end
class Scene_Item < Scene_Base
  def return_scene
    $scene = Scene_Menu.new(0)
  end
end
class Scene_Skill < Scene_Base
  def return_scene
    $scene = Scene_Menu.new(1)
  end
end
class Scene_Equip < Scene_Base
  def return_scene
    $scene = Scene_Menu.new(2)
  end
end
class Scene_Status < Scene_Base
  def return_scene
    $scene = Scene_Menu.new(3)
  end
end
class Scene_End < Scene_Base
  def return_scene
    $scene = Scene_Menu.new(6)
  end
end
class Scene_File < Scene_Base
  def return_scene 
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(5)
    end
  end
end

를 했는데 계속 297번째 줄에서 syntax error가 뜨네요 뭐가 문제죠???

Comment '3'
  • profile
    습작 2015.11.01 17:34
    최근 발션된 문제 해결한다고 수정했더니 다른 곳에서 다시 문제가 생겼군요!!
    재점검하고 오류 수정되는 대로 댓글로 알려드릴게요. :)
  • profile
    습작 2015.11.01 17:50
    해당 문제되는 부분을 수정하여 버전업 하였습니다. 혹여 문제 재 발생시 피드백 부탁드립니다. :)
  • profile
    습작 2015.11.01 20:49
    새로운 버그 발견으로 인해 버전업 되었습니다. 추가적인 분제 발생시 피드백 부탁드려요. :)

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12392
기타 RMVX RPG VX로 게임에 음악넣는데 문제가생겻어요. 1 김정은죽이기게임개발자! 2019.10.02 56
RMVX RPG VX로 제작된 게임들의 배경음이 안나오네요 ehfhfh4 2014.07.24 653
RMVX RPG VX로 플레이 후 강제종료 이벤트 가능한가요? 민유일 2016.05.06 135
RMVX rpg vx를 사용하는데.. 1 배우자vx 2012.12.27 1039
액션 전투 RMVX RPG VX를 하시는 분. 제리루비 2021.07.17 86
RMVX rpg vx서 음악이 안나오면 어찌해야 하나요 4 둥글수염 2013.05.11 1532
RMVX rpg vx스크립트의 기본문법좀가르쳐주세요 2 냐catch 2012.03.25 1961
RMVX RPG VX에 개인사진, 브금 넣는법을 알고싶습니다 tmdgjs9525 2014.11.16 367
RMVX rpg vx에 대해.. 1 By카미린 2010.12.21 500
RMVX rpg vx에 대해... 1 아르케미스트 2011.01.11 700
RMVX RPG VX에서 "레벨업 퀘스트" 나 "레벨 마크" 정하는 방법 있을까여?.? 2 쿠쿠밥솥 2011.09.25 1998
RMVX RPG VX에서 몬스터칩 삽입하는 방법좀요 7 file SimSimiRPG 2013.01.16 2937
RMVX rpg vx에서 액알 가능 하나요? 4 file 사현 2014.04.12 1619
RMVX rpg vx에서 이동속도를 6보다 높게 만들고싶습니다. 1 감사,합니다 2014.01.24 1690
RMVX rpg vx에서 파일이 사라지는 현상 l아방스l 2011.09.22 1440
RMVX rpg vx타일관련해서,.. 2 file 모시코 2015.03.12 237
RMVX RPG XP에서 대화할때 사람얼굴 붙일수잇는 방법 2 순오니 2010.10.24 1769
RMVX rpg xv 질문좀 .. 1 김곶자 2011.01.06 494
RMVX RPG 개인게임 전투에서 동료가 없게 하는 방법을 알려주세요. 1 roykim09 2015.05.13 197
RMVX RPG 만들기 VX SBS 상대방도 캐릭터 그래픽으로 나타나게 하는 방법.. file 잭무기 2014.05.29 921
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 127 Next
/ 127