XP 스크립트

현재 제가 퀘스트 창으로 쓰고 있는 스크립트입니다.
일루젼님께서 사용법이 필요하시다길래 올립니다.

사용법::
실행 스크립트는 $scene = Scene_Outline.new 입니다.
그러나 그냥 실행만 시켜서는 개요창에 제목이 표시되지 않습니다
그래서 따로 $game_system.outline_enable[0] = true를 스크립트로 실행해주셔야합니다.
그럼 첫번째 글을 읽을 수 있게 되고 $game_system.outline_enable[0] = true에서 [0]의 숫자를
바꿔주시면 다른 글도 표시됩니다.
단 첫번째 글의 번호가 0부터 시작합니다 두번째 글은 1, 세번째는 2가 되는거죠.
필요하시다면 예제도 올리겠습니다.

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆개요 - KGC_Outline◆
#_/----------------------------------------------------------------------------
#_/  개요를 열람하는 기능을 추가합니다.
#_/  Provides the function to show "Outline".
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ 커스터마이즈 항목 - Customize ★
#==============================================================================

module KGC
  # ◆개요 화면 배경 투과
  OLINE_BACK_TRANSPARENT = true
  # ◆스크롤 속도【단위:px】
  OLINE_SCROLL_SPEED = 8
  # ◆일련 번호를 묘화
  OLINE_SERIAL_NUMBER = false
  # ◆일련 번호의 자리수
  OLINE_SERIAL_NUMBER_DIGITS = 3
  # ◆무효인 개요는 표시하지 않는
  OLINE_HIDE_DISABLED = true
  # ◆완료 기호
  OLINE_COMPLETION_SYMBOL = "★"
  # ◆미완 기호
  OLINE_INCOMPLETION_SYMBOL = " "

  # ◆개요 내용
  #  ≪["타이틀", ["본문", ...]], ...≫
  #  본문은 , 배열의 각 요소가 1행에 상당.
  #    **** 제어 커멘드 ****
  #  \V[n]  : 변수 ID:n
  #  \G    : 소지금
  #  \N[n]  : ID:n 의 엑터명
  #  \EN[n] : ID:n 의 에너미명
  #  \IN[n] : ID:n 의 아이템명
  #  \WN[n] : ID:n 의 무기명
  #  \AN[n] : ID:n 의 방어용 기구명
  OLINE_CONTENTS = [
    ["(Main) '루스텐'촌장과의 만남",  # 제목
      ["[대지의 마을: 로렌] 중앙에 위치한 '루스텐' 촌장의 집으로",
      " 가서 '루스텐' 촌장에게 레뮤리아 대륙의 이야기를 들으라."]] #  내용
  ]  # -- Don't delete this line! --
end

#### OLINE_BACK_TRANSPARENT
### Makes the background of "Outline" transparency.

#### OLINE_SCROLL_SPEED
### Scroll speed. {Unit : pixel}

#### OLINE_SERIAL_NUMBER
### Draws the serial number.

#### OLINE_SERIAL_NUMBER_DIGITS
### Digits of the serial number.

#### OLINE_HIDE_DISABLED
### Hides disabled "Outline".

#### OLINE_COMPLETION_SYMBOL
### Completion symbol.

#### OLINE_INCOMPLETION_SYMBOL
### Incompletion symbol.


#### OLINE_CONTENTS
### Contents of "Outline".
#  << ["Title", ["Body", ...]], ... >>
#  In the "Body", each element of the array corresponds to one line.
#    **** Control statement ****
#  \V[n]  : Variable of ID:n
#  \G    : Money
#  \N[n]  : Actor's name of ID:n
#  \EN[n] : Enemies' name of ID:n
#  \IN[n] : Item's name of ID:n
#  \WN[n] : Weapon's name of ID:n
#  \AN[n] : Armor's name of ID:n

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

$imported = {} if $imported == nil
$imported["Outline"] = true

#--------------------------------------------------------------------------
# ● 개요 화면 호출
#--------------------------------------------------------------------------
def call_outline
  # 플레이어의 자세를 교정
  $game_player.straighten
  # 개요 화면으로 전환하고
  $scene = Scene_Outline.new(true)
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_System
#==============================================================================

class Game_System
  attr_accessor :outline_enable, :outline_complete
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  alias initialize_KGC_Outline initialize
  def initialize
    initialize_KGC_Outline

    @outline_enable = []
    @outline_complete = []
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Module - KGC_Outline
#------------------------------------------------------------------------------
#  개요 처리에 사용하는 메소드입니다.
#==============================================================================

module KGC_Outline
  #--------------------------------------------------------------------------
  # ● 제어 커멘드 처리
  #    string : 처리 대상 캐릭터 라인
  #--------------------------------------------------------------------------
  def self.apply_control_statement(string)
    buf = string.dup
    buf.gsub!(/\V[(d+)]/i) { $game_variables[$1.to_i].to_s }
    buf.gsub!(/\G/i) { $game_party.gold.to_s }
    buf.gsub!(/\N[(d+)]/i) { $game_actors[$1.to_i].name }
    buf.gsub!(/\EN[(d+)]/i) { $data_enemies[$1.to_i].name }
    buf.gsub!(/\IN[(d+)]/i) { $data_items[$1.to_i].name }
    buf.gsub!(/\WN[(d+)]/i) { $data_weapons[$1.to_i].name }
    buf.gsub!(/\AN[(d+)]/i) { $data_armors[$1.to_i].name }
    return buf
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_OutlineList
#------------------------------------------------------------------------------
#  개요 일람을 표시하는 윈도우입니다.
#==============================================================================

class Window_OutlineList < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(80, 40, 480, 400)
    self.back_opacity = 160 if KGC::OLINE_BACK_TRANSPARENT
    self.index = 0
    self.z = 1000
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 선택 개요 내용
  #--------------------------------------------------------------------------
  def outline
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.dispose if self.contents != nil
    @data = []
    # 리스트 작성
    $game_system.outline_enable = [] if $game_system.outline_enable == nil
    $game_system.outline_complete = [] if $game_system.outline_complete == nil
    KGC::OLINE_CONTENTS.each_with_index { |oline, i|
      if $game_system.outline_enable[i]
        buf = oline
        buf << i
        @data << buf
      elsif !KGC::OLINE_HIDE_DISABLED
        @data << ["- - - - - - - -", nil, i]
      end
    }
    # 리스트 묘화
    @item_max = [@data.size, 1].max
    self.contents = Bitmap.new(self.width - 32, 32 * @item_max)
    if @data.size == 0
      @data << ["", nil, 0]
    else
      @data.each_index { |i| draw_item(i) }
    end
  end
  #--------------------------------------------------------------------------
  # ● 항목 묘화
  #--------------------------------------------------------------------------
  def draw_item(index)
    self.contents.fill_rect(0, 32 * index, self.width - 32, 32, Color.new(0, 0, 0, 0))
    # 타이틀 생성
    text = ($game_system.outline_complete[index] ?
      KGC::OLINE_COMPLETION_SYMBOL : KGC::OLINE_INCOMPLETION_SYMBOL) +
      (KGC::OLINE_SERIAL_NUMBER ? sprintf("%0*d : ",
      KGC::OLINE_SERIAL_NUMBER_DIGITS, @data[index][2] + 1) : "") +
      KGC_Outline::apply_control_statement(@data[index][0])
    # 묘화색 설정
    self.contents.font.color = $game_system.outline_enable[index] ?
      normal_color : disabled_color
    self.contents.draw_text(0, 32 * index, self.width - 32, 32, text)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_OutlineTitle
#------------------------------------------------------------------------------
#  개요의 제목을 표시하는 윈도우입니다.
#==============================================================================

class Window_OutlineTitle < Window_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160 if KGC::OLINE_BACK_TRANSPARENT
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #    text  : 표시하는 캐릭터 라인
  #--------------------------------------------------------------------------
  def refresh(text)
    self.contents.clear
    text2 = KGC_Outline::apply_control_statement(text)
    self.contents.draw_text(0, 0, self.width - 32, 32, text2, 1)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_Outline
#------------------------------------------------------------------------------
#  개요(의 내용)을 표시하는 윈도우입니다.
#==============================================================================

class Window_Outline < Window_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    self.back_opacity = 160 if KGC::OLINE_BACK_TRANSPARENT
    self.active = false
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #    oline : 개요
  #--------------------------------------------------------------------------
  def refresh(oline = nil)
    self.oy = 0
    self.contents.dispose if self.contents != nil
    return if oline == nil
    # 본문을 묘화
    self.contents = Bitmap.new(self.width - 32, 32 * oline.size)
    oline.each_with_index { |l ,i|
      next if l == nil
      text = KGC_Outline::apply_control_statement(l)
      self.contents.draw_text(0, i * 32, self.width - 32, 32, text)
    }
  end
  #--------------------------------------------------------------------------
  # ● 갱신
  #--------------------------------------------------------------------------
  def update
    super
    # 스크롤
    if self.active
      scroll_max = [self.contents.height - (self.height - 32), 0].max
      if Input.press?(Input::UP)
        self.oy = [self.oy - KGC::OLINE_SCROLL_SPEED, 0].max
      elsif Input.press?(Input::DOWN)
        self.oy = [self.oy + KGC::OLINE_SCROLL_SPEED, scroll_max].min
      elsif Input.repeat?(Input::L)
        self.oy = [self.oy - (self.height - 32), 0].max
      elsif Input.repeat?(Input::R)
        self.oy = [self.oy + (self.height - 32), scroll_max].min
      end
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Outline
#------------------------------------------------------------------------------
#  개요 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Outline
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #    map_call : 맵으로부터의 호출 플래그
  #--------------------------------------------------------------------------
  def initialize(map_call = false)
    @map_call = map_call
  end
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 스프라이트 세트를 작성
    @spriteset = Spriteset_Map.new if KGC::OLINE_BACK_TRANSPARENT
    # 윈도우를 작성
    @list_window = Window_OutlineList.new
    @title_window = Window_OutlineTitle.new
    @content_window = Window_Outline.new
    # 트란지션 실행
    Graphics.transition
    # 메인 루프
    loop {
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    }
    # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @list_window.dispose
    @title_window.dispose
    @content_window.dispose
    @spriteset.dispose if KGC::OLINE_BACK_TRANSPARENT
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 윈도우 갱신
    @list_window.update
    @title_window.update
    @content_window.update
    # 액티브 윈도우 조작
    if @list_window.active
      update_list
    elsif @content_window.active
      update_content
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (리스트)
  #--------------------------------------------------------------------------
  def update_list
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 을 연주
      $game_system.se_play($data_system.cancel_se)
      if @map_call
        # 맵 화면으로 전환하고
        $scene = Scene_Map.new
      else
        # 메뉴 화면으로 전환하고
        if $imported["MenuAlter"]
          index = KGC::MA_COMMANDS.index(12)
          if index != nil
            $scene = Scene_Menu.new(index)
          else
            $scene = Scene_Menu.new
          end
        else
          $scene = Scene_Menu.new
        end
      end
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      outline = @list_window.outline
      # 열람할 수 없는 경우
      if outline[1] == nil
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 결정 SE 을 연주
      $game_system.se_play($data_system.decision_se)
      # 개요를 갱신
      @title_window.refresh(outline[0])
      @content_window.refresh(outline[1])
      # 윈도우 변환
      @list_window.active = false
      @list_window.z = 0
      @content_window.active = true
      @content_window.z = 1000
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (본문)
  #--------------------------------------------------------------------------
  def update_content
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 을 연주
      $game_system.se_play($data_system.cancel_se)
      # 윈도우 변환
      @list_window.active = true
      @list_window.z = 1000
      @content_window.active = false
      @content_window.z = 0
      return
    end
  end
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
921 전체화면 스크립트[해상도 스크립트랑 중복사용 불가] 24 file - 하늘 - 2009.08.06 3975
920 전투 RTAB 1.16ver 12 file 백호 2009.02.22 3960
919 장비 CSSR8-장비품 생산&강화 시스템 18 file 백호 2009.02.22 3959
918 영상 플래시 동영상 재생 스크립트 사용법 및 다운로드 8 아방스 2010.11.02 3919
917 아이템 심플 액알 [리젠, 아이템 드롭] 18 file 백호 2009.02.21 3917
916 HUD [VX 가능] 이벤트 이름 띄우기 41 file 독도2005 2009.08.22 3902
915 전투 XAS Hero Edition Ver. 3.91 3 프리즌커피 2011.12.23 3894
914 기타 [자작]데미지표시 19 file JACKY 2012.02.15 3842
913 스킬 약간 수정한 심플액알(크리티컬,스킬) 10 백호 2009.02.22 3836
912 이동 및 탈것 아하! 그렇구나의 3D 신기술 체험 2 23 아하!잘봤어요. 2010.02.28 3815
911 기타 3D스크립트 48 file ok하승헌 2010.02.18 3808
910 기타 [게이지바]HelloCoaVer4.0 업데이트 속도 변경 [오랜만의 업데이트] 30 file 코아 코스튬 2011.04.02 3790
909 전투 보행그래픽으로 싸우는 턴알 17 백호 2009.02.22 3782
908 파티 KGC-대규모파티 25 rgnrk001 2010.03.01 3771
907 이동 및 탈것 동료들끼리 따라오는 스크립트 41 file ◐아이흥행 2010.01.23 3714
906 기타 만화형태 말칸 스크립트 28 file 백호 2009.02.22 3705
905 [스마슈님 제공] 부활스크립트 19 file 아방스 2007.11.09 3705
904 저장 [ AutoSave ]오토세이브, 뜻 그대로 자동저장스크립트 17 file 제로스S2 2009.08.06 3694
903 sbabs - 몬스터 게이지 표시 스크립트 13 file 아방스 2007.11.09 3668
902 기타 [신기술 체험] RPGXP 3D 9 file 백호 2009.02.22 3635
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52