Jump to content
Kayzee

Word Wrapping Message Boxes

Recommended Posts

Aww shucks... *sprinkles fairy dust on you*

 

Those arrows are actually rather loose alignment guides more then anything else, and are completely useless if you change the resolution.

 

That's the thing; I never changed anything with respect to font type or size so I figured they would be accurate, but even out of the box they were inaccurate for me >_<

Share this post


Link to post
Share on other sites

Those margins are more like suggestions. Especially if you're using a face portrait. They're completely useless then. I've been several characters away from the first arrow, and still had text getting cut off.

 

I actually tweaked Killo's margin. Sometimes the last pixel or two of a character would touch the edge and mess up the wrapping. 

Share this post


Link to post
Share on other sites

It's the default RPG Maker Font. The problem was your script worked too well. One or two columns of pixels begin cutoff is barely noticeable so sometimes characters look like they're not being cut off in the preview window when they are. The margin you set is dead on so when that happens, the script does what it does. I tweaked it to give myself a little buffer. Occasionally, a character will get slightly cut off, but it's not really an issue. I'm usually really OCD about things like that, but it's acceptable to me so I don't think it'll detract from how professional it looks.  :D

 

I'm still baffled how word wrapping isn't a standard feature to begin with. That and Spell Check.

Anyway, I see Rikifive officially gave you an unofficial award so no Nobel Prize for you. Awesomely awesome script!  :D  :thumbup3:

Share this post


Link to post
Share on other sites

Well I am using the built in text width function to do it, and maybe that doesn't take into account shadows and things or messes up some letters. Anyway setting a few pixels of right margins isn't really a bad idea I guess!

 

Also, I have explained this before, but I think the reason it isn't a default feature is just because it was programmed in Japan. Japanese doesn't really use spaces as word boundaries, so all word wrapping that is done is always manual anyway. Though, I just looked up how HTML did it and apparently some people say in Japanese it's normal to wrap in the middle of words, so i dunno. I thought maybe they used zero width space characters or something.

Edited by KilloZapit

Share this post


Link to post
Share on other sites

I have an issue with the wrapping that  cuts off choices or overlays text from the first line on the second line (so the text gets unreadable in the 2nd line). There is a workaround with posting "\nw " in front of every affected choice.

I don't want the textwrap in any choice, just in the regular text boxes, where people talk ...

Is there a coding option to check if the text being handled is in a choice-field?


... and a screenshot.

Zwischenablage01.jpg

Share this post


Link to post
Share on other sites

Huh... I didn't know choiceboxs used draw_text_ex... Anyway, it's strange because I don't have that problem at all... choiceboxs should always be wide enough to fit the text in. I think this might be an issue with switching fonts? Only way I can see why it wouldn't size things right.

 

Anyway, here is a widdle script to force choiceboxes to not use my wordwrapping if you want to use it:

 

class Window_ChoiceList < Window_Command
  
  def process_character(c, text, pos)
    process_character_kz_window_base(c, text, pos)
  end
  
end
                                        

That said, the issue remains that your choiceboxes are smaller then they should be. If they don't wrap they will be cut off.  It might not be noticeable though. Another script may be at fault and changing the font when using draw_text_ex causing the size calculation to be wrong... or maybe you are using special control characters?

 

Edit: Now I am wondering if I can mess around with the way choiceboxes calculate width to do a better job...

 

Edit 2: Wow that was more simple then I thought... If you feel like it, try this, it should make choiceboxes resize better:

 

Spoiler

class Window_ChoiceList < Window_Command

  def max_choice_width
    Graphics.width
  end
  
  def process_character(c, text, pos)
    super(c, text, pos)
    @max_width = [@max_width, pos[:x]].max
  end
  
  def refresh
    @max_width = 0
    super
    self.width = [@max_width + 12, 96].max + padding * 2
    self.width = [width, Graphics.width].min
    self.x = Graphics.width - width
    self.arrows_visible = false
  end
  
end

 

 

Even works for control characters and icons too!

Edited by Kayzee

Share this post


Link to post
Share on other sites
6 hours ago, Kayzee said:

Edit 2: Wow that was more simple then I thought... If you feel like it, try this, it should make choiceboxes resize better:

Wow, thank you, it works like a charm!

You are awesome!

Share this post


Link to post
Share on other sites

Okay, I am glad I see that coder is still checks in even after those years cause I have a strange issue. Script doesn't work, and I mean literally as there's no word wrapping happening and yes, automatic setting is set true. Script is placed in Materials section, as it should be, no other scripts present as I wanted to test it alone before trying to use it with Yanfly's scripts.

Edited by GCRX

Share this post


Link to post
Share on other sites

So it just... doesn't do anything at all? DEFAULT_WORDWRAP is true and all that? You didn't decadently put the script after Main or anything? If so then... I have no idea! It works for me in a fresh project fine... :/

Edited by Kayzee

Share this post


Link to post
Share on other sites
7 hours ago, Kayzee said:

So it just... doesn't do anything at all? DEFAULT_WORDWRAP is true and all that? You didn't decadently put the script after Main or anything? If so then... I have no idea! It works for me in a fresh project fine... :/

That's why it's strange, all mistakes people commonly make and you mentioned, not my case. I checked if perhaps I missed copying part of the script over or something (everything is possible), nope. Honetly, VX Ace never stops to surprise me with unexplainable stuff.

Edited by GCRX

Share this post


Link to post
Share on other sites

Okay, I managed to make it work but I really, really have no idea where the issue was. All I did was just setting up completely new project and using script there. Just a detail, the previous testing project was clean, nothing was done there, so... I dunno what went wrong.

Share this post


Link to post
Share on other sites

I can't deny any possibility, but it's not really that probable as every component is pretty much new.

 

Thank you for your time, it's a great script which makes life of every developer who uses it easier, and it fixes a lot of nightmares for me. ;)

Share this post


Link to post
Share on other sites

@GCRX ...
VX Ace has one issue with the RGSS interpreter.

It occasionally will not read everything correctly. Of course, sometimes, this is at the compiler level, and it won't be fixed by a simple restart, but by completely wiping the data clean and restarting (be easiest to erase the rvdata files and then resave the project to rewrite them). This is the likely issue, and there is no fix short of decompiling VX Ace and recoding that portion of it (not worth the trouble and of course Degica would be very displeased-not that I care about their feelings).

 

I have had several test projects get corrupted, and I had one working project lose more than half of the progress made due to this issue.
While hardware issues can contribute/be the core cause, usually that will be a full rvdata corruption that occurs while VX Ace is not running.

Share this post


Link to post
Share on other sites

I only had a project get corrupted once, and I think that was because the editor crashed in a weird way while writing to the disk. Anyway I would think if it was corrupted it would at least give an error.

Share this post


Link to post
Share on other sites

@Kayzee Yeah; it was the good o' "Cannot load x.rvdata" (x being whichever rvdata file that got corrupted) nonsense.

 

For the compiler corruption errors, it would just crash and leave log files filled with garbage text.

Edited by PhoenixSoul

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×