[ACE] Yami Pop Up Message Script - Counting color codes

Hey everyone,

I'm having an issue with Yami Pop Up Message Script (found here: http://yamiworld.wordpress.com/yami-engine/text-display/pop-message/ , don't forget

the BASIC MODULE which is linked in the same page.)

I am also using YEA- Core script (found here: http://yanflychannel.wordpress.com/rmvxa/core-scripts/ace-core-engine/ )

Here is my issue:

HIj9piJ.png


This happens... A large empty space is left at the end of the message because it is counting every \C[x] code I put into the message.

Here is what the event script looks like, nothing advanced.

AusMXrg.png


Now, on the Script Author's page, there was a discussion about this, and apparently a guy was able to fix it in his version by editing the code.

So I took his script edits and used them. A user was able to post this:

Btw, I modified a couple of lines in process_all_text proc to get rid of the excess width of the bubble. Here’s how I put it:

alias pop_message_process_all_text process_all_text
def process_all_text
@event_pop_id = nil
update_placement
adjust_pop_message(convert_escape_characters($game_message.all_text))
pop_message_process_all_text
end
It didn't solve the issue of YEA's Core Script tampering with the Yami Pop Up message, so I noticed there was a pinned link to his blog (in french or something)

and it didn't seem to reference the windowed issue specifically. But there was a notation about "writing any code in a new window".

This is what Google Translate can cook up:

Bug : crashes the game if you use it with the script Yanfly. Solution : write any code as a normal window> \ n <Innkeeper>
However, my issue isn't that the game is crashing, it's just counting every \C[x] color code as extra text, so my text boxes extend for quite some length.

I have also checked around and edited the  self.width = cal_width_line(text) in the Yami script as well by removing the needless bump ( it was + 24 and I

set it to + 0 with improved results, but it still counting color codes)

Any help would be greatly appreciated. I really would love to use this script, it's just that I can't color code any text at all without it extending the pop up

message width.

Please help!

LAST UPDATE:

Thanks to the help of another forum, I now have my answer. So for anyone using the Yami Pop Message script and want to avoid the needlessly

extensive box due to command codes, simply add this script after Yami Pop Message:

class Window_Message < Window_Base def process_all_text @event_pop_id = nil result = convert_escape_characters($game_message.all_text) # # At this point, we've taken out: \V[n] \N[n] \P[n] \G \\ \bm[n] \bmf[n] \cbm # If you're using any other scripts with "static" codes that get processed # in "convert_escape_characters", I assume they've been dealt with in an # orderly fashion here as well # # What's left are the "dynamic" codes that change the behavior of the text # as it's being written: \C[n] \I[n] \{ \} \$ \. \| \! \< \> \^ # So, let's remove those (remember \ has been converted to \e) # remove_dynamic_escape_characters(result) update_placement adjust_pop_message(result) pop_message_process_all_text end def remove_dynamic_escape_characters(text) codes = [ /\eC\[(\d+)\]/i, /\eI\[(\d+)\]/i, /\e\$/, /\e\./, /\e\|/, /\e\^/, /\e!/, /\e>/, /\e</, /\e\{/, /\e\}/ ] codes.each do |code| rem = "" rem = text.slice!(code) while !rem.nil? end end endThat should allow you to use color codes (and a few others) without extending the width of the message box.

As for this thread, I suppose it can be closed. The issue is solved.

Original thread: https://forums.rpgmakerweb.com/threads/ace-yami-pop-up-message-script-counting-color-codes.25770/