Save-Point
Need Help! Horizontal Choices! - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: Script Requests (https://www.save-point.org/forum-40.html)
+---- Thread: Need Help! Horizontal Choices! (/thread-5095.html)

Pages: 1 2


Need Help! Horizontal Choices! - kasikarbon - 04-09-2014

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!


RE: Need Help! Horizontal Choices! - MechanicalPen - 04-09-2014

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.


RE: Need Help! Horizontal Choices! - Olivia - 04-09-2014

It looks like a style of text game. Completely understandable because I needed this for mine. I'll have a look around for you.

Edit: http://forums.rpgmakerweb.com/index.php?/topic/16160-choice-window-edit/

This is the closest thing I could find for your request. Look at the bottom of the thread.


RE: Need Help! Horizontal Choices! - kasikarbon - 04-10-2014

(04-09-2014, 11:03 PM)Olivia Wrote: It looks like a style of text game. Completely understandable because I needed this for mine. I'll have a look around for you.

Edit: http://forums.rpgmakerweb.com/index.php?/topic/16160-choice-window-edit/

This is the closest thing I could find for your request. Look at the bottom of the thread.
I had a look at that one yeah, but it didn't quite work, most likely because I'm using an modified message script.

I need them to be horizontal because I've modified the text box to display 640x130, which only allows for 3 lines of text. I wanted it this way because I wanted to keep the text very conserved.

Most items are fine, they look like this:
http://oi59.tinypic.com/fthds1.jpg
But some items have longer names, and it causes this problem:
http://oi59.tinypic.com/2ljkyg1.jpg

So either, if you guys could help me find a way of creating horizontal choices, or if there's a way to extend the text to the same width as the message box, that'd be great. :)


RE: Need Help! Horizontal Choices! - DerVVulfman - 04-10-2014

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.


RE: Need Help! Horizontal Choices! - kasikarbon - 04-10-2014

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. :)


RE: Need Help! Horizontal Choices! - MechanicalPen - 04-10-2014

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.


RE: Need Help! Horizontal Choices! - kasikarbon - 04-11-2014

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)


RE: Need Help! Horizontal Choices! - MechanicalPen - 04-11-2014

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.


RE: Need Help! Horizontal Choices! - Steel Beast 6Beets - 04-11-2014

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?