Jump to content
Kayzee

Word Wrapping Message Boxes

Recommended Posts

Fact is, if VE_AUTOMATIC_TEXT_CODE is true, draw_text will end up calling it's self!

 

No it doesn't lol

 

Oh I see, it overwrites process_normal_character. I missed that. With the Al Bhed script, process_normal_character calls draw_text, and is called from process_character_ve, which is called from draw_text_ve, which is called from draw_code_text which is called from draw_text.

 

It's pretty simple to fix, try putting this in a script after the al bhed script.

 


class Window_Base < Window

def process_normal_character(c, pos)

if @trans.nil?

@trans = true

end

return albhed_process_normal_character(c, pos) unless $game_switches[Albhed::ALBHED_SWITCH]

if c == "{"

@trans = false

return

end

if c == "}"

@trans = true

return

end

c = Albhed.translate( c ) if @trans

change_color(text_color(Albhed::ALBHED_COLOR)) if @trans

albhed_process_normal_character(c, pos)

change_color(normal_color)

end

end

Edited by KilloZapit

Share this post


Link to post
Share on other sites

Good work, Zapit. Now we can go back to celebrating how awesome this script is, its saved me having to use faceboxes and all. And its compatible with everything I use.

 

Also, there's a bonus, Yanfly Victory Aftermath doesn't seem to recognize line breaks on victory quotes (probably because I'm doing them wrong.) but with this I don't need to worry, because it's automatically put on the next line.

 

You're probably going to go in the special credits alone for this, such a time saver.

Share this post


Link to post
Share on other sites

I updated the script again, striping timing codes and some other stuff.

 

Also I just realized this but the Al Bhed Translator script will probably cause some slight inaccuracy in splitting lines, since my script counts ahead in the text and the Al Bhed Translator only translates text when it is actually drawn... honestly it shouldn't be that noticeable though.

 

Edit: Oh! And thankies every one... I just saw a problem and fixed it is all... honestly if you ask me this should have been included in vx ace in the first place... hehe...

Edited by KilloZapit

Share this post


Link to post
Share on other sites

I'm surprised that nobody reported the bug so it might be a human error of my doing.

 

When I tried to use WhiteSpace mode -- (using /WS, and/or setting TRUE in DEFAULT_WHITESPACE), the game crashed and spat error at me. I encountered it in the blank project.

 

Script 'Word Wrapping' line 52: TypeError occurred.

Rect can't be coerced into Fixnum

 

 alias_method :process_character_kz_window_base, :process_character
 def process_character(c, text, pos)
if @wordwrap
  c = " " if @convert_newlines && c == "\n"
  if c =~ /[ \t]/
-->	 if pos[:x] + get_next_word_size(c, text) > contents.width   <-- line 52
	  process_new_line(text, pos)
	else
	  process_normal_character(c, pos)
	end
	return
  end
end
process_character_kz_window_base(c, text, pos)
 end

Share this post


Link to post
Share on other sites

Ooopsies! It should be fixed in the first page now... Forgots to add a .width to that text_size( c ) at the end of get_next_word_size!

Edited by KilloZapit

Share this post


Link to post
Share on other sites
I just noticed the script is 4 methods long.

I have said it before I think but I will say it again. This is a feature that should have been in from the start. It's not a complex new message system or a drastic new way of doing things. :P

Share this post


Link to post
Share on other sites

This script is awesome! I write a lot of dialogue and it's so annoying that if I decide I want to change something early in that person's dialogue, I have to change the manual line breaks for everything after. It's a big problem when the character has several speech windows. Ever since I started with VX I didn't understand why something like this wasn't already in the program. It actually got worse in ACE because the spaces take up more space than they did in VX, so the arrows that are supposed to show you the cutoff point of text are no longer accurate. So if a line has a bunch of spaces it will have a shorter cutoff point. Pretty dumb. It's also awesome that this is compatible with Yanfly's message system which I also use.

 

So I'd like to ask permission to use this in commercial games. You will receive full credit in both a credits text file included with the game, as well as a place in a special credits section for the game on my website when it's released. I can also give you a free copy of the game, doesn't bother me. If you agree, what name would you like to be credited with and what link would you like shown? Thank you.

Share this post


Link to post
Share on other sites

This script is awesome! I write a lot of dialogue and it's so annoying that if I decide I want to change something early in that person's dialogue, I have to change the manual line breaks for everything after. It's a big problem when the character has several speech windows. Ever since I started with VX I didn't understand why something like this wasn't already in the program. It actually got worse in ACE because the spaces take up more space than they did in VX, so the arrows that are supposed to show you the cutoff point of text are no longer accurate. So if a line has a bunch of spaces it will have a shorter cutoff point. Pretty dumb. It's also awesome that this is compatible with Yanfly's message system which I also use.

 

So I'd like to ask permission to use this in commercial games. You will receive full credit in both a credits text file included with the game, as well as a place in a special credits section for the game on my website when it's released. I can also give you a free copy of the game, doesn't bother me. If you agree, what name would you like to be credited with and what link would you like shown? Thank you.

 

Hehe, thankies... I don't really need that much credit though, having a link to this thread would be more then enough. I honestly rather not give out my real name anyway. Only reason I would request a link is so more people could use the script if they wanna.

 

As for permission to use my scripts in commercial games, well, I admit sometimes I am kind of confused about the whole thing... maybe it's because I am a fairy and we don't have the same ideas of ownership and you humans have. I mean I won't object or anything as long as people get some use out of my silly thing. :3 I do kind of wonder what you silly humans see in all that green paper though...

Share this post


Link to post
Share on other sites

Hehe, thankies... I don't really need that much credit though, having a link to this thread would be more then enough. I honestly rather not give out my real name anyway. Only reason I would request a link is so more people could use the script if they wanna.

 

As for permission to use my scripts in commercial games, well, I admit sometimes I am kind of confused about the whole thing... maybe it's because I am a fairy and we don't have the same ideas of ownership and you humans have. I mean I won't object or anything as long as people get some use out of my silly thing. :3 I do kind of wonder what you silly humans see in all that green paper though...

 

Thank you. Don't need your real name, just an online name you like to go by. I'll use your username here and link to this thread.

 

Why do people sell the games they make? It does bother some people, and I can totally understand. A lot of the games made using these engines have many problems and yet the creator still wants money. Not all however. The game's I make I'm spending hundreds of hours on, putting real work and effort into them. I just ask for a little compensation for my time. If I had plenty of "green paper" I'd probably give them away for free, but alas a man has to eat and support himself.

Share this post


Link to post
Share on other sites

Hehe, thankies... I don't really need that much credit though, having a link to this thread would be more then enough. I honestly rather not give out my real name anyway. Only reason I would request a link is so more people could use the script if they wanna.

 

As for permission to use my scripts in commercial games, well, I admit sometimes I am kind of confused about the whole thing... maybe it's because I am a fairy and we don't have the same ideas of ownership and you humans have. I mean I won't object or anything as long as people get some use out of my silly thing. :3 I do kind of wonder what you silly humans see in all that green paper though...

 

Thank you. Don't need your real name, just an online name you like to go by. I'll use your username here and link to this thread.

 

Why do people sell the games they make? It does bother some people, and I can totally understand. A lot of the games made using these engines have many problems and yet the creator still wants money. Not all however. The game's I make I'm spending hundreds of hours on, putting real work and effort into them. I just ask for a little compensation for my time. If I had plenty of "green paper" I'd probably give them away for free, but alas a man has to eat and support himself.

 

Hehe, I understand. To be honest and completely serious for a moment though, I think the biggest concern I would have as a designer with making commercial games is that less people would play it. It just seems easier to get your name out there and get talked about if there is no up-front costs involved. Plus there is always the possibility of donations. Not really the place to discuss this I guess, I just am also, well, kinda worried that people put a lot of time and effort into making games to sell, but don't really have the experience or logistical ability to really sell them. But I guess I usually am sort of pessimistic about such things. I do wish you luck though, I really do.

Share this post


Link to post
Share on other sites

Not sure if this has been mentioned, but there's a compatibility issue with Yanfly's Victory Aftermath, it crashes when it goes to load the victory screen with this message:

 

Script 'WWMB' line 77: NoMethodError occurred.

 

undefined method `gsub!' for nil:NilClass

 

nextword.gsub!(/\e[iIhH]+\[[\d,]*\]/) do

 

I've moved the scripts around a bit but this hasn't made any difference. Is there a way this can be fixed? If not, then :(.

 

Edit: This script is amazing BTW.

Edited by JFH

Share this post


Link to post
Share on other sites

 

As for permission to use my scripts in commercial games, well, I admit sometimes I am kind of confused about the whole thing... maybe it's because I am a fairy and we don't have the same ideas of ownership and you humans have. I mean I won't object or anything as long as people get some use out of my silly thing. :3 I do kind of wonder what you silly humans see in all that green paper though...

 

It is simply out of courtesy. You don't assume people's terms of use, and typically want to verify that you won't sue them for doing so.

That's why I've added some terms of use to my script template so people don't need to ask.

Share this post


Link to post
Share on other sites

Not sure if this has been mentioned, but there's a compatibility issue with Yanfly's Victory Aftermath, it crashes when it goes to load the victory screen with this message:

 

Script 'WWMB' line 77: NoMethodError occurred.

 

undefined method `gsub!' for nil:NilClass

 

nextword.gsub!(/\e[iIhH]+\[[\d,]*\]/) do

 

I've moved the scripts around a bit but this hasn't made any difference. Is there a way this can be fixed? If not, then :(.

 

Edit: This script is amazing BTW.

 

Other people mentioned that script works fine... I think the problem is actually something else... try it now...

 

 

As for permission to use my scripts in commercial games, well, I admit sometimes I am kind of confused about the whole thing... maybe it's because I am a fairy and we don't have the same ideas of ownership and you humans have. I mean I won't object or anything as long as people get some use out of my silly thing. :3 I do kind of wonder what you silly humans see in all that green paper though...

 

It is simply out of courtesy. You don't assume people's terms of use, and typically want to verify that you won't sue them for doing so.

That's why I've added some terms of use to my script template so people don't need to ask.

 

Your right I guess... I put a widdle notice up then

 

I changed it to version 4 then. :3

Share this post


Link to post
Share on other sites

My only problem with this method of doing messages is that it creates one long line of text. This makes it a little annoying to proofread what you've written without constantly going into the game and bringing up the text through the event. This is not the script creator's fault of course, and this method is still the best. If only the preview window took into account these custom scripts. To help the proofreading process I discovered that if you hold ctrl and use the arrow keys it will move the marker by a lot making it much easier to scroll. Highlight scrolling doesn't work since it jumps so much.

 

 

And I'd make this change to your TOU:

 

"Note: I consider this script to be public domain, and put only a few restrictions on its use. You may not sell this script itself, or claim it as your own. Please link to this thread if using this script. Nothing more is needed if it's a commercial game. Alterations can be made to this script without permission."

 

That should prevent any more questions, and also remove the possibility of someone selling just the script based on "no restrictions on it's use whatsoever". I know this stuff can be annoying to people who don't care, and you may not even care if they did sell it. That's why I wrote the new one for you :).

Edited by solaris32

Share this post


Link to post
Share on other sites

There probably isn't any nice solution to the issue.

One option is to just ignore all of the user's new-line chars and assume they're there purely for aesthetics. Which is not the case, when you want to display

 

ah

ah

hmm

Cool

 

Kind of silly that the text editor itself doesn't wrap...

Share this post


Link to post
Share on other sites

 

 

My only problem with this method of doing messages is that it creates one long line of text. This makes it a little annoying to proofread what you've written without constantly going into the game and bringing up the text through the event. This is not the script creator's fault of course, and this method is still the best. If only the preview window took into account these custom scripts. To help the proofreading process I discovered that if you hold ctrl and use the arrow keys it will move the marker by a lot making it much easier to scroll. Highlight scrolling doesn't work since it jumps so much.

 

 

And I'd make this change to your TOU:

 

"Note: I consider this script to be public domain, and put only a few restrictions on its use. You may not sell this script itself, or claim it as your own. Please link to this thread if using this script. Nothing more is needed if it's a commercial game. Alterations can be made to this script without permission."

 

That should prevent any more questions, and also remove the possibility of someone selling just the script based on "no restrictions on it's use whatsoever". I know this stuff can be annoying to people who don't care, and you may not even care if they did sell it. That's why I wrote the new one for you :).

 

Well... it's not that I don't care really, it's just that I personally feel hypocritical if I started dictating terms like that. I mean I don't much think people should claim it as there own and sell it, but as long as my version is kept somewhere for free that people can access, there is not much point in worrying about that. That is what public domain is for after all. I might add a bit to it though.

 

There probably isn't any nice solution to the issue.

One option is to just ignore all of the user's new-line chars and assume they're there purely for aesthetics. Which is not the case, when you want to display

 

ah

ah

hmm

Cool

 

Kind of silly that the text editor itself doesn't wrap...

 

Well that is why I added "whitespace" mode and the \br escape sequence. :3

Share this post


Link to post
Share on other sites

I've encountered a problem. One line in the text box can only hold 1,024 characters. If it exceeds that, it automatically goes to the next line. Your script treats this as a line break, so I have a line break in the text window in the middle of a sentence. Looks silly and unprofessional. Is there any way you can fix this? Told you I write a lot ;).

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.

×