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

callmedan

Friendly Stranger
Veteran
Joined
Dec 27, 2015
Messages
573
Reaction score
888
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
6,014
Reaction score
4,249
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
573
Reaction score
888
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
314
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
806
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
573
Reaction score
888
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 Posts

Latest Profile Posts

"Never let a sense of morals/
Prevent me from doing what is right"
- Clutch
OMFG. I had typed \fiPhilosophia Hermetica\fi in a forum post and didn't notice it for AN HOUR.

(Anyone else ever catch themselves doing this?)
Stream will be live shortly with a guest stream! Feel free to drop by and listen to whatever weird stories we're telling~
fighting game fans might really enjoy my game battle wise, and I feel non fighting fans might learn some stuff. thanks row system. pokes, neutral, and zoning time...
This community is awesome. They helped me get my eventing processes to work. I love you all.

Forum statistics

Threads
94,250
Messages
919,395
Members
123,962
Latest member
cheremera
Top