Main Menu
  • Welcome to The RPG Maker Resource Kit.

Text Operators in Map Screen Names - RPG Maker VX Ace

Started by chair24, August 21, 2012, 05:51:01 AM

0 Members and 2 Guests are viewing this topic.

chair24

Hi there and thanks for viewing my post.

I was wondering if anyone would know a possible method to have text operators work on map names (i.e the ones that appear at the top-left of the screen as you enter). In particular, I'm interested in having /N working for EnterNameHere's House or something so that would display on the screen.

Many thanks!

modern algebra

Well, there are actually a couple ways in which we can accomodate you, but I recommend my own Global Text Codes script. It will allow you to use any message codes anywhere as long as you also put a \* somewhere in the message. In other words, once you insert the script into the Script Editor, all you need to do is place the following into the Display Message slot of a map:

\*\n[1]'s House

That will allow you to any message code you want in the map name window or any other window, for that matter.

P.S. I notice that you put /N[i] as your example. Please note that it is actually supposed to be a \, not a /.

chair24

Thank you very much, I really appreciate your help and that was very easy to apply! It works absolutely fine and that script seems to do a lot more than just what I needed there!

Thanks for the slash comment, yeah I always make that mistake, I suppose it's because we use / more often than \ with the keyboard, heh...

I have one other quick question, is there any way using your Global Test Codes script that I can allow longer map titles to appear onscreen? Like 25 characters or so? Thanks!

modern algebra

#3
Yes and no. You can use a replacement code to avoid the space limitations of the program, by creating an entry in the MAGTC_RCODES hash. Ie. go to this part of the script:


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
#//////////////////////////////////////////////////////////////////////////////
}


Add in the following line below the line that starts with 2 => (you can actually delete these lines if you want as they are just samples):


  3 => "The Forest Outside \\n[4]'s House",


Then, in the actual display name field, you would write:

\*\r[3]

However, the actual window its being drawn in is only 240 pixels wide, so any name that exceeds that will be cut off. To fix that, you would need to increase the size of the window by inserting the following code into its own slot in the Script Editor above Main and below Materials:


class Window_MapName
  def window_width
    return 400
  end
end


You can replace the 400 with any number between 25 and your resolution size (you could use Graphics.width if you wanted to be the width of the entire screen), but keep in mind that since the window is the same for all map names and the name is centre-aligned, it might look a little silly for smaller names.

chair24

You are a total genius, thank you very much and thanks for your prompt replies!   :D

modern algebra