VX 스크립트

예를 들면 이런겁니다.

스킬의 설명에 "찌질!"을 100번 적어놓으면 전부 표시를 못하는 것이 기존의 VX였죠?

하지만 이제 걱정 끄읕!

스킬의 설명을 아무리 길게 적어도, 문장을 스크롤 해서 보여주기 때문에, 아주 편리하죠!

MP3에 보면 노래 이름이 앞으로 당겨지면서 계속 반복해서 나타나는 거랑 비슷한 겁니다. Advanced Help Configuration Module에서

스크롤 타입을 정할 수 있습니다.

어쨋든! 유용하게 쓰시길 바라고,

아래부터 복사..

#==============================================================================
# ** Advanced Help
#------------------------------------------------------------------------------
#  © Dargor, 2008-2009
#  17/02/09
#  Version 1.3
#------------------------------------------------------------------------------
#  VERSION HISTORY:
#   - 1.0 (02/11/08), Initial release
#   - 1.1 (03/11/08), Now compatible with the Takentai CBS
#   - 1.2 (17/02/09), Text can now scroll vertically using Scroll Mode 2
#   - 1.3 (17/02/09), Now works with text alignment
#------------------------------------------------------------------------------
#  INSTRUCTIONS:
#   - Place this script above Main
#   - Edit the constants in the Advanced Help module and enjoy!
#------------------------------------------------------------------------------
#  Notes
#   This script handles the following message codes.
#   - Color      : C[n]
#   - Variable   : V[n]
#   - Actor Name : N[n]
#   - New Line   : L
#==============================================================================
 
#==============================================================================
# ** Advanced Help Configuration Module
#==============================================================================
 
module Advanced_Help
  # The delay (in frames) before the text starts to scroll
  Scroll_Wait = 120
  # Scroll Mode
  # 0 : Scrolls to left and loops
  # 1 : Scrolls to left and goes back to its origin.
  # 2 : Scrolls down and goes back to its origin when using 2+ lines.
  Scroll_Mode = 0
  # Letter by letter
  Letter_By_Letter = true
end
 
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
#  This window shows skill and item explanations along with actor status.
#==============================================================================
 
class Window_Help < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias dargor_vx_help_scroll_update update
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 544, WLH + 32)
    @scroll_wait = 0
    @scroll_mode = Advanced_Help::Scroll_Mode
    @temp_wait = 0
    @text = ''
    @new_text = ''
    @last_text = ''
    @contents_x = 0
    @line_y = 0
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : character string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align=0)
    @last_text = @text
    if text != @text or align != @align
      self.ox = 0
      self.oy = 0
      self.contents.clear
      @scroll_wait = Advanced_Help::Scroll_Wait
      @text = text
      @new_text = text.dup
      @temp_text = @new_text.dup
      @align = align
      @max_line_y = 0
      @contents_x = 0
      if align == 1
        @contents_x = ((self.width - get_contents_width) / 2) - 16
      elsif align == 2
        @contents_x = (self.width - get_contents_width) - 32
      end
      if @scroll_mode == 2
        ch = (get_contents_height + 1) * WLH
        self.contents = Bitmap.new(self.width - 32, ch)
      else
        cw = [contents.text_size(text).width + 16, 32].max
        self.contents = Bitmap.new(cw, WLH)
      end
      convert_special_characters
    end
  end
  #--------------------------------------------------------------------------
  # * Get the number of lines in the text
  #--------------------------------------------------------------------------
  def get_contents_height
    @temp_text.gsub!(/L/)              { @max_line_y += 1 }
    return @max_line_y
  end
  #--------------------------------------------------------------------------
  # * Get the width of the text
  #--------------------------------------------------------------------------
  def get_contents_width
    @temp_text.gsub!(/V[([0-9]+)]/i) { $game_variables[$1.to_i] }
    @temp_text.gsub!(/N[([0-9]+)]/i) { $game_actors[$1.to_i].name }
    @temp_text.gsub!(/C[([0-9]+)]/i) { "" }
    @temp_text.gsub!(/L/)              { "" }
    return self.contents.text_size(@temp_text).width
  end
  #--------------------------------------------------------------------------
  # * Convert Special Characters
  #--------------------------------------------------------------------------
  def convert_special_characters
    @new_text.gsub!(/V[([0-9]+)]/i) { $game_variables[$1.to_i] }
    @new_text.gsub!(/V[([0-9]+)]/i) { $game_variables[$1.to_i] }
    @new_text.gsub!(/N[([0-9]+)]/i) { $game_actors[$1.to_i].name }
    @new_text.gsub!(/C[([0-9]+)]/i) { "x01[#{$1}]" }
    @new_text.gsub!(/G/)              { "x02" }
    @new_text.gsub!(/./)             { "x03" }
    @new_text.gsub!(/|/)             { "x04" }
    @new_text.gsub!(/!/)              { "x05" }
    @new_text.gsub!(/>/)              { "x06" }
    @new_text.gsub!(/</)              { "x07" }
    @new_text.gsub!(/^/)             { "x08" }
    @new_text.gsub!(/L/)              { "x09" }
    @new_text.gsub!(/\/)             { "" }
  end
  #--------------------------------------------------------------------------
  # * Update Message
  #--------------------------------------------------------------------------
  def update_message
    # Draw text letter by letter
    if Advanced_Help::Letter_By_Letter
      loop do
        c = @new_text.slice!(/./m)            # Get next text character
        case c
        when nil                          # There is no text that must be drawn
          break
        when "x01"                       # C[n]  (text character color change)
          @new_text.sub!(/[([0-9]+)]/, "")
          contents.font.color = text_color($1.to_i)
          next
        when "x09"
          @contents_x = 0
          @line_y += 1
        else                              # Normal text character
          contents.draw_text(@contents_x, @line_y * WLH, 40, WLH, c)
          c_width = contents.text_size(c).width
          @contents_x += c_width
        end
        break
      end
    # Draw the whole text
    else 
      while (c = @new_text.slice!(/./m)) != nil
        case c
        when nil                          # There is no text that must be drawn
          break
        when "x01"                       # C[n]  (text character color change)
          @new_text.sub!(/[([0-9]+)]/, "")
          contents.font.color = text_color($1.to_i)
          next
        when "x09"
          @contents_x = 0
          @line_y += 1
        else                              # Normal text character
          contents.draw_text(@contents_x, @line_y * WLH, 40, WLH, c)
          c_width = contents.text_size(c).width
          @contents_x += c_width
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Draw text
    update_message
    # The usual
    dargor_vx_help_scroll_update
    # Scroll text
    @scroll_wait -= 1
    if @temp_wait > 0
      @temp_wait -= 1
      @temp_wait = -1 if @temp_wait == 0
      return
    else
      if self.oy != 0 && @temp_wait == -1
        self.oy -= 1 if Graphics.frame_count % 2 == 0
        if self.oy % WLH == 0
          @temp_wait = Advanced_Help::Scroll_Wait
          return
        end
        @temp_wait = 0 if self.oy == 0
        return
      end
    end
    if @scroll_mode != 2
      if self.contents.width > self.width && @scroll_wait < 0
        self.ox += 1
        @scroll_wait = Advanced_Help::Scroll_Wait if self.ox == 0
      end
    else
      if self.contents.height + 32 > self.height && @scroll_wait < 0
        self.oy += 1 if Graphics.frame_count % 2 == 0
        if self.oy % WLH == 0
          if self.oy > self.contents.height - WLH
            @temp_wait = Advanced_Help::Scroll_Wait
          else
            @scroll_wait = Advanced_Help::Scroll_Wait
          end
          return
        end
        #@scroll_wait = Advanced_Help::Scroll_Wait if self.oy == 0
      end
    end
    case @scroll_mode
    when 0
      if self.ox > self.contents.width
        self.ox = (-self.contents.width + 64)
      end
    when 1
      if self.ox > self.contents.width + 64
        self.ox = 0
        @scroll_wait = Advanced_Help::Scroll_Wait
      end
    when 2
      if self.oy > self.contents.height - WLH
        @temp_wait = Advanced_Help::Scroll_Wait
        @scroll_wait = Advanced_Help::Scroll_Wait
      end
    end
  end
end
 
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
 
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_advanced_help_battle_update_basic update_basic
  #--------------------------------------------------------------------------
  # * Basic Update Processing
  #     main : Call from main update method
  #--------------------------------------------------------------------------
  def update_basic(main = false)
    dargor_vx_advanced_help_battle_update_basic(main)
    @help_window.update unless @help_window.nil?
  end
end

이상! 루시페르였습니다!
Comment '13'
  • ?
    Zero_Som 2009.06.06 18:04
    허걱 길어지는거군요!
  • profile
    레이♡ 2009.06.07 17:00

    꽤 유용할지도.....

    문장이 안보여서 불편하다면 ㅋㅋ;;

  • ?
    백년술사 2009.06.09 22:53

    설명을 많이 할수있는건가요?

    어쨌든 좋을듯..(씨익)
  • ?
    Berylll 2009.10.18 15:12
    잘쓰겟습니다 ㅎㅎ.
  • ?
    1000℃ 복숭아 2009.10.19 15:48

    잘 쓰겠습니다~

     

  • ?
    뉴공 2009.11.05 13:38

    그 사이드뷰 배틀스트립트와 같이쓰면

    전투 도중 화면 상단에 기술이나 방어를 사용할때 나오는 문장이 출력되지 않습니다.

    여러모로 시도해보니 스크롤 타입을 '2'로 했을 경우에만 정상적으로 출력되더군요.

    참고하시길.

  • ?
    뉴공 2009.11.05 13:38
    아, 그리고 정말 좋은 스크립트네요 ㅎㅎ
  • ?
    뉴공 2009.11.05 13:43

    아, 확인해보니 스크롤타입이 '2' 일 경우에는 문장이 제대로 출력되지 않는군요.....;;

    결국은 사이드뷰 배틀스크립트와는 같이 못쓴다는 말이죠.

  • ?
    키레이 2010.11.21 21:17

    그래도 아이템 설명 쓰는 곳 자체에 글자수 제한이 있으니 뭐,

    그래도 감사히 받겠습니다!

  • ?
    이클립스 2010.12.16 00:23

    감사합니다!! 정말 좋군요!!

    안그래도 글자 잘리는 것 때문에 고민하고 있었는데...

    덕분에 해결이 되네요..^^

  • ?
    구제가능 2011.07.24 18:09

    난 왜 안될까

  • profile
    개촙포에버 2011.07.28 16:51

    어..스크립트가 뭔가 이상한데요?붙여넣었더니 아랫부분이 분홍색으로 변했네요.

  • ?
    크런키맛아듀크림 2011.10.30 21:57

    이거 에러..


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
337 기타 KGC 스크립트 라이브러리 7 훈덕 2009.05.31 2611
336 메뉴 시스템 옵션 스크립트의 사용방법 6 아방스 2009.06.04 2832
335 기타 (좀 이상한 or 쓸모없을 듯 한)화면상에 몬스터와 만나려면 몇걸음 남았는지 표시하는 스크립트! 2 루시페르 2009.06.06 2318
334 기타 던전에 적정 레벨이 어떤건지 스크린에 표시해주는 스크립트! 5 file 루시페르 2009.06.06 2907
» 기타 문장의 스크롤! 13 루시페르 2009.06.06 2524
332 기타 좀 뭐랄까... 어이없는 "비행선 더 높게 날아오르게 하기!"스크립트.... 8 루시페르 2009.06.06 2426
331 기타 적 선택시 스킬창 비표시 + 타겟 플래쉬 7 훈덕 2009.06.14 2094
330 메뉴 스테이터스 화면 개조 - 커스텀 버전 13 file 훈덕 2009.06.15 4932
329 타이틀/게임오버 맵 타이틀 스크립트 48 아방스 2009.06.17 5547
328 전투 카운트배틀 시스템(스크립트 한글살짝번역) 10 file 카르와푸딩의아틀리에 2009.06.17 5520
327 온라인 VX Phoenix 온라인 스크립트 1.3버전 12 아방스 2009.06.18 3486
326 메뉴 전투승리시 아이템 경험치팝업창 스크립트 18 file 카르와푸딩의아틀리에 2009.06.23 3760
325 전투 Requiem ABS 8 - 액션 배틀 시스템 8 36 아방스 2009.06.24 8539
324 전투 ATB전투방식.(사이드뷰X 백발의카임전투방식O) 14 file 이피쿤 2009.06.24 9035
323 메시지 조합한글 21 file 허걱 2009.06.27 4409
322 기타 그림을 각도로 회전시키기 1 허걱 2009.06.30 2327
321 기타 경험치 백분율 계산 2 허걱 2009.06.30 3093
320 직업 서브클래스 선택 시스템 Subclass Selection System 7 file 카르와푸딩의아틀리에 2009.06.30 3942
319 기타 미니게임테트리스 스크립트 ㅋㅋㅋ 27 file 카르와푸딩의아틀리에 2009.06.30 3688
318 기타 시야범위 스크립트 22 file 카르와푸딩의아틀리에 2009.06.30 4025
Board Pagination Prev 1 ... 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ... 32 Next
/ 32