Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Need Help! Horizontal Choices!

Save-Point

Full Version: Need Help! Horizontal Choices!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey!
So I'm not the greatest with scripting, and so I need help desperately with something that would probably be incredibly easy to most people.

So, I'm using Dubealex's Advanced Message Script R4 (just thought I'd mention that in case it's important) and it's perfect, I love it and it's exactly what I need for my game.

HOWEVER.

I really need the option to Show Choices to display horizontally rather than vertically. For example:

This is what it is now:
"Will you take the Shotgun?
>Yes
>No"

This is what I need it to be:
"Will you take the Shotgun?
>Yes >No"

Someone please help meee!
That is surprisingly a hard thing to do, just because of how RPG XP renders choices and text together. And I am not sure if that script you are using changes it. Maybe someone more familiar with it can help you.

Can I ask why you need choices to be displayed in this way? It would limit how long you could make choices, even more than RPG Maker already does.
Please leave either a copy or a link to a thread with your custom message system. If something custom has to be made, it would be easier to create your needed effect to work with your project.

Normally, the code that draws choices within a messagebox appears as such...
Code:
# Set choice to message_text
    for text in parameters[0]
      # just add index for array
      $game_temp.message_text[@msgindex] += text + "\n"
    end
This just cycles through choices you sent, and the funcy \n makes line breaks.
http://textuploader.com/t1n9

This is a link to the exact script I'm using, containing the minute changes I've made to the message box size and position, etc. :)
That's just RPG Maker XP being dumb. I fixed text being cut off in my project's code (which I'll happily share with you if you ask), but you can also use something like ExtendText as a solution.
http://www.2shared.com/file/Hntb0jAC/ExtendText.html

Just run it when you have the Show Text window open and it will get longer.

here, I'll give it to you anyways.
Code:
#---------------------------------------------------------------------------
  #*Wrap
  #---------------------------------------------------------------------------
  def word_wrap(text, width=40)
    #figure out why this works.
    text.gsub(/(.{1,#{width}})( +|$\n?)|(.{1,#{width}})/, "\\1\\3\n")
  end

add that into your script (inside the class Window_Message definition) and then add <edit, bugfix>
Code:
@now_text.gsub!("\n", "")
  @now_text = word_wrap(@now_text)

to the end of
Code:
@now_text.gsub!(/\\[.]/) { "\005" }
  @now_text.gsub!(/\\[|]/) { "\006" }
  @now_text.gsub!(/\\[>]/) { "\016" }
  @now_text.gsub!(/\\[<]/) { "\017" }
  @now_text.gsub!(/\\[!]/) { "\020" }
  @now_text.gsub!(/\\[~]/) { "\021" }
  @now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
  @now_text.gsub!(/\\[Ii]/) { "\023" }
  @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" }

and all text should automatically resize to fit the window.
Words cannot describe how much I love you right now. Thank you so much.
Do I have to credit anybody if I use this for my game? (Not that my game is royalty-free anyway, I have a lot of people and stuff to credit haha)
Only if you want/need your credits to be longer than "me, myself, and I." I keep the best stuff for myself; the obvious, and obviously useful stuff I give freely. So use in commercial/non-commercial games or any other ways.
I'm using the same message script as kasikarbon, so this request caught my attention. but I can't seem to get MechanicalPen's fix to work.

Can you clarify where should I put the "Warp code" inside the Window_Message definition?
You just have to put it somewhere inside
Code:
def Window_Message
#stuff
#stuff
#---
end
Are you getting a "no method" error or something?
No, I'm not getting any error.

Basically I have the same problem regarding cut-off text. I put the Warp code in the Advance Message Script just above this part:

Code:
@now_text.gsub!(/\\[.]/) { "\005" }
   @now_text.gsub!(/\\[|]/) { "\006" }
   @now_text.gsub!(/\\[>]/) { "\016" }
   @now_text.gsub!(/\\[<]/) { "\017" }
   @now_text.gsub!(/\\[!]/) { "\020" }
   @now_text.gsub!(/\\[~]/) { "\021" }
   @now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
   @now_text.gsub!(/\\[Ii]/) { "\023" }
   @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
   @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
   @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
   @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" }
   @now_text = word_wrap(@now_text)

Yet the text still looks like this:

[Image: 1pBN2YC.png]
Pages: 1 2