Modifying item description feature/layout question

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
2 lines of text is a joke, is there anyway to change the game script to use the Note text for the item description(because you're allowed plenty of room there), instead of the item description box in the editor?.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
You might want to be cautious about using the note box for something else (if it can be done, that is).  It can be used for all sorts of tags and if you remove that option you eliminate all sorts of other possibilities.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
If you're looking for more than 2 lines of display, you would have to make (scripting) the description-window-space itself bigger, and fix up the other window-spaces to accommodate.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
You might want to be cautious about using the note box for something else (if it can be done, that is).  It can be used for all sorts of tags and if you remove that option you eliminate all sorts of other possibilities.
Oh ok, didn't realize it could be used for light scripting as well(I've seen people put tags in there, but I didn't know it actually effected the item or whatnot "in" game, I just thought it was done, just so the developer can have a easy reminder of what's going on).

If you're looking for more than 2 lines of display, you would have to make (scripting) the description-window-space itself bigger, and fix up the other window-spaces to accommodate.
Changing the description box in game should be easy(ofcourse or you can just make it scroll, so you don't need to edit the other areas), however I don't think It's possible to change the editor its self, so even if the game's box allows for more text, the editor would still be capped at 2 lines.
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Actually text in the editor (for item/equip descriptions) goes beyond the box-space, you would just have to playtest to adjust it though if it needs changing.  I find adjusting easy using an auto-text-wrap script, so I just type away my long descriptions and check in-game.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Actually text in the editor (for item/equip descriptions) goes beyond the box-space, you would just have to playtest to adjust it though if it needs changing.  I find adjusting easy using an auto-text-wrap script, so I just type away my long descriptions and check in-game.
Hm it does,weird(it wont let you hit enter, but if you just keep typing, it allows more text).

I heard of people using a text wrap script to get around the pic+text placement thing, so they don't need to keep track of where their text ends, if that works for the description windows, that would be awesome(but aren't the discription windows designed differently, I imagine I would have to add to the script, to allow you to beable to even scroll down in that window).
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
I use Word Wrap Message Boxes by KilloZapit. It affects all types of windows. (Battle messages, ShowTexts, Skill + Item + Equipment descriptions, etc.)

pic2.png

pic1.png
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Maybe it may be an issue with any custom fonts you're using? (Works fine with the custom font i'm using though)

Any other possible incompatibilities maybe? (It should work fine with Yanfly Message System)

Lastly I don't believe I ever made edits to the script, but here's my copy just in case.

Code:
#========================================================================# ** Word Wrapping Message Boxes, by: KilloZapit#------------------------------------------------------------------------# Changes message boxes so it will automatically wrap long lines.## Note: I consider this script to be public domain, and put no# restrictions on it's use whatsoever. My only request is that# a link back to the script is provided so more people can# access it if they want to.## Version the Second:#   Now strips color codes and icon codes so they don't break words.#   Also calculates icon width along with text width for words.# Version the Third:#   Now also strips delays and other timing related codes.#   Splits for non-icon control codes before counting icons.#   Control codes can now break lines in case of font changes.#   Added some comments to clarify some code.# Version the Forth:#   Fixed a small bug that might cause a error when counting icons.#   Added a small notice for copyright questions.# Version the Fifth:#   Added "collapse" mode, which elimanates extra spaces.#   Can now use "whitespace" mode outside of wordwrap mode if needed.# Version the Sixth:#   Fixed problems with collapsed whitespace not wraping words right.# Version the Seventh:#   Added option to add a margin to the right hand side of the window.#------------------------------------------------------------------------# Also adds the following new escape sequences:## \ww  - Word Wrap: turns word wrap on if it's off# \nw  - No Wrap: Turns word wrap off# \ws  - WhiteSpace mode: Converts newlines to spaces (like HTML)# \nl  - New Line: Preserves hard returns# \cs  - Collapse whiteSpace: Eliminates extra spaces (also like HTML)# \pre - PRE-formatted: Preserves spaces# \br  - line BRake: manual newline for whitespace mode# \rm  - Right Margin: extra space on the right side of the window#========================================================================# Standard config module.module KZIsAwesome  module WordWrap    # change this if you don't want wordwrap on by default.    DEFAULT_WORDWRAP = true    # change this if you want white space mode on by default.    DEFAULT_WHITESPACE = false       # change this if you want white space mode on by default.    DEFAULT_COLLAPSE = true        # change this to add a right margin to the window.    DEFAULT_RIGHT_MARGIN = 0  endendclass Window_Base < Window  include KZIsAwesome::WordWrap  alias_method :initialize_kz_window_base, :initialize  def initialize(x, y, width, height)    initialize_kz_window_base(x, y, width, height)    @wordwrap = DEFAULT_WORDWRAP    @convert_newlines = DEFAULT_WHITESPACE    @collapse_whitespace = DEFAULT_COLLAPSE    @right_margin = DEFAULT_RIGHT_MARGIN    @lastc = "\n"  end  alias_method :process_character_kz_window_base, :process_character  def process_character(c, text, pos)    c = ' ' if @convert_newlines && c == "\n"    if @wordwrap && c =~ /[ \t]/      c = '' if @collapse_whitespace && @lastc =~ /[\s\n\f]/      if pos[:x] + get_next_word_size(c, text) > contents.width - @right_margin        process_new_line(text, pos)      else        process_normal_character(c, pos)      end      @lastc = c    else      @lastc = c      process_character_kz_window_base(c, text, pos)    end  end  def get_next_word_size(c, text)    # Split text by the next space/line/page and grab the first split    nextword = text.split(/[\s\n\f]/, 2)[0]    if nextword      icons = 0      if nextword =~ /\e/i        # Get rid of color codes and YEA Message system outline colors        nextword = nextword.split(/\e[oOcC]+\[\d*\]/).join        # Get rid of message timing control codes        nextword = nextword.split(/\e[\.\|\^<>!]/).join        # Split text by the first non-icon escape code        # (the hH is for compatibility with the Icon Hues script)        nextword = nextword.split(/\e[^iIhH]+/, 2)[0]        # Erase and count icons in remaining text        nextword.gsub!(/\e[iIhH]+\[[\d,]*\]/) do          icons += 1          ''        end if nextword      end      wordsize = (nextword ? text_size(c + nextword).width : text_size( c ).width)      wordsize += icons * 24    else      wordsize = text_size( c ).width    end    return wordsize  end  alias_method :process_escape_character_kz_window_base, :process_escape_character  def process_escape_character(code, text, pos)    case code.upcase    when 'WW'      @wordwrap = true    when 'NW'      @wordwrap = false    when 'WS'      @convert_newlines = true    when 'NL'      @convert_newlines = false    when 'CS'      @collapse_whitespace = true    when 'PRE'      @collapse_whitespace = false    when 'BR'      process_new_line(text, pos)      @lastc = "\n"    when 'RM'      @right_margin = obtain_escape_param(text)    else      process_escape_character_kz_window_base(code, text, pos)    end    # Recalculate the next word size and insert line breaks    # (Needed primarily for font changes)    if pos[:x] + get_next_word_size('', text) > contents.width      process_new_line(text, pos)    end  endend
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Maybe it may be an issue with any custom fonts you're using? (Works fine with the custom font i'm using though)

Any other possible incompatibilities maybe? (It should work fine with Yanfly Message System)

Lastly I don't believe I ever made edits to the script, but here's my copy just in case.

#========================================================================# ** Word Wrapping Message Boxes, by: KilloZapit#------------------------------------------------------------------------# Changes message boxes so it will automatically wrap long lines.## Note: I consider this script to be public domain, and put no# restrictions on it's use whatsoever. My only request is that# a link back to the script is provided so more people can# access it if they want to.## Version the Second:# Now strips color codes and icon codes so they don't break words.# Also calculates icon width along with text width for words.# Version the Third:# Now also strips delays and other timing related codes.# Splits for non-icon control codes before counting icons.# Control codes can now break lines in case of font changes.# Added some comments to clarify some code.# Version the Forth:# Fixed a small bug that might cause a error when counting icons.# Added a small notice for copyright questions.# Version the Fifth:# Added "collapse" mode, which elimanates extra spaces.# Can now use "whitespace" mode outside of wordwrap mode if needed.# Version the Sixth:# Fixed problems with collapsed whitespace not wraping words right.# Version the Seventh:# Added option to add a margin to the right hand side of the window.#------------------------------------------------------------------------# Also adds the following new escape sequences:## \ww - Word Wrap: turns word wrap on if it's off# \nw - No Wrap: Turns word wrap off# \ws - WhiteSpace mode: Converts newlines to spaces (like HTML)# \nl - New Line: Preserves hard returns# \cs - Collapse whiteSpace: Eliminates extra spaces (also like HTML)# \pre - PRE-formatted: Preserves spaces# \br - line BRake: manual newline for whitespace mode# \rm - Right Margin: extra space on the right side of the window#========================================================================# Standard config module.module KZIsAwesome module WordWrap # change this if you don't want wordwrap on by default. DEFAULT_WORDWRAP = true # change this if you want white space mode on by default. DEFAULT_WHITESPACE = false # change this if you want white space mode on by default. DEFAULT_COLLAPSE = true # change this to add a right margin to the window. DEFAULT_RIGHT_MARGIN = 0 endendclass Window_Base < Window include KZIsAwesome::WordWrap alias_method :initialize_kz_window_base, :initialize def initialize(x, y, width, height) initialize_kz_window_base(x, y, width, height) @wordwrap = DEFAULT_WORDWRAP @convert_newlines = DEFAULT_WHITESPACE @collapse_whitespace = DEFAULT_COLLAPSE @right_margin = DEFAULT_RIGHT_MARGIN @lastc = "\n" end alias_method :process_character_kz_window_base, :process_character def process_character(c, text, pos) c = ' ' if @convert_newlines && c == "\n" if @wordwrap && c =~ /[ \t]/ c = '' if @collapse_whitespace && @lastc =~ /[\s\n\f]/ if pos[:x] + get_next_word_size(c, text) > contents.width - @right_margin process_new_line(text, pos) else process_normal_character(c, pos) end @lastc = c else @lastc = c process_character_kz_window_base(c, text, pos) end end def get_next_word_size(c, text) # Split text by the next space/line/page and grab the first split nextword = text.split(/[\s\n\f]/, 2)[0] if nextword icons = 0 if nextword =~ /\e/i # Get rid of color codes and YEA Message system outline colors nextword = nextword.split(/\e[oOcC]+\[\d*\]/).join # Get rid of message timing control codes nextword = nextword.split(/\e[\.\|\^<>!]/).join # Split text by the first non-icon escape code # (the hH is for compatibility with the Icon Hues script) nextword = nextword.split(/\e[^iIhH]+/, 2)[0] # Erase and count icons in remaining text nextword.gsub!(/\e[iIhH]+\[[\d,]*\]/) do icons += 1 '' end if nextword end wordsize = (nextword ? text_size(c + nextword).width : text_size( c ).width) wordsize += icons * 24 else wordsize = text_size( c ).width end return wordsize end alias_method :process_escape_character_kz_window_base, :process_escape_character def process_escape_character(code, text, pos) case code.upcase when 'WW' @wordwrap = true when 'NW' @wordwrap = false when 'WS' @convert_newlines = true when 'NL' @convert_newlines = false when 'CS' @collapse_whitespace = true when 'PRE' @collapse_whitespace = false when 'BR' process_new_line(text, pos) @lastc = "\n" when 'RM' @right_margin = obtain_escape_param(text) else process_escape_character_kz_window_base(code, text, pos) end # Recalculate the next word size and insert line breaks # (Needed primarily for font changes) if pos[:x] + get_next_word_size('', text) > contents.width process_new_line(text, pos) end endend

I'm not using any other scripts, and I'm not using any custom fonts.

The only tampering I have done at all is, I deleted the save listing from the menu, but I don't think that would effect this script(nothing in line 74 even defines listings, nevermind the save listing its self, nor is there a window size variable there for that matter).
 
Last edited by a moderator:

MagicMagor

Veteran
Veteran
Joined
Apr 7, 2012
Messages
201
Reaction score
38
First Language
German
It seems you have made an error when copying the script, because the linked script and the one posted here, don't have the error you encountered.

Ruby is case-sensitive and for whatever reason in your script it tries to access a method "Process_Character", however in the real script the method is called "process_character", which is also the real name. Due to the case-sensivity of ruby, these are interpreted as different methods and the one with the uppercase doesn't exist, so you get the no-method error.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
It seems you have made an error when copying the script, because the linked script and the one posted here, don't have the error you encountered.

Ruby is case-sensitive and for whatever reason in your script it tries to access a method "Process_Character", however in the real script the method is called "process_character", which is also the real name. Due to the case-sensivity of ruby, these are interpreted as different methods and the one with the uppercase doesn't exist, so you get the no-method error.
no sigh, I must've typed it incorectly in my post, sorry about that(I was being carful too, although it was probally super early in the morning when I posted that)

The "actual" message reads

Line 74: NameError occurred.

undefined method "process_character" for class "Window_Base"

Here, I'll post Line 74 for you: alias_method :process_character_kz_window_base, :process_character
 

MagicMagor

Veteran
Veteran
Joined
Apr 7, 2012
Messages
201
Reaction score
38
First Language
German
Then you either pasted the script in the wrong spot (above Window_Base) or something is seriously wrong with your Window_Base script.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
No the Script is under modules.

Hm yea that would make sense, except I din't even touch the Window_Base Script sigh.

I located the def process_character part of the Window_Base script, for anyone who knows Ruby, does this look right?

 #--------------------------------------------------------------------------

  # * Character Processing

  #     c    : Characters

  #     text : A character string buffer in drawing processing (destructive)

  #     pos  : Draw position {:x, :y, :new_x, :height}

  #--------------------------------------------------------------------------

  def process_character(c, text, pos)

    case c

    when "\n"   # New line

      process_new_line(text, pos)

    when "\f"   # New page

      process_new_page(text, pos)

    when "\e"   # Control character

      process_escape_character(obtain_escape_code(text), text, pos)

    else        # Normal character

      process_normal_character(c, pos)

    end

  end
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
But did you paste it above Window_Base? That's the question, not whether you pasted it under Modules or not.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
But did you paste it above Window_Base? That's the question, not whether you pasted it under Modules or not.
No, I put the WordWrap script in It''s own page right in the module section, under the BattleManager module listing.
 
Last edited by a moderator:

Hollow

(◡‿◡✿)
Veteran
Joined
Jul 14, 2012
Messages
519
Reaction score
439
First Language
English
Primarily Uses
RMMV
For most custom scripts, you need to insert them in their own slot below Materials and above Main. Anywhere else and you might cause problems (like what's happening for you now). So to fix your problem, try moving the Word Wrap script there and see if that works.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Derp, gg.

Nooby mistakes for the loss. Hopefully you got it working fine now.

All custom scripts go below Materials and above Main.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top