2013.11.24 10:20

스크립트 오류요..

조회 수 821 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

# 퀘스트 로그 시스템
# game_guy 가이 만듬
# 빗자루씨 번역
# Version 3.0
#-------------------------------------------------------------------------------
# 간략한 소개:
# 퀘스트를 만들수 있는 스크립트 입니다.
#
# 구성 요소:
# 퀘스트가 완료되었을때 이름을 노란색으로 표시합니다.
# 퀘스트를 만들기 쉬워집니다.
# 존나게 긴 퀘스트를 만들수 있습니다.
# 그림을 띄워서 설명할 수 있습니다.
# 퀘스트를 추가하고 쉽게 클리어 할수 있습니다.
# 다른 쉬운 버전보다 가볍습니다.
#
# 설치방법:
# 조금 아래를 내려다보면 # 이 보입니다. 아래에 있는 대로 하세요..
# 이벤트 설정에서 스크립트 실행으로 아래를 응용할수 있습니다.
#
# 스크립트 목록:

#이벤트에 스크립트 에 써주면 됩니다.
# Quest.add(id) ~ 퀘스트(id)를 리스트에 추가합니다.
# Quest.take(id) ~ 퀘스트(id)를 리스트에서 삭제합니다.
# Quest.complete(id) ~ 퀘스트(id)를 완료합니다.
# Quest.completed?(id) ~ 퀘스트(id)를 완료했을때 값을 true로 돌립니다..
# Quest.has?(id) ~ 퀘스트(id)를 받았는지 확인합니다.
# $scene = Scene_Quest.new ~ 퀘스트 메뉴를 엽니다.
#
# 주의사항 :
# 퀘스트가 하나도 없을시에는 에러가 납니다.
# 적어도 퀘스트가 하나라도 있을때 퀘스트 창을 열수 있게 해주세요.
#
# 크레딧:
# game_guy ~ 이거 만들었습니다.
# 베타 테스터 ~ Sally and Landith
# Blizzard ~ 이 사람의 코드에서 조금 배꼈다고 하는군요.
# 빗자루씨 ~ 이거 번역한사람입네다.
#===============================================================================
module GameGuy
  #==================================================
  # Begin Config
  # UsePicture ~ true값으로 지정되었을때 그림을
  #              퀘스트창에 표시합니다만 false일때는 안합니다.
  #==================================================
  UsePicture   = false
  def self.qpicture(id)
    case id
    #==================================================
    # 퀘스트 그림
    # when x then return "그림" 방식으로 추가합니다.
    # x = id, 그림 = quotes 안에 있는 그림
    #==================================================
    when 1 then return "ghost"

    end
    return nil
  end
 
  def self.qname(id)
    case id
    #==================================================
    # 퀘스트 이름
    # when x then return "이름" 방식으로 추가합니다.
    # x = id, 이름 = quotes 안에 있는 이름
    #==================================================
    when 1 then return "[필수]튜토리얼"
      when 2 then return "안나의 심부름"
        when 3 then return "[필수]대왕벌 퇴치"
          when 4 then return "켈베로스 퇴치"
            when 5 then return "[필수]베히모스 퇴치
    #when 9 then return

     
    end
    return ""
  end
     $q = [0]
   for x in 1...600
   $q[x] = self.qname(x)
   end
  def self.qlocation(id)
    case id
    #==================================================
    # 퀘스트 장소
    # x = id, 장소 = quotes 안에 있는 장소
    #==================================================
    when 1 then return "튜토리얼 맵"
      when 2 then return "시작의 마을"
        when 3 then return "시작의 마을"
          when 4 then return "눈의 마을"
            when 5 then return "눈의 마을"
    end
    return "????"
  end
 
  def self.qdescription(id)
    case id
    #==================================================
    # 퀘스트 설명
    # when x then return "설명" 방식으로 추가합니다.
    # x = id, 설명 = quotes 안에 있는 설명
    #==================================================
    when 1 then return "튜토리얼을 클리어하자"
      when 2 then return "벌침 10개를 구해서 안나에게 갖다주자."
        when 3 then return "대왕벌을 퇴치하고 이장에게 가자"
          when 4 then return "켈베로스의 뼈다귀 10개를 에길에에게 가져다주자."
            when 5 then return "베히모스의 가죽 1개를 이장에게 갖다주자."
              end
    return ""
  end
 
end

module Quest
 
  def self.add(id)
    $game_party.add_quest(id)
  end
 
  def self.take(id)
    $game_party.take_quest(id)
  end
 
  def self.complete(id)
    $game_party.complete(id)
  end
 
  def self.completed?(id)
    return $game_party.completed?(id)
  end
 
  def self.has?(id)
    return $game_party.has_quest?(id)
  end
 
end
 
class Game_Party
 
  attr_accessor :quests
  attr_accessor :completed
 
  alias gg_quests_lat initialize
  def initialize
    @quests = []
    @completed = []
    gg_quests_lat
  end
 
  def add_quest(id)
    unless @quests.include?(id)
      @quests.push(id)
    end
  end
 
  def completed?(id)
    return @completed.include?(id)
  end
 
  def complete(id)
    unless @completed.include?(id)
      if @quests.include?(id)
        @completed.push(id)
      end
    end
  end
 
  def has_quest?(id)
    return @quests.include?(id)
  end
 
  def take_quest(id)
    @quests.delete(id)
    @completed.delete(id)
  end
 
end
class Scene_Quest
  def main
    @quests = []
    for i in $game_party.quests
      @quests.push(GameGuy.qname(i))
    end
    @map = Spriteset_Map.new
    @quests2 = []
    for i in $game_party.quests
      @quests2.push(i)
    end
    @quests_window = Window_Command.new(160, @quests)
    @quests_window.height = 480
    @quests_window.back_opacity = 110
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    @quests_window.dispose
    @quest_info.dispose if @quest_info != nil
    @map.dispose
  end
  def update
    @quests_window.update
    if @quests_window.active
      update_quests
      return
    end
    if @quest_info != nil
      update_info
      return
    end
  end
  def update_quests
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(1)
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      @quest_info = Window_QuestInfo.new(@quests2[@quests_window.index])
      @quest_info.back_opacity = 110
      @quests_window.active = false
      return
    end
  end
  def update_info
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @quests_window.active = true
      @quest_info.dispose
      @quest_info = nil
      return
    end
  end
end
class Window_QuestInfo < Window_Base
  def initialize(quest)
    super(160, 0, 480, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @quest = quest
    refresh
  end
  def refresh
    self.contents.clear
    if GameGuy::UsePicture
      pic = GameGuy.qpicture(@quest)
      bitmap = RPG::Cache.picture(GameGuy.qpicture(@quest)) if pic != nil
      rect = Rect.new(0, 0, bitmap.width, bitmap.height) if pic != nil
      self.contents.blt(480-bitmap.width-32, 0, bitmap, rect) if pic != nil
    end
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 480, 32, "퀘스트:")
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 32, 480, 32, GameGuy.qname(@quest))
    self.contents.font.color = system_color
    self.contents.draw_text(0, 128, 480, 32, "장소:")
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 160, 480, 32, GameGuy.qlocation(@quest))
    self.contents.font.color = system_color
    self.contents.draw_text(0, 192, 480, 32, "완료 여부:")
    self.contents.font.color = normal_color
    if $game_party.completed.include?(@quest)
      self.contents.font.color = crisis_color
      self.contents.draw_text(0, 224, 480, 32, "완료")
    else
      self.contents.font.color = normal_color
      self.contents.draw_text(0, 224, 480, 32, "진행중")
    end
    self.contents.font.color = system_color
    self.contents.draw_text(0, 256, 480, 32, "스토리 설명:")
    self.contents.font.color = normal_color
    text = self.contents.slice_text(GameGuy.qdescription(@quest), 460)
    text.each_index {|i|
        self.contents.draw_text(0, 288 + i*32, 460, 32, text[i])}
  end
end
class Bitmap
 
  def slice_text(text, width)
    words = text.split(' ')
    return words if words.size == 1
    result, current_text = [], words.shift
    words.each_index {|i|
        if self.text_size("#{current_text} #{words[i]}").width > width
          result.push(current_text)
          current_text = words[i]
        else
          current_text = "#{current_text} #{words[i]}"
        end
        result.push(current_text) if i >= words.size - 1}
    return result
  end

end

 
89라인에서 오류뜬다는데 왜이러는거지 ㄷㄷㄷ

?

List of Articles
번호 제목 글쓴이 날짜 조회 수 추천 수
공지 제2회 인디사이드 게임제작대회 출품작 리스트. 189 인디사이드운영자 2016.10.24 31106 0
공지 인디사이드 활동 규정.(ver.20160119) 192 천무 2015.02.16 32871 1
23537 혹시 '이터니티' 라는게임 갖고 계시는분 있을까요? 2 DoingDogu 2026.02.01 491 0
23536 [스마일게이트 퓨처랩] 비버롹스 2025 온라인 전시관 오픈! (12/1~12/14) file 스마일게이트퓨처랩 2025.12.01 422 0
23535 [스마일게이트 퓨처랩] 비버롹스 with 산나비! 게임 시연과 함께 굿즈 스토어까지! file 스마일게이트퓨처랩 2025.11.26 396 0
23534 [스마일게이트 퓨처랩] 놓치면 후회! 비버롹스 2차 얼리버드 티켓 절찬 판매중! file 스마일게이트퓨처랩 2025.11.20 408 0
23533 코리아 인디게임 쇼케이스가 떴다 file gls2024 2025.10.20 446 0
23532 GGDC 2025 글로벌게임개발자컨퍼런스 2차 공개! file ggdc 2025.10.18 412 0
23531 BEAVER ROCKS 2025 슈퍼 얼리버드 티켓 오픈! 스마일게이트퓨처랩 2025.10.17 402 0
23530 이제 여기 다운로드는 다 막힌건가 Redgm 2025.10.12 689 0
23529 안녕하세요 우사준 2025.09.30 467 0
23528 혹시 이 사이트의 등업관련해서 질문이있는데요 1 이드냐 2025.09.23 635 0
23527 GGDC 2025 글로벌 게임 개발자 컨퍼런스 1 file ggdc 2025.09.18 878 0
23526 NGC2025 사전등록 이벤트 소식~ ^^ file 태사자 2025.09.18 409 0
23525 [대구디지털혁신진흥원] (NGC2025) NEXT GAME CONFERENCE 2025 file 태사자 2025.09.12 438 0
23524 [스마일게이트 퓨처랩]BEAVER ROCKS 인디게임&컬처 페스티벌, 2025 전시팀 모집 file 스마일게이트퓨처랩 2025.08.04 484 0
23523 [전남정보문화산업진흥원] 게임개발 취업 부트캠프 file 유니버스 2025.07.31 440 0
23522 충청권 인디게임 공모전<인디유> file CBGC 2025.07.24 485 0
23521 인디게임에 대한 간단한 생각 1 철수와미애 2025.07.18 793 0
23520 [스마일게이트 퓨처랩]스마일게이트 인디게임 프로토타이핑 챌린지 모집 (~7/31) file 스마일게이트퓨처랩 2025.07.17 485 0
23519 2025 충북글로벌게임센터 게임기업 신규 입주 모집(~7. 25.) file CBGC 2025.07.07 489 0
23518 2025 충북글로벌게임센터 [충북게임아카데미] 교육생 모집(~6. 26.) file CBGC 2025.06.17 489 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 1177 Next
/ 1177


[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)