[XP] How do I trim Ccoa’s UMS gap?

callmedan

Friendly Stranger
Veteran
Joined
Dec 27, 2015
Messages
588
Reaction score
904
First Language
Vietnamese
Primarily Uses
RMXP
When I use a command of the script, it will leave a gap at the end of the message line. The more command you use, the bigger the gap will get. It’s okay in normal window mode, but it’s not cool in FIT_WINDOW_TO_TEXT mode in my opinion.
Is it possible to trim the gap and how do I do that?

Ccoa’ Universal Message System

Edit: The script commands may help sometimes. But there's some cases event codes can't be replaced by script commands, like drawing item into the message.
For example:
Code:
Show Text: You received \oi[1] and \oa[50].
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,001
Reaction score
4,742
First Language
Dutch
Primarily Uses
RMXP
What I do when I have too many commands is to use the Script commands instead of the event codes. That way you don't have that gap anymore.
 

callmedan

Friendly Stranger
Veteran
Joined
Dec 27, 2015
Messages
588
Reaction score
904
First Language
Vietnamese
Primarily Uses
RMXP
@slimmmeiske2 Thank you! My bad, I should have mentioned it in the first post. There's something can't be replaced by the script commands like drawing items into message.
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
154
First Language
English
Primarily Uses
RMXP
I'm glad that you are familiar with the 'Shortcut' system that ccoa introduced into her system. At least that issue is covered. Your issue with ccoa's UMS is the same that would befall anyone with such codes in their custom menu system.

Though you may not realize this, but the 'codes' are likely not functioning because you are surrounding your shortcut-text with double-quotes (ie " ). Attempt to use single quotes (ie ' ) and your \oi[1] and \oa[50] will be visible.

And if your message has need of quotes in the message (ie: There's something afoot. ), you have custom codes you're not aware of. ( ie = 'There\'s something afoot.'). \' generates (').

The \n command for line breaks only works if text is in double quotes. BUT, you can mix and match. Example:
Code:
$game_temp.message_text =
'You found a \oa[1], \oi[1],'+"\n" +
'and \ow[1]! \"Hahaha\".'
I placed this in ccoa's UMS demo right in the top-right 'CHEST' event. And as long as the only thing in doublequotes is the line break code, it broke to the next line where I wished.

HOWEVER, if I made the following code:
Code:
$game_temp.message_text =
'You found a \oa[1], \oi[1],'+
'and \ow[1]! \"Hahaha\".'
.... you may be pleasantly surprised that there's not enough horizontal space! It makes the text one long line!
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
811
First Language
Hungarian
Primarily Uses
RMVXA
When I use a command of the script, it will leave a gap at the end of the message line. The more command you use, the bigger the gap will get. It’s okay in normal window mode, but it’s not cool in FIT_WINDOW_TO_TEXT mode in my opinion.
That is most probably because the script's author made a common mistake in these type of scripts, getting the text's width without removing the message codes first.
Depending on what the message code does, it will make small or big errors in the width calculation.

The only way of reliably getting the real width with message codes is to clone the text, process it character by character, and keep track of the width after each character/special message code, just like the draw_text_ex method does. This is why many scripts just make the text go through with draw_text_ex and add in a variable that will store the final width of the text even after the drawing, or they simply draw it in a dummy window, get the width from there, and copy the contents of the dummy window to the real window using the recorded width in the positioning.

Fixing this would probably mean the complete rewrite of this section of that script. Simply using the text_width method on the complete original text won't help here, and I assume that is what has been done there. But can't be for sure, because you didn't give us the link to the script in question.
 

callmedan

Friendly Stranger
Veteran
Joined
Dec 27, 2015
Messages
588
Reaction score
904
First Language
Vietnamese
Primarily Uses
RMXP
@DerVVulfman Oops, I didn’t notice I could draw message with code like that. I should read the document again.
@Sixth My bad, I just added a link to the script in the first post.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Who knew a adding menu commands would be so hard for something that should be a basic feature.
When you discover great tileset resources that you completely forgot that you had. :kaomad3::kaopride:
Just got a better look at the MZ RTP. I'm very happy with it, especially the sci-fi tiles and sprites. Glad I pre-ordered.
I've just checked the VisuStella Plugins for MZ and there are already 11 plugins. The Yanfly team(perhaps a big one?) really works so effectively and efficiently that some MZ users can likely use tons of Yanfly plugins right after MZ's released (still 13 days from now). I wonder if any other plugin developer(or team) will try to compete with Yanfly this time, no matter how slim the chance to win is :)
Hello! :kaopride:I am new to RPG Maker, though I have been lurking the forums for a while. :kaoswt: Hope to make some friends and learn some stuff here! :kaothx:

Forum statistics

Threads
100,597
Messages
977,605
Members
132,199
Latest member
Erasure2
Top