질문과 답변

Extra Form

소설풍 스크립트 사용시에요

 

글씨 색 변환이 안되나요?

 

스크립트에서는 사용시 가능하다고 나와있는데요

 

안되는 것 같아서요

 

#==============================================================================
# ★ 소설 스크립트
# tomoaky (http://hikimoki.hp.infoseek.co.jp/)
# 2009/11/01 공개
#
# 번역:네이버 번역기
# 일부 주석 수정 및 추가: 맛난호빵
# 홈페이지: http://avangs.info/
#               http://tk4555.webzip.kr/
#------------------------------------------------------------------------------
# 문자열을 소설처럼(노벨풍) 서술 하게 해주는 스크립트입니다.
# 아래의 설명들을 참조하지 않으면 제대로 표시되지 않습니다.
#
# RPG 트크르 VX의 스크립트 에디터로 "▼ 소재" 아래에
# 삽입해 주세요.
#
# FLAG_SWT로 지정한 게임 스위치를 온으로 하면, 문장 표시가
# 소설 게임풍의 것으로 바뀝니다.얼굴 그래픽, 배경,
# 픽크, 위치변경등의 기능은 없습니다.
# 통상의 제어 문자에 추가 이하가 이용 가능합니다.
# B[n] : 문자 사이즈를 n으로 변경 (n는 변경할 숫자의 크기)
# P    : 문자열 초기화
#
# 배경을 어둡게 하는 기능이 없기 때문에, 색조 변경 커맨드를 사용해 변경
# 할 필요가 있습니다.이 경우, 커먼 이벤트에 플러그 스위치
# 의 조작과 색조 변경을 모아 두면 다양하게 편리하게 됩니다.
#
# 이벤트 처리를 빠져도 메세지 윈도우에는 문자가 남아
# 있습니다, 이것을 소거하기 위해서 이벤트의 최후로 플러그 스위치
# 를 오프로 해 주세요.
#==============================================================================

#==============================================================================
# ■ 설정 항목
#==============================================================================
module NOVEL
  module Options
    FLAG_SWT = 1        # 소설 모드 변환에 사용하는 게임 스윗치 ID(호칭: 플러그 스위치)
    FONT_SIZE = 20      # 소설 모드의 기본 문자 사이즈 (기본값: 22)
    # 사용하는 폰트, 위 옵션 만큼 우선 순위가 높습니다.
    FONT_NAME = ["휴먼나무", "UmePlus Gothic"]#"UmePlus Gothic"부분은 바꾸지 말것.
  end
end

#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_accessor :novel               # 메세지 윈도우의 타입
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  alias novel_game_temp_initialize initialize
  def initialize
    novel_game_temp_initialize
    @novel = false
  end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # ● 메세지 윈도우의 타입 변환
  #--------------------------------------------------------------------------
  alias novel_scene_map_update update
  def update
    novel_scene_map_update
    if $game_temp.novel != $game_switches[NOVEL::Options::FLAG_SWT]
      $game_temp.novel = $game_switches[NOVEL::Options::FLAG_SWT]
      @message_window.dispose
      @message_window = nil
      @message_window = ($game_temp.novel ? Window_Novel.new : Window_Message.new)
    end
  end
end

#==============================================================================
# ■ Window_Novel
#==============================================================================
class Window_Novel < Window_Message
  #--------------------------------------------------------------------------
  # ● 정수
  #--------------------------------------------------------------------------
  MAX_LINE = 352 / (NOVEL::Options::FONT_SIZE + 8) - 3    # 최대행수
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super
    self.y = 0
    self.height = 416
    create_contents             # 윈도우 내용의 재작성
    self.opacity = 0            # 윈도우를 비표시로 한다
    contents.font.name = NOVEL::Options::FONT_NAME
    contents.font.size = NOVEL::Options::FONT_SIZE
    contents.font.bold = true
    contents.font.shadow = false
    @contents_y = 16            # 차의 문자를 묘화 하는 Y 좌표
    @new_page_lock = false      # 개페이지 제한 플래그
  end
  #--------------------------------------------------------------------------
  # ● 다음의 메세지를 계속해 표시해야할 것인가 판정
  #--------------------------------------------------------------------------
  def continue?
    return true if $game_message.num_input_variable_id > 0
    return false if $game_message.texts.empty?
    return true
  end
  #--------------------------------------------------------------------------
  # ● 윈도우의 배경과 위치의 설정
  #--------------------------------------------------------------------------
  def reset_window
  end
  #--------------------------------------------------------------------------
  # ● 개페이지 처리
  #--------------------------------------------------------------------------
  def new_page
    if @line_count >= MAX_LINE
      contents.clear
      @contents_y = 16
      @line_count = 0
    end
    @contents_x = 16
    @show_fast = false
    @line_show_fast = false
    @pause_skip = false
    contents.font.color = text_color(0)
  end
  #--------------------------------------------------------------------------
  # ● 개행 처리
  #--------------------------------------------------------------------------
  def new_line
    @contents_x = 16
    @contents_y += contents.font.size + 8
    contents.font.size = NOVEL::Options::FONT_SIZE
    @line_count += 1
    @line_show_fast = false
  end
  #--------------------------------------------------------------------------
  # ● 특수 문자의 변환
  #--------------------------------------------------------------------------
  def convert_special_characters
    @text.gsub!(/\V[([0-9]+) ]/i) { $game_variables[$1.to_i] }
    @text.gsub!(/\V[([0-9]+) ]/i) { $game_variables[$1.to_i] }
    @text.gsub!(/\N[([0-9]+) ]/i) { $game_actors[$1.to_i].name }
    @text.gsub!(/\C[([0-9]+) ]/i) { "x01[#{$1}]" }
    @text.gsub!(/\G/)              { "x02" }
    @text.gsub!(/\./)             { "x03" }
    @text.gsub!(/\|/)             { "x04" }
    @text.gsub!(/\!/)              { "x05" }
    @text.gsub!(/\>/)              { "x06" }
    @text.gsub!(/\</)              { "x07" }
    @text.gsub!(/\^/)             { "x08" }
    @text.gsub!(/\P/)             { "x09" }
    @text.gsub!(/\B[([0-9]+) ]/i) { "x10[#{$1}]" }
    @text.gsub!(/\\/)             { "\" }
  end
  #--------------------------------------------------------------------------
  # ● 메세지의 갱신
  #--------------------------------------------------------------------------
  def update_message
    loop do
      c = @text.slice!(/./m)            # 다음의 문자를 취득
      case c
      when nil                          # 묘화 해야 할 문자가 없다
        finish_message                  # 갱신 종료
        break
      when "x00"                       # 개행
        new_line
      when "x01"                       # C[n]  (문자색변경)
        @text.sub!(/[([0-9]+) ]/, "")
        contents.font.color = text_color($1.to_i)
        next
      when "x02"                       # G  (소지금 표시)
        @gold_window.refresh
        @gold_window.open
      when "x03"                       # .  (웨이트 1/4 초)
        @wait_count = 15
        break
      when "x04"                       # |  (웨이트 1 초)
        @wait_count = 60
        break
      when "x05"                       # !  (결정 대기)
        self.pause = true
        @new_page_lock = true
        break
      when "x06"                       # >  (순간 표시 ON)
        @line_show_fast = true
      when "x07"                       # <  (순간 표시 OFF)
        @line_show_fast = false
      when "x08"                       # ^  (바로 넘어감)
        @pause_skip = true
      when "x09"                       # P  (문자열 초기화)
        @line_count = MAX_LINE
      when "x10"                       # B[n]  (문자 사이즈 변경)
        @text.sub!(/[([0-9]+) ]/, "")
        contents.font.size = $1.to_i
        next
      else                              # 보통 문자
        color = contents.font.color.clone
        contents.font.color = Color.new(0, 0, 0)
        w = contents.text_size(c).width
        h = contents.text_size(c).height
        contents.draw_text(@contents_x + 2, @contents_y, w, h, c)
        contents.draw_text(@contents_x, @contents_y + 2, w, h, c)
        contents.draw_text(@contents_x - 2, @contents_y, w, h, c)
        contents.draw_text(@contents_x, @contents_y - 2, w, h, c)
        contents.font.color = color
        contents.draw_text(@contents_x, @contents_y, w, h, c)
        @contents_x += w
      end
      break unless @show_fast or @line_show_fast
    end
  end
  #--------------------------------------------------------------------------
  # ● 커서의 갱신
  #--------------------------------------------------------------------------
  def update_cursor
    if @index >= 0
      h = NOVEL::Options::FONT_SIZE + 8
      y = @contents_y - (@item_max - index) * h - 4
      self.cursor_rect.set(16, y, contents.width - 16, h)
    else
      self.cursor_rect.empty
    end
  end
  #--------------------------------------------------------------------------
  # ● 문장송의 입력 처리
  #--------------------------------------------------------------------------
  def input_pause
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)
      self.pause = false
      if @text == nil or @text.empty?
        terminate_message
      elsif @line_count >= MAX_LINE and not @new_page_lock
        new_page
      end
      @new_page_lock = false
    end
  end
#==============================================================================
# ■ DeadlyDan_MessageSound v2.0 by DeadlyDan
#------------------------------------------------------------------------------
#  Simple "typewriting" style sound when messages are displayed.
#==============================================================================
# Usage:
=begin
 
  Simply change:
 
  MS_SOUND = "Audio/SE/cursor"
 
  To what ever sound file you want, for example:
 
  MS_SOUND = "Audio/SE/cow"
 
  If you want to change how fast it sounds, change
 
  MS_FRAME_INTERVAL = 2
 
  To, for example, if you want longer:
 
  MS_FRAME_INTERVAL = 4

=end

class Window_Message < Window_Selectable
 
  MS_SOUND = "Audio/SE/cursor"
  MS_FRAME_INTERVAL = 2
 
  def update_message
    loop do
      c = @text.slice!(/./m)
      case c
      when nil
        finish_message
        break
      when "x00"
        new_line
        if @line_count >= MAX_LINE
          unless @text.empty?
            self.pause = true
            break
          end
        end
      when "x01"
        @text.sub!(/[([0-9]+)]/, "")
        contents.font.color = text_color($1.to_i)
        next
      when "x02"
        @gold_window.refresh
        @gold_window.open
      when "x03"
        @wait_count = 15
        break
      when "x04"
        @wait_count = 60
        break
      when "x05"
        self.pause = true
        break
      when "x06"
        @line_show_fast = true
      when "x07"
        @line_show_fast = false
      when "x08"
        @pause_skip = true
      else
        if ( @line_show_fast == false and @show_fast == false )
          if ( Graphics.frame_count > ( @last_ms_sound_frame.to_i + MS_FRAME_INTERVAL ) )
            Audio.se_play ( MS_SOUND, 100, 100 )
            @last_ms_sound_frame = Graphics.frame_count
          end
        end
        contents.draw_text(@contents_x, @contents_y, 40, WLH, c)
        c_width = contents.text_size(c).width
        @contents_x += c_width
      end
      break unless @show_fast or @line_show_fast
    end
  end 
 
end
end

Comment '1'
  • profile
    에돌이 2011.07.14 00:59

    [([0-9]+) ] 부분을 전부

    [([0-9]+)] 로 교체해 주세요. (중간에 띄어쓰기 하나 삭제)

    컨트롤 + H 로 찾아 바꾸기 해주시면 편합니다.


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12438
RMVX 소설풍 스크립트 사용시 1 우아니아랱치 2011.07.13 1430
RMVX 아... 예기치 않은 파일형식 ... 이거어떻하죠 ?... 2 OvercomE 2011.04.17 1427
RMVX 이벤트가 이벤트를 생성할 순 없나요? 3 신규회원 2012.02.27 1427
RMVX 캐릭터가 움직이질 않습니다 !! 6 사루바 2011.08.03 1423
RMVX 배포용게임 업데이트시 세이브파일과 런타임 2 unuseid 2011.07.13 1421
RMVX 농장 시스템에관련! 4 은적루 2011.08.03 1421
RMVX 폰트의 크기유지, 1 톰소여동생 2012.06.03 1420
RMVX vx ace 맵칩이나 기타등등 찾다가.. 1 글쎄,왜 난 적용이 안될까? 2012.10.11 1420
RMVX 주인공(초기 플레이어)가 게임 도중 빠지고 다른 파티원이 주인공이 되는 것은 어떻게 하나요 1 엘 크라티아 2012.07.02 1419
RMVX 직접만든 캐릭터가 이상하게작게나와요. 6 file 아만자만즤 2012.05.29 1413
RMVX vx를 쓰면서 궁금해했던 질문입니다. 3 가탁크 2011.09.08 1412
RMVX RPG VX 스킬 관련 질문... 2 광전사 2011.01.13 1411
RMVX 후레쉬 스크립트..? 3 아인이다 2012.10.25 1410
RMVX tankentai sbs에서 주인공의 상태이상 아이콘을 3개 이상 보이게 하고 싶습니다. 2 톰소여동생 2012.06.05 1409
RMVX 아이템을 이용한 상태이상 적용과 해제에 대한 질문입니다. 2 file Lamancha 2012.08.23 1408
RMVX 영어판 rpg vx 에서 폰트 바꾸는 법을 모르겠어요~ 3 교육게임 2011.03.03 1407
RMVX 컨트롤키 누르고 가면 벽뚫는 문제 5 file 위리리릴 2014.05.21 1407
RMVX VX TileE 레이어 질문 3 file 히나나이 2011.04.01 1406
RMVX 소재 이름 앞의 특수기호 3 말뚝이 2013.05.16 1406
RMVX 이벤트와 이벤트가 접촉시 이벤트발동하는법.. kallat 2011.07.31 1405
Board Pagination Prev 1 ... 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ... 127 Next
/ 127