질문과 답변

Extra Form

아마 외부스크립트가져온거 때문에 그런거 같은데 

Ace message system 요건 아닌거 같구 

글씨색을 지정할 수 있게 해주는 스크립트 때문인거같은데 

 

아래는 스크립트 전문입니다. 

 


#==============================================================================
#    Global Text Codes [VXA]
#    Version: 1.0a
#    Author: modern algebra (rmrk.net)
#    Date: April 5, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to use special message codes in any window, not
#   just message windows and help windows. Want to add an icon next to the 
#   menu commands? With this script you can do that and more.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Simply paste this script into its own slot above Main and below Materials
#   and other custom scripts.
#
#    There are two settings for this script - automatic and manual. If set to
#   automatic, then all you will need to do is put any of the special message
#   codes in anything and they will automatically work. If set to manual, then
#   you will also need to type the following code somewhere in the text field 
#   to activate it: \*
#
#    The following default codes are available:
#
# \c[n] - Set the colour of the text being drawn to the nth colour of the 
#     Windowskin palette. 0 is the normal color and 16 is the system color.
# \i[n] - Draw icon with index n.
# \p[n] - Draw the name of the actor in the xth position in the party. 1 is 
#     the party leader, 2 is the second member, etc.
# \n[n] - Draw the name of the actor with ID n
# \v[n] - Draw the value of variable with ID n.
# \g - Draws the unit of currency.
#
#    Depending on whether you are using any custom message script, you may have 
#   additional message codes at your disposal. This script is mostly compatible
#   with my ATS and every code except \x and ones related to message control 
#   will work.
#==============================================================================

$imported = {} unless $imported
$imported[:MAGlobalTextCodes] = true
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#  Editable Region
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#  MAGTC_MANUAL_CODES - If this is true, then you must put a \* code in any 
# field that you want to have codes interpreted in. Otherwise, codes will 
# always automatically be interpreted. The recommended value for this is true,
# as the process for drawing text with codes is much slower than the process 
# for drawing text without codes.
MAGTC_MANUAL_CODES = true
#  MAGTC RCODES - This feature is designed to overcome the space limitations in
# much of the database - since codes take so much of that space, it might be
# difficult to write everything you want into one of those fields. This feature
# permits you to write the term you want in to the following array, and then 
# access it in the database with the code \r[n], where n is the ID you assign 
# to the phrase in the following way:
#
#    n => "replacement",
#
# Please note that: it is =>, not =; the replacement must be within quotation 
# marks; and there must be a comma after every line. If using double quotation
# marks ("", not ''), then you need to use two backslashes to access codes 
# instead of one (\\c[1], not \c[1]).
#
#  EXAMPLE:
#   0 => "\\i[112]\\c[14]New Game\\c[0]",
#
#  Under the New Game field in the Terms of the Database, all I would then need 
# to put is:
#    \*\r[0]
#  and it would be the same as if I had put:
#    \*\i[112]\c[14]New Game\c[0]
MAGTC_RCODES = { # <- Do not touch
  0 => "\\i[112]\\c[14]New Game\\c[0]", # Example
  1 => "", # You can make as many of these as you want
  2 => "\\i[40]Blood Hound",
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#  END Editable Region
#//////////////////////////////////////////////////////////////////////////////
}
MAGTC_RCODES.default = ""

#==============================================================================
# ** Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - draw_text; convert_escape_characters; process_new_line;
#      reset_font_settings
#    new methods - magtc_align_x; magtc_test_process_escape_character;
#      magtc_calc_line_width
#==============================================================================

class Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Text
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_gtc_drwtxt_3fs1 draw_text
  def draw_text(*args, &block)
    # Get the arguments
    if args[0].is_a?(Rect)
        x, y, w, h = args[0].x, args[0].y, args[0].width, args[0].height
        text, align = *args[1, 2]
      else
        x, y, w, h, text, align = *args[0, 6]
      end
    align = 0 unless align
    #  Draw normally if text is not a string, draw normally if the text is not
    # long enough to hold a code, and draw normally when the script is set to 
    # manual and \* is included in the text
      if !text.is_a?(String) || text.size < 2 || (MAGTC_MANUAL_CODES && text[/\\\*/].nil?)
        ma_gtc_drwtxt_3fs1(*args, &block) # Run Original Method
      else
      @magtc_reset_font = contents.font.dup # Do not automatically reset font
      @magtc_rect, @magtc_align = Rect.new(x, y, w, h), align
      # Get first line of the text to test for alignment
      @magtc_test_line = convert_escape_characters(text[/.*/])
      y += [(h - calc_line_height(@magtc_test_line)) / 2, 0].max
      # Draw text with message codes
        draw_text_ex(magtc_align_x(x), y, text)
      @magtc_reset_font = nil # Do not automatically reset font
      @magtc_rect, @magtc_align = nil, nil # Reset Rect and Alignment
      end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Convert Escape Characters
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_gtc_convescchar_5tk9 convert_escape_characters
  def convert_escape_characters(text, *args, &block)
    # Remove \* codes
    new_text = text.gsub(/\\\*/, "")
    # Substitute for the R Codes
    new_text.gsub!(/\\[Rr]\[(\d+)\]/) { MAGTC_RCODES[$1.to_i].to_s }
    ma_gtc_convescchar_5tk9(new_text, *args, &block) # Call Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Reset Font Settings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias magtc_resetfonts_4ga5 reset_font_settings
  def reset_font_settings(*args, &block)
    magtc_resetfonts_4ga5(*args, &block) # Call Original Method
    contents.font = @magtc_reset_font if @magtc_reset_font
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Process New Line
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias magtc_prcsnewl_5gn9 process_new_line
  def process_new_line(text, pos, *args, &block)
    magtc_prcsnewl_5gn9(text, pos, *args, &block) # Run Original Method
    if @magtc_align && @magtc_rext
      @magtc_test_line = text[/.*/] # Get new line
      pos[:x] = magtc_align_x       # Get the correct x, depending on alignment
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Alignment X
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def magtc_align_x(start_x = @magtc_rect.x)
    return start_x unless (@magtc_rect && @magtc_align && @magtc_test_line) || @magtc_align != 0
    tw = magtc_calc_line_width(@magtc_test_line)
    case @magtc_align
    when 1 then return start_x + ((@magtc_rect.width - tw) / 2)
    when 2 then return start_x + (@magtc_rect.width - tw)
    end
    start_x
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Calc Line Width
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def magtc_calc_line_width(line)
    # Remove all escape codes
    line = line.clone
    line.gsub!(/[\n\r\f]/, "")
    real_contents = contents # Preserve Real Contents
    # Create a dummy contents
    self.contents = Bitmap.new(@magtc_rect.width, @magtc_rect.height)
    reset_font_settings
    pos = {x: 0, y: 0, new_x: 0, height: calc_line_height(line)}
    tw = 0
    while line[/^(.*?)\e(.*)/]
      tw += text_size($1).width
      line = $2
      # Remove all ancillaries to the code, like parameters
      code = obtain_escape_code(line)
      magtc_test_process_escape_character(code, line, pos)
    end
    #  Add width of remaining text, as well as the value of pos[:x] under the 
    # assumption that any additions to it are because the special code is 
    # replaced by something which requires space (like icons)
    tw += text_size(line).width + pos[:x]
    self.contents.dispose # Dispose dummy contents
    self.contents = real_contents # Restore real contents
    return tw
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Test Process Escape Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def magtc_test_process_escape_character(code, text, pos)
    if $imported[:ATS_SpecialMessageCodes] && ['X', 'HL'].include?(code.upcase)
      obtain_escape_param(text)
      return
    end

 


    process_escape_character(code, text, pos)
  end
end

 

질문! 11.png

데이터 베이스 에는 그냥 세칸이내의적에게 

[~~]만큼 ~~ 

이런식으로 엔터만 쳐져있습니다. 모든 스킬, 아이템 관련 문장이 이렇게 뜨고있습니다. 

Comment '3'
  • ?
    프리마리모 2016.04.05 23:31
    일단 음표를 미친듯이 띄어쓰기해서 화면밖으로 보내버리는 식으로 대충해결했습니다. 데이터베이스량이 겁나 많아서... 이거 하나하나 다하려고 생각하니까 좀 깝깝하긴 하네요.
  • ?
    Alkaid 2016.04.06 06:31
    그거 폰트문제일 수도 있습니다.
    http://forums.rpgmakerweb.com/index.php?/topic/1131-rgss3-unofficial-bugfix-snippets/
    여기서 Custom Font Junk Symbol Fix를 찾아서 적용하기 바랍니다.
  • ?
    프리마리모 2016.04.06 21:17
    캬 기가막히게 깔끔하게 해결 ㅠㅠ 정말 감사합니다!!

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12391
RMVXA 로고 스크립트 아시는 분 계신가요? 3 민송 2017.06.21 168
RMVXA 고수분들 도와주세요! 자꾸 스크립트에 NoMethodError undefined method ~~for nil:NilClass가 뜨네요 ㅠ 미스터챈 2017.02.21 168
RMVXA [턴제전투] 특정 액터가 죽으면 전투에서 패배하는법 6 기폭 2017.02.15 168
RMVXA 타일셋 적용 질문 file 쑤수 2017.01.21 168
RMXP 오컬트 사타닉한 분위기의 맵타일셋을 찾고있습니다. 오늘밤어때 2017.01.02 168
RMVXA 이도류 시 연속 공격 깡쨩 2016.10.29 168
RMVXA 저장 시 캐릭터가아닌 페이스 가 나오게 할 수 있나요? 1 file 파랑빛 2016.08.16 168
RMVXA 스크립트 적용법 1 file 리오노 2017.08.11 168
RMVXA 고수님들!! 부탁드려요!! 3 김두두 2015.12.06 168
RMVXA 변수 난수에 대해 질문드립니다. 1 몽롱하다 2015.11.21 168
기본툴 사용법 RMMV 이동속도 조절하는 법 알려주세요 1 퐁핑퐁 2019.06.28 168
RMVXA 대열 변경을 했을때, 선두 캐릭터의 그래픽이 바뀌지않는 방법이 있나요? 2 겜맨602 2015.04.04 168
RMVXA 싸우다, 도망치다를 없애고 싶어요. file 로멘렉스 2016.01.12 168
플러그인 사용 RMMV 기본키 이외에 다른키 입력 받는법을 알고 싶습니다. 2 MSM 2019.02.11 168
RMVXA 스킬이나 아이템 등 데이터베이스에서 엔터를 치면 인게임에서 음표가 뜹니다. 3 file 프리마리모 2016.04.05 168
RMVXA Rpg vx ace 자작 칩 file SEWASHI 2017.10.20 168
플러그인 추천 RMMV 스킬을 선택해서 삭제하는 플러그인 있나요??? 6 호구랑 2019.03.19 168
기타 RMVXA 그 게임시작하자마자 맵이 어두운상태에서 문장표시하는거 어떻게하나요? 1 krmojo 2022.03.12 168
라이선스 RMMV MV 모바일 포팅때 글꼴파일을 게임 안에 넣어야하나요? 잠행인 2016.08.26 167
RMMV rpg mv 플러그인 사이트 2 BKJNK 2018.05.16 167
Board Pagination Prev 1 ... 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 ... 516 Next
/ 516