질문과 답변

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 12393
RMVX 맵 만들기 2 file 돈돈치 2013.08.24 849
RMVX 퀘스트 스크립트 해석 1 unuseid 2011.07.04 849
RMVXA 애니메이션 좌표로 출력 6 에뎀이 2014.03.02 848
RMVX 능력치에 비례하여 회복하는 기술을 만들고 싶습니다. 27 스리아씨 2013.09.19 848
RMVXA VXA 스킬 애니메이션 바꾸기. 로브남 2013.07.19 848
RMVX 이벤트를 한번 처리 한걸 삭제 시키고 싶은데 어떻게 해야 하나요? 4 AQUA 2013.04.11 848
RMXP 교환하는법좀 크루즈 2011.03.07 848
RMVX 테스트 플레이 딜레이 3 김진리 2011.01.27 848
RMVX 바다위를 랜덤으로 움직이는 배.. 5 난천 2010.10.09 848
RMVXA 소재관리에서 타일셋을 어떻게 추가하는지 모르겠어요 2 이루하리 2014.01.30 847
RMVXA rmvxa 이름 스크립트 오류 질문 file asdasass 2013.04.27 847
RMVX 선사용스킬 설정을 해줄 수는 없나요? casella 2011.06.22 847
RMVX 최대체력 늘리는법 알려주세요 3 프레임 2011.01.05 847
RMVX 모바일 호환 스크립트 질문 2 마가린 2014.03.09 846
RMVXA (xrxs)6.1ch대쉬! 스크립트 개조 부탁드립니다.. file 천년행복 2013.09.28 846
RMXP 스크립트 에디터에서 정해진 수치를 다양하게 변경할수 있는 방법(?)에 관해서 질문합니다 1 브라우니 2012.12.13 846
라이선스 RMVX RPG 만들기 VX 구매에 대해서 4 UlieceilU1 2014.09.20 846
RMVXA 일정체력 이하로떨어지면 능력치가 증가하게 만들기 1 프라임헌터즈 2014.02.27 846
RMXP 변수 더하기 변수 5 bluesu1004 2012.12.29 846
RMVX 로브 방어구를 끼면 최대 마나가 늘어나도록 하는 방법. 4 엿데브 2011.05.28 846
Board Pagination Prev 1 ... 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 ... 516 Next
/ 516