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 이동 및 탈것 대쉬금지의 변경 1 rukan 2009.07.02 1449
336 기타 배틀신에서 곡 넘기기 2 rukan 2009.07.02 1757
335 HUD HUD HP / MP 게이지바 스크립트 29 file 아방스 2009.07.02 5677
334 온라인 VX Phoenix 온라인 스크립트 Ver 1.5 36 아방스 2009.07.02 5510
333 기타 페이드 시간 변경 2 rukan 2009.07.01 1360
332 오디오 사운드 자동 변환 설정 rukan 2009.07.01 1461
331 이동 및 탈것 탈것탑승후 내부로 이동하는 스크립트 16 file 카르와푸딩의아틀리에 2009.07.01 3268
330 기타 밤낮의 변화에 따른 전투배경의 변화 스크립트 10 file 카르와푸딩의아틀리에 2009.07.01 2948
329 기타 높이(층)를 설정하는 스크립트 11 file 카르와푸딩의아틀리에 2009.07.01 3343
328 전투 RPGTankentai SBS3.3b 버전 (사이드뷰) 21 file 카르와푸딩의아틀리에 2009.07.01 8455
327 전투 WGB배틀 시스템. 59 file 카르와푸딩의아틀리에 2009.06.30 8777
326 기타 회피,명중,크리 스테이트를 작성하는 스크립트 9 카르와푸딩의아틀리에 2009.06.30 2393
325 메뉴 전투 결과 팝업 스크립트 12 file 카르와푸딩의아틀리에 2009.06.30 3381
324 메뉴 몬스터도감 심플버전! 52 file 카르와푸딩의아틀리에 2009.06.30 6907
323 이동 및 탈것 달리면 스태미너가 감소하는 스크립트 18 file 카르와푸딩의아틀리에 2009.06.30 2869
322 기타 미니게임 로또??일까? 14 file 카르와푸딩의아틀리에 2009.06.30 2577
321 메시지 어드밴스 텍스트 시스템 13 file 카르와푸딩의아틀리에 2009.06.30 4918
320 기타 시야범위 스크립트 22 file 카르와푸딩의아틀리에 2009.06.30 4025
319 기타 미니게임테트리스 스크립트 ㅋㅋㅋ 27 file 카르와푸딩의아틀리에 2009.06.30 3689
318 직업 서브클래스 선택 시스템 Subclass Selection System 7 file 카르와푸딩의아틀리에 2009.06.30 3942
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