So I'm using Yami's Pop Message (found here) alongside Yanfly's Message System (found here). They work together fine for the most part, but one thing I've noticed when using Yanfly's name boxes, is that if the pop-up message is too close to the top of the screen and has too many lines, the name box gets completely cut off, because the Pop Message isn't accounting for it. The obvious solution is to just cut out one of the lines and move it to a new message box, which I will do if there's no other option, but a more elegant solution would be preferred. The thing is, Yanfly's message system already has the capability to put the name box below the window, if you set the message position to Top, then the name box will appear beneath it. But doing so in conjunction with Pop Message simply causes the name box to appear where it would if you were using the default message box, instead of conforming to the pop up text box. That leads me to believe that there may be an easy way to make them work together, but I'm not very knowledgeable on scripting, so I'm humbly requesting help from someone who is to see if they can find a solution to this.
Yanfly Message System name box underneath Yami Pop Message?
RGSSx Script SupportTry this... untested
Ruby:
class Window_Message < Window_Base
alias r2_name_window_y_pos_yami_pop set_face_position
def set_face_position
r2_name_window_y_pos_yami_pop
return unless $imported["YEA-MessageSystem"]
@name_window.y = @face_window.y + 0 if @name_window.y < 48
end
end
It does seem to shift the window down if it's too close to the top of the screen, but not far enough. It puts it over top of the text box.
edit: I edited the @face.window.y + 0 to around + 118 and it worked for one conversation, but I tested some other NPC's with various message lengths/no face graphics, and it was wildly variable. Some of the text boxes were floating far away, while some were still overlapping the box.
edit: I edited the @face.window.y + 0 to around + 118 and it worked for one conversation, but I tested some other NPC's with various message lengths/no face graphics, and it was wildly variable. Some of the text boxes were floating far away, while some were still overlapping the box.
Try this instead...
Ruby:
class Window_Message < Window_Base
alias r2_name_window_y_pos_yami_pop set_face_position
def set_face_position
r2_name_window_y_pos_yami_pop
return unless $imported["YEA-MessageSystem"]
@name_window.y = 0 if @name_window.y < 0
self.y = @name_window.height + @name_window.y if @name_window.y < 24
end
end
Ah I see, instead of shifting the name box underneath, this shifts the whole message down instead. It does work generally speaking, but has the downside of overlapping the bubble tag and sometimes the character sprite of who's speaking. I could live with that I think, but another issue is that when it shifts the bubble down, it doesn't shift the face along with it, which I think is what you meant when you said it doesn't account for face images. That's a bit too janky looking for me. It seems like this problem might not be as simple as I hoped, so I understand if you don't want to pursue it any further.
OK, this works better.
Ruby:
class Window_Message < Window_Base
alias r2_name_window_y_pos_yami_pop set_face_position
def set_face_position
r2_name_window_y_pos_yami_pop
return unless $imported["YEA-MessageSystem"]
n_line = cal_number_line($game_message.all_text)
@name_window.y = self.y + self.height if self.y < 96
return unless @face_window
if !$game_message.face_name.empty?
if self.y <= 96
self.y += 24 * (4 - n_line)
@name_window.y += 24 * (4 - n_line)
@face_window.y += 24 * (4 - n_line)
end
end
end
end
That puts the name box under the message window 100% of the time no matter where on screen it is, and also strangely for some messages still shifts them down overtop of the bubble tag even though they would fit just fine as normal.
not in my test, so I can't be sure what it is doing wrong.
I tested it with a totally fresh project, using only Yanfly Message + Pop Message + Your fix and it still acted the same for me, always putting the name box beneath the message no matter where on the screen it is. So I'm not really sure what's the difference either, fonts maybe? I'm not using the default font.
Then how are you making the event conversations?
I format it like this. What's the point of doing it like you have? I tested your formatting on my project and it didn't fix anything, also it just leaves an empty space for line 2.
My format makes this difference
because the characters in the line for the text is counted for the message window size.
but as you can see it works for me.
Got the size fixed.
Ruby:
class Window_Message < Window_Base
alias r2_name_window_y_pos_yami_pop set_face_position
def set_face_position
r2_name_window_y_pos_yami_pop
return unless $imported["YEA-MessageSystem"]
n_line = cal_number_line($game_message.all_text)
return unless @face_window
if !$game_message.face_name.empty?
if self.y <= 48
self.y += 24 * (4 - n_line)
@name_window.y += 24 * (4 - n_line)
@face_window.y += 24 * (4 - n_line)
@bubble_tag.y += 24 * (4 - n_line)
end
end
@name_window.y = self.y + self.height if self.y < 48
end
def message_escape_characters_pop_message(result)
result.gsub!(/\eBM\[(\d+)\]/i) { event_pop_message_setup($1.to_i, false) }
result.gsub!(/\eBMF\[(\d+)\]/i) { event_pop_message_setup($1.to_i, true) }
result.gsub!(/\eCBM/i) { event_pop_message_setup(nil, false) }
result.gsub!(/\BM\[(\d+)\]/i) { "" }
result.gsub!(/\N\<\w*>/i) { "" }
result.gsub!(/\NC\<\w*>/i) { "" }
result.gsub!(/\NR\<\w*>/i) { "" }
result
end
def cal_width_line(text)
result = 0
text.each_line { |line|
message_escape_characters_pop_message(line)
result = text_size(line).width if result < text_size(line).width
}
return result
end
end
Ahhh interesting, I suppose I never mentioned this but I already have a script snippet from someone else on the forum that removed the text codes from counting towards the window size. But I knew it wasn't the issue since I tested on a fresh project without using it. But using your snippet still causes issues. For example:
But I mean, if it's working perfectly fine for you, I honestly have no idea what could be the issue.
But I mean, if it's working perfectly fine for you, I honestly have no idea what could be the issue.
Ok seems to be a number issue. I didn't have any in the middle to test so I can see the issue now.
I had 148 there and it pushed a lot down.
I changed to 96 and it pushed some down
I changed to 48 and it looks like that is the preferred number.
I'll change the code above so you can see where I mean to change the numbers
Testing your edits, it definitely seemed to work a lot more consistently, but there were still problem zones for the text box. Like here:
I lowered the number down to 36 (and 18 for the other parts ofc) and it fixed that one, but after a bunch of testing I've isolated one specific instance where the problem persists no matter what I edited the numbers too. Here:
Messages originating from from sprites two tiles up from the player, that are exactly 3 lines, will overlap the bubble tag like so. I tested a bunch of different positionings, and this seems to be the only remaining issue I've found. Any potential way to fix this? Thanks again for taking so much time to help me.
I lowered the number down to 36 (and 18 for the other parts ofc) and it fixed that one, but after a bunch of testing I've isolated one specific instance where the problem persists no matter what I edited the numbers too. Here:
Messages originating from from sprites two tiles up from the player, that are exactly 3 lines, will overlap the bubble tag like so. I tested a bunch of different positionings, and this seems to be the only remaining issue I've found. Any potential way to fix this? Thanks again for taking so much time to help me.
It actually looks like your bubbletag is not even there.
I see the problem now. Let me check it out.
Should be good to go now.
figured out that part. settings adjustment
Figured out the three line problem. The name adjustment had to be lowered down.
Code above fixed.
It still didn't fix it for me. I decided to try and even cleaner project with a fresh install of the scripts without even my minor settings adjustments, default everything. And it still didn't fix it. I'm at a loss, I have no idea what could be causing a difference between our experiences.
Forums testing - yami pop
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
Funnily enough that project immediately wouldn't work because there was no bubble tag in the system folder, but I added my own and that fixed it. Anyways, the three line text issue does seem to function differently in your project, but still not "fixed". The text box is still shifted down, it just shifts the bubble tag down with it. So instead of overlapping the bubble tag, the bubble tag now overlaps the sprite. Is this the same on your end?
Didn't realize that was an undesired solution.
Try this
Ruby:
class Window_Message < Window_Base
alias r2_name_window_y_pos_yami_pop set_face_position
def set_face_position
r2_name_window_y_pos_yami_pop
return unless $imported["YEA-MessageSystem"]
n_line = cal_number_line($game_message.all_text)
return unless @face_window
@name_window.y = self.y + self.height if self.y < 24
end
def message_escape_characters_pop_message(result)
result.gsub!(/\eBM\[(\d+)\]/i) { event_pop_message_setup($1.to_i, false) }
result.gsub!(/\eBMF\[(\d+)\]/i) { event_pop_message_setup($1.to_i, true) }
result.gsub!(/\eCBM/i) { event_pop_message_setup(nil, false) }
result.gsub!(/\BM\[(\d+)\]/i) { "" }
result.gsub!(/\N\<\w*>/i) { "" }
result.gsub!(/\NC\<\w*>/i) { "" }
result.gsub!(/\NR\<\w*>/i) { "" }
result
end
def cal_width_line(text)
result = 0
text.each_line { |line|
message_escape_characters_pop_message(line)
result = text_size(line).width if result < text_size(line).width
}
return result
end
end
Original thread: https://forums.rpgmakerweb.com/threads/yanfly-message-system-name-box-underneath-yami-pop-message.134348/