질문과 답변

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 12387
RMVX 게임 데이터의 압축을 실패 하였습니다... 못난이택시 2011.07.17 1327
RMVX 실내 창문에서 빛이들어 오게 할수있나요? 2 hillstate 2011.07.17 1525
RMXP ABS 5.5 hud 질문이여 프레 2011.07.17 1838
RMVX 계단 효과 내기 1 skycat 2011.07.16 1882
RMVX RPGVX 폰트(글씨체) 스크립트 어디서 어떻게 바꾸나요? 4 미라클 2011.07.16 5820
RMVX 대화 도중 상반신이 나오게 하는 법 1 IU[아이유] 2011.07.16 1708
RMXP 페이드인 명령어가 뭐죠? 3 석진이 2011.07.16 1797
기타 RGSS-RTP 3 arc 2011.07.15 5761
RMVX RPGVX 에 관하여 1 arc 2011.07.15 1444
기타 툴의 여러가지 기능상 문제, 혹은 컴퓨터문제. 3 초천재 2011.07.15 1450
기타 게임 만들 때 용어를 알려주세요 1 메이커스 2011.07.15 1294
RMXP 파노라마의 색조변경 어떻게하나요? 2 석진이 2011.07.15 1599
RMXP 조건분기 좀 복잡한 질문입니다 3 CJYG* 2011.07.14 1640
RMXP 셀프스위치 조건분기 오류 도와주세요 2 석진이 2011.07.14 1722
RMVX (해결) 데이터베이스 내용이 짤려서 나옵니다. file genie 2011.07.14 1722
RMXP 메시징방식(?)에 대해 질문이있습니다.. 9 file 초천재 2011.07.14 1466
RMVX 소설풍 스크립트 사용시 1 우아니아랱치 2011.07.13 1430
RMVX 배포용파일 작성시 타이틀 화면 초기화 unuseid 2011.07.13 1200
RMVX 배포용게임 업데이트시 세이브파일과 런타임 2 unuseid 2011.07.13 1421
RMXP rpgxp에서 필드에 들어가지않고 맵에서 전투를 어떻게 하나요? 2 훗훗 2011.07.13 1997
Board Pagination Prev 1 ... 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 ... 516 Next
/ 516