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
637 전투 VLAD ABS [액알 시스템] 65 아방스 2009.01.07 12563
636 전투 vampyr SBABS-Requiem ABS 9(액알) 101 file 담먹캐 2009.11.01 11999
635 HUD rpg 만들기 vx - 맵이름 띠우는 스크립트 ^^ 74 아방스 2008.01.27 11919
634 HUD PRABS v1.0 [hud,주석액알,원거리공격,hotkeys,vx] 대박감이다. 47 유칸지 2008.08.13 11114
633 전투 사이드뷰배틀3.3 + ATB1.1 스크립트. 65 할렘 2009.02.01 10945
632 전투 ORBS [새로운 전투 방식] 48 file 아방스 2009.03.04 10207
631 그래픽 3D그래픽 파티클엔진 45 file RPGbooster 2008.10.08 10130
630 전투 rpgvx 간단액알 스크립트 제작: 41 *PS 2008.02.07 9820
629 메뉴 (모그메뉴 풀세트팩 SEL Style.) 유니크급 자료 147 file 할렘 2009.02.07 9558
628 전투 RPG Tankentai SBS 3.3 + ATB Kaduki Eng 58 아방스 2009.02.05 9071
627 전투 ATB전투방식.(사이드뷰X 백발의카임전투방식O) 14 file 이피쿤 2009.06.24 9035
626 메뉴 일본에서 만든 멋있는메뉴변경 스크립트 (한글 VX에서 쓰시면 자동으로 바뀜) 45 유칸지 2008.04.09 8861
625 전투 WGB배틀 시스템. 59 file 카르와푸딩의아틀리에 2009.06.30 8776
624 전투 Crissaegrim ABS 2.0.5 최신 48 file RPGbooster 2008.10.08 8765
623 전투 Requiem ABS 8 - 액션 배틀 시스템 8 36 아방스 2009.06.24 8539
622 전투 RPGTankentai SBS3.3b 버전 (사이드뷰) 21 file 카르와푸딩의아틀리에 2009.07.01 8455
621 전투 사이드뷰 스크립트 [2003 전투 방식] 39 아방스 2008.03.09 8406
620 맵/타일 RPG 만들기 VX 로 구현한 3D~ 42 아방스 2008.09.02 8405
619 메뉴 메뉴변경 스크립트 34 아방스 2008.01.24 7937
618 전투 PRABS 2.0 액션배틀시스템 58 file RPGbooster 2008.10.08 7571
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32