질문과 답변

Extra Form

하다가 막힌부분이있어서 질문올려봅니다.

일단 제나름대로 생각은

QUESTS[1] = ['나를 위해 꽃을!',2,3,false]

의 퀘스트에서 2는 2번변수를 뜻하고 2번변수가 1이되면 퀘스트가 발생이고

2가되면 퀘스트가 완료됫다는 뜻인거 같습니다,

 

그런데 아무리 생각해도

QUESTS[1] = ['나를 위해 꽃을!',2,3,false]

에서 3이

있고 없고의 차이를 모르겟습니다 .

  

데모게임에서는 꽃을 획득할때마다 직접 카운트를 올려줫는데

몬스터를 잡을시에 일정확률로 나오는 아이템을 몇개 가져오라는 퀘스트는 어떻게 만들어야할까요?

제가 추측한 생각과 3이 의미하는것을 자세히 알려주시는 답변달아주시면 정말 감사하겟습니다

 

 

아래는 그 스크립트 입니다

# =============================================================================
#                Extended Omegas7's Ultimate Quest System Script.
# =============================================================================
#   Author: Leo (Original author: Omegas7)
#   Version: 1.1
#   Omega7's Site: baseomega.forumer.com
# =============================================================================
#   [오메가 퀘스트 확장판_패치 ver. 1.1 update:10.09.26]
# =============================================================================
#      > 수주한 퀘스트가 특정 갯수를 넘어가면 스크롤이 되지 않고
#         화면에서 글자가 잘리는 현상 수정
# =============================================================================
#   [오메가 퀘스트 확장판 ver. 1.0]
# =============================================================================
#   추가된 사항:
#      > Background 및 HUD 이미지를 사용하지 않음
#      > 필수퀘스트/일반퀘스트 구분 가능 (필수퀘스트 주황색, 일반퀘스트 흰색)
#      > [퀘스트 포기하기] 기능 추가 (필수퀘스트는 포기할 수 없음)
#      > 퀘스트 포기시 자동적으로 변수값 해제
#
# =============================================================================
#   [오메가 퀘스트 ver. 3.0] 특징 및 소개
# =============================================================================
#   특징:
#     > 간단한 스크립트 작성으로 퀘스트 생성 가능
#     > 스위치를 이용하지 않고 변수를 이용하는 시스템
#     > 각 퀘스트에 대한 상세내용 표시 기능.
#     > 퀘스트 내용에 변수값 표시 가능
#     > 퀘스트 완료시 자동적으로 [퀘스트 완료]에 내용 표시
#     > 글자 크기 조절 가능
# =============================================================================
#   사용법:   (처음이세요? 꼭 읽어보세요^^)
#
#     퀘스트를 생성하기 위해 다음의 3가지만 작성하시면 됩니다.
#
#     QUESTS[ID] = ['Name',VAR,QVAR,type]
#     TASKS[ID] = ['Do this','And this','And this']
#     DESCRIPTIONS[ID] = ['This is an awesome','quest for noobs']
#
#     ID : 퀘스트  ID (0부터 순서대로 증가시키면 됩니다)
#     'Name' : 퀘스트 제목을 입력합니다. 반드시 작은 따옴포 ''로 묶어주세요
#     VAR     : 변수 ID를 설정합니다. 이 변수값으로 퀘스트의 진행을 제어합니다.
#     QVAR   : 퀘스트에 사용하는 변수 ID를 설정합니다.
#                  사용하지 않을 경우 nil을 입력합니다.
#                  예) 사냥한 몬스터 수, 수집한 아이템 수 등등 ..
#     type     : 필수퀘스트/일반퀘스트를 구분합니다.
#                  true일 경우 필수퀘스트
#                  false일 경우 일반퀘스트
#
#     TASKS 배열은 퀘스트에서 수행해야할 일들을 설정하는 곳입니다.
#     수행항목은 ''로 묶고 ,로 구분되어야만 합니다.
#     수행 항목에 대한 갯수 제한은 없으며, v[변수id]를 사용하여
#     변수를 표시하는 것이 가능합니다.
#
#     DESCRIPTIONS 배열은 퀘스트 에 대한 상세를 기록하는 곳입니다.
#     여러분의 게임을 즐기는 플레이어가 퀘스트 내용 대해 생각날 수 있도록
#     자세하게 설명을 써주세요 ^^
#     행의 구분은 ,로 이루어집니다. 한 문장은 반드시 ''로 묶어주세요.
#
#     위의 3가지를 작성하였다면 90%는 완성된 것입니다.
#     이제 게임내에서 퀘스트를 발생시켜야 하는데, 이는 변수값만 조절하면 됩니다.
#     보다 자세한 방법은 데모게임을 참고하세요~
# =============================================================================

module OMEGAS7
  module QUEST
    # =========================================================================
    #  Configuration Options.
    # =========================================================================
   
    #  MAP 또는 MENU 둘 중 어디로 돌아갈지 설정
    EXIT_TO = "MENU"
    # 만일 MENU라면, 어떤 slot이 나타나게 할 것인가? (시작은 0부터 )
    MENU_RETURN_SLOT = 5

    # 폰트 사이즈 설정
    QUESTS_FONT_SIZE = 13
    TASKS_FONT_SIZE = 16
   
    # 카테고리 아이콘의 인덱스 설정
    # [수주한 퀘스트,퀘스트 포기하기,완료한 퀘스트]
    CATEGORY_ICONS = [149,179,150]
   
    # =========================================================================
    QUESTS = []               # 수정하지 마세요!!!!!!!!!!!!!!!
    TASKS = []                 # 수정하지 마세요!!!!!!!!!!!!!!!
    DESCRIPTIONS = []     # 수정하지 마세요!!!!!!!!!!!!!!!
    # =========================================================================
   
    QUESTS[0] = ['용사증명! 가고일 처치',1,nil,true]
    TASKS[0] = ['- 가고일 처치',
                        '- 퀘스트왕궁 국왕에게 보고']
    DESCRIPTIONS[0] = ['퀘스트필드에는 퀘스트왕국을 괴롭히는',
                                    '가고일이 어슬렁거리고 있다.',
                                    '가고일을 처치하여 용사임을 증명하자!']
                                   
    QUESTS[1] = ['나를 위해 꽃을!',2,3,false]
    TASKS[1] = ['- 퀘스트필드에서 분홍색 꽃 채집 (v[3]/v[4])',
                        '- 퀘스트왕궁 마법사에게 납품']
     DESCRIPTIONS[1] = ['퀘스트필드에 피는 분홍색 꽃을 꺾어',
                                    '퀘스트왕궁에 있는 마법사에게 주자']
   
    QUESTS[2] = ['멍청한 해골병사',5,6,false]
    TASKS[2] = ['- 퀘스트필드에서 해골병사 퇴치 (v[6]/v[7])',
                        '- 퀘스트왕궁 기사에게 보고']
    DESCRIPTIONS[2] = ['퀘스트필드에 멍청하게 돌아다니고 있는',
                                    '해골병사를 퇴치하자. 해골병사 앞에서',
                                    '엔터키 한번 누르면 된다. 퀘스트 완료후',
                                    '퀘스트왕궁 기사에게 보고하자']   

  end
end

class Omega_Quest < Scene_Base
  include OMEGAS7::QUEST

  def initialize
    @index = 0
    @mode = 0
    @empty_list = false
    create_menu_background   
    create_quest_list
    create_quest_commands
    create_quest_description
    create_category
  end 
  def create_quest_list
    @list = []
    @list[0] = []
    @list[1] = []
    @list[2] = []
    for i in 0...QUESTS.size
      if $game_variables[QUESTS[i][1].to_i].to_i > TASKS[i].size
        @list[2][i] = [QUESTS[i][0].to_s,true,i]
      elsif $game_variables[QUESTS[i][1].to_i].to_i > 0
        @list[0][i] = [QUESTS[i][0].to_s,false,i]
        @list[1][i] = [QUESTS[i][0].to_s,false,i]
      end
    end
    @list[0].compact!
    @list[1].compact!
    @list[2].compact!
    @list.compact!
    if @list[0].empty?
      @empty_list = true
    end
  end
  def create_quest_commands
    create_quest_list  
    @command_window = Window_Quest_Command.new(280,@list[@mode])
    @command_window.y = 56
    @command_window.x = 0
    @command_window.opacity = 255
    @index = @command_window.index
  end
  def create_quest_description
    @window_description = Window_Base.new(280,56,264,360)
    @window_description.contents.font.size = QUESTS_FONT_SIZE
    @window_description.opacity = 255
    refresh_description
  end
  def refresh_description
    @window_description.contents.clear
    if @list[@mode][@command_window.index][2] != nil
      length = DESCRIPTIONS[@list[@mode][@command_window.index][2]].size
      for i in 0...length
        txt = DESCRIPTIONS[@list[@mode][@command_window.index][2]][i].to_s
        @window_description.contents.font.color = Color.new(255,255,255)
        @window_description.contents.draw_text(0,18*i,260,18,txt.to_s)
      end
      @tasks = [] 
      for i in 0...TASKS[@list[@mode][@command_window.index][2]].size
           @tasks[i] = TASKS[@list[@mode][@command_window.index][2]][i].to_s      
      end
      @display = []    
      for i in 0...@tasks.size
        @display[i] = @tasks[i].clone
        @display[i].to_s.gsub!(/\V[([0-9]+)]/i) { $game_variables[$1.to_i] }
        @display[i].to_s.gsub!(/\V[([0-9]+)]/i) { $game_variables[$1.to_i] }
        if $game_variables[QUESTS[@list[@mode][@command_window.index][2]][1].to_i].to_i > i+1
          @window_description.contents.font.color = Color.new(100,100,100)
        else
          @window_description.contents.font.color = Color.new(255,255,0)
        end
        @window_description.contents.draw_text(4,18*(1+length)+18*i,260,18,@display[i].to_s)
      end
    end
  end 
  def update
    @command_window.update
    @category.update
    if @mode != @category.index
      @mode = @category.index
      @command_window.dispose
      create_quest_commands
      refresh_description
    end
    if @index != @command_window.index
      @index = @command_window.index    
      refresh_description
    end
    if Input.repeat?(Input::DOWN) ||  Input.trigger?(Input::DOWN)
        if@command_window.index == @command_window.bottom_row
          @command_window.draw_window
          @command_window.refresh
        elsif @command_window.row_max != @command_window.bottom_row+2
          @command_window.top_row = 0
          @command_window.draw_window
          @command_window.refresh
        elsif @command_window.index == @command_window.top_row
          @command_window.top_row = 0
          @command_window.draw_window
          @command_window.refresh
        end
    end
    if Input.repeat?(Input::UP) ||  Input.trigger?(Input::UP)
      if @command_window.index == @command_window.top_row
        @command_window.draw_window
        @command_window.refresh
      elsif @command_window.index ==  @command_window.bottom_row
        @command_window.top_row = @command_window.bottom_row-@command_window.page_item_max+1
        @command_window.draw_window
        @command_window.refresh
      end
    end
    if Input.trigger?(Input::C) && @list[@mode][@command_window.index][2] != nil
      # Quest abandon window call
      if @mode == 1
          if QUESTS[@list[@mode][@command_window.index][2]][3] == false
              @command_window.dispose
              @window_description.dispose
              @category.dispose
              $scene = Quest_Abandon_View.new(250, @list[@mode][@command_window.index][2])
         else
              Sound.play_buzzer
         end
      end
    end 
    if Input.trigger?(Input::B)
      finish
    end
  end
  def create_category
    @category = Window_Categories_Command.new(544)
    @category.opacity = 255
    @category.x = 0
    @category.y = 0
  end 
  def finish   
    @command_window.dispose
    @window_description.dispose
    @category.dispose
    case EXIT_TO
    when "MENU"
      $scene = Scene_Menu.new(MENU_RETURN_SLOT)
    when "MAP"
      $scene = Scene_Map.new
    end
  end
end

#--------------------------------------------------------------------------
# ● 퀘스트 포기 화면 출력
#--------------------------------------------------------------------------
class Quest_Abandon_View< Scene_Base
  include OMEGAS7::QUEST
  def initialize(width, id)
    @width = width
    @id = id
    @index=1
    create_window
  end
  def create_window  
    @window = Quest_Abandon_Command.new(@width)
    @window.index = @index
    @quest_title= Window_Base.new(48,112,496,64)
    @quest_title.opacity = 0
    @quest_title.contents.font.color = Color.new(255,0,0)
    @quest_title.contents.draw_text(0,0,496,32,QUESTS[@id][0].to_s)
  end
  def update
    @window.update
    if @index != @window.index
      @index = @window.index
    end
    if Input.trigger?(Input::C)
      if @index != 1
        $game_variables[QUESTS[@id][1].to_i]=0
        $game_variables[QUESTS[@id][2].to_i]=0  if QUESTS[@id][2] != nil
      end
      @window.dispose
      @quest_title.dispose
      $scene = Omega_Quest.new
    end
    if Input.trigger?(Input::B)
      @window.dispose
      @quest_title.dispose
      $scene = Omega_Quest.new
    end
  end
end

#--------------------------------------------------------------------------
# ● 퀘스트 포기 화면 처리
#--------------------------------------------------------------------------
class Quest_Abandon_Command < Window_Selectable
  include OMEGAS7::QUEST

  attr_reader   :commands

  def initialize(width, column_max = 2, row_max = 1, spacing = 32)
    super((544/2)-(width/2), (416/2)-((row_max * WLH + 32)/2), width, row_max * WLH + 32, spacing)
    @commands = ['퀘스트 포기','돌아간다']
    @item_max = commands.size
    @column_max = column_max
    @width=width
    draw_window 
    refresh
    self.index = 0
  end
  def draw_window
     self.contents = Bitmap.new(width - 32,  (bottom_row+1) * WLH)
  end  
  def refresh
    self.contents.clear
    for i in top_row...@item_max
      draw_item(i)
    end
  end

  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.size = 18
    self.contents.draw_text(rect.x,rect.y,@width/2,24,@commands[index]) 
  end
end

#--------------------------------------------------------------------------
# ● 퀘스트 수주/완료 항목 표시
#--------------------------------------------------------------------------
class Window_Quest_Command < Window_Selectable
  include OMEGAS7::QUEST

  attr_reader   :commands

  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
    @commands = commands
    @is_empty = 1
    if @commands.empty?
      @commands[0] = ["퀘스트가 없습니다.",false]
      @is_empty = 0
    end  
    if row_max == 0
      row_max = (@commands.size + column_max - 1) / column_max
    end
    super(0, 0, width, 360, spacing)
    @item_max = commands.size
    @column_max = column_max
    draw_window   
    refresh
    self.index = 0
  end
  def draw_window
     self.contents = Bitmap.new(width - 32,  (bottom_row+1) * WLH)
     self.contents.font.size = TASKS_FONT_SIZE   
  end  
  def refresh
    self.contents.clear
    for i in top_row...@item_max
      draw_item(i)
    end
  end
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    if @is_empty == 1
      if QUESTS[@commands[index][2]][3] == true
         self.contents.font.color = Color.new(255,100,0)
      else
         self.contents.font.color = Color.new(255,255,255)
       end
    else
       self.contents.font.color = Color.new(255,255,255)
    end
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @commands[index][0].to_s)
  end
 
end


#--------------------------------------------------------------------------
# ● 완료/진행중/수주 카테고리 표시
#--------------------------------------------------------------------------
class Window_Categories_Command < Window_Selectable
  include OMEGAS7::QUEST

  attr_reader   :commands

  def initialize(width, column_max = 3, row_max = 1, spacing = 32)
    super(0, 0, width, row_max * WLH + 32, spacing)
    @commands = ['수주한 퀘스트','퀘스트 포기하기','완료한 퀘스트']
    @item_max = commands.size
    @column_max = column_max
    @icons = CATEGORY_ICONS   
    refresh
    self.index = 0
  end 
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end

  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    draw_icon(@icons[index],rect.x,rect.y)
    self.contents.font.size = 16
    self.contents.draw_text(rect.x+24,rect.y,132,24,@commands[index]) 
  end
end

 

#--------------------------------------------------------------------------
# ● Scene_menu에 '퀘스트' 항목 추가
#--------------------------------------------------------------------------
class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # ● 커멘드 윈도우의 작성
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = '퀘스트'
    s7 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # 파티 인원수가 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_system.save_disabled             # 세이브 금지의 경우
      @command_window.draw_item(4, 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 @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # 아이템
        $scene = Scene_Item.new
      when 1,2,3  # 스킬, 장비, 스테이터스
        start_actor_selection
      when 4      # 세이브
        $scene = Scene_File.new(true, false, false)
      when 5      # 퀘스트
        $scene = Omega_Quest.new
      when 6      # 게임 종료
        $scene = Scene_End.new
      end
    end
  end 
end

Comment '1'
  • ?
    만능태도 2011.07.05 16:04

    #     ID : 퀘스트  ID (0부터 순서대로 증가시키면 됩니다)
    #     'Name' : 퀘스트 제목을 입력합니다. 반드시 작은 따옴포 ''로 묶어주세요
    #     VAR     : 변수 ID를 설정합니다. 이 변수값으로 퀘스트의 진행을 제어합니다.
    #     QVAR   : 퀘스트에 사용하는 변수 ID를 설정합니다.
    #                  사용하지 않을 경우 nil을 입력합니다.
    #                  예) 사냥한 몬스터 수, 수집한 아이템 수 등등 ..
    #     type     : 필수퀘스트/일반퀘스트를 구분합니다.
    #                  true일 경우 필수퀘스트
    #                  false일 경우 일반퀘스트

     

     

    주석을 자세히 읽어보셨으면 모르실리가 없으셨을텐데;;

     

    QUESTS[1] = ['나를 위해 꽃을!',2,3,false]

     

    즉 이 경우 2번 변수에 나를 위해 꽃을! 이라는 "퀘스트"가 저장되고

     

    3번 변수에 해당 꽃이 몇개모아오는건지 아니면 베는건지 등의 "갯 수"를 저장하는 곳입니다.


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12387
RMVX 크아(BNB)같은 아케이드 게임.. 2 보이 2010.10.30 1309
RMVX 크리율 보정에대해 여쭤보려고합니다. 2 플뤼 2013.11.14 797
RMVX 크레딧을 만들려고 하는데... 3 뉴리키 2014.05.08 660
RMVX 크기가 큰 캐립터 칩이요... 2 아민 2011.01.25 757
RMVX 퀘스트창은 어떻게 만들죠?? 1 dklqwer123 2011.06.01 1086
RMVX 퀘스트의 종류를 구체적으로 분류부탁. 1 도심 2010.11.23 1100
RMVX 퀘스트에서 아이템 다수를 구해오라는 퀘스트 1 정말귀인★ 2011.07.23 1519
RMVX 퀘스트에 대해서 1 광글이 2013.11.22 661
RMVX 퀘스트를 만드려는데 4 play 2010.09.07 5486
RMVX 퀘스트,체력바,이동속도 질문합니다. 2 dlwog2 2014.06.01 1126
RMVX 퀘스트,엔딩 1 퓨전볼 2010.12.27 617
RMVX 퀘스트 질문임돠 1 게임꿈나무 2017.07.14 117
RMVX 퀘스트 스크립트 해석 1 unuseid 2011.07.04 849
RMVX 퀘스트 스크립트 없나요? 3 OhSoft 2011.01.18 1019
RMVX 퀘스트 생성질문이요 2 RPGvvxx 2010.12.08 721
RMVX 퀘스트 무한반복 안되게 하는법. 3 니똥방구 2012.01.19 2911
RMVX 퀘스트 2 츠키코로 2014.05.04 520
RMVX 케릭터제작사이트에서 아카로스 2010.11.18 800
RMVX 케릭터를라테일이나메이플처럼양옆으로.. 1 하얀솜털 2011.12.10 2165
RMVX 케릭터가 이상하네요 .. 2 file 슬림핏 2011.11.12 1723
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ... 127 Next
/ 127