MV Yanfly Message Core pop ups when characters are different heights

Hi all,

I'm using Yanfly's Message Core + ExtMesPack1 plugins to have pop up dialogues over characters (events) heads. This is successfully achieved by adding \msgevent[3] to a dialogue message, for example, if the event is Event 3.

However, some of my characters are different heights. For example, there are small animals that talk. I would like the pop up dialogue to be lower for them compared to the default characters, so I've opened the js file and attempting to alter the y offset for those.

The only way I can think of right now to achieve this is with conditional statements like this (an edit/add on to the YEP_X_ExtMesPack1.js code):

if (eventId <= 0) { x = $gamePlayer.screenX(); y = $gamePlayer.screenY(); y -= $gamePlayer.spriteHeight(); } else { var ev3 = $gameMap.event(3); if (ev3) { x = ev3.screenX(); y = ev3.screenY(); y -= ev3.spriteHeight()-6; } else { var ev = $gameMap.event(eventId); if (ev) { x = ev.screenX(); y = ev.screenY(); y -= ev.spriteHeight(); } } } }

The only thing I've added is where var ev3 is added for $gameMap.event(3); and the change in offset to -6. I've kept $gameMap.event(eventId) there for all the other events that I wish to remain the same height.

However, this code isn't working successfully. It DOES recognise $gameMap.event(3) and does the -6 to it, which is great and exactly what I want, but it doesn't keep the other events as they should be. I must have done something wrong in the code, but I can't seem to work it out despite staring at it for ages. Any help with this would be truly wonderful. 🙂 And if anyone has a more effective method for pulling this off in code, I'd love to hear too!
However, some of my characters are different heights. For example, there are small animals that talk. I would like the pop up dialogue to be lower for them compared to the default characters, so I've opened the js file and attempting to alter the y offset for those.
Altering the JS file feels like overkill. You can use \msgposx[x] and \msgposy[x] to move it to a specific spot for the smaller characters.
Unfortunately I will need to avoid using \msgposx[x] and \msgposy[x]. I did it that way in the past and found it very time consuming as my characters do a lot of moving in scenes and there is a lot of dialogue.
Does it stay in place for big sprites, too? If they are big enough, does it overlap their sprite?
I tested for big sprite and it works fine for them. It actually works fine if I use a smaller sprite too. Whatever the height of the sprite is, it seems the plugin does take that into account.

My issue is (I forgot to mention this in my above post and it's actually important oops!) I put my smaller characters on the same size spritesheets as the normal sized characters, and that's why I'm having the issue.

I could make the spritesheets smaller for them so there's no gap... That would completely solve the issue BUT I have a lot of animation frames where they jump and carry objects so I need to leave plenty of room above the sprites. Hmm... It's a tricky one.
I could make the spritesheets smaller for them so there's no gap... That would completely solve the issue BUT I have a lot of animation frames where they jump and carry objects so I need to leave plenty of room above the sprites. Hmm... It's a tricky one.
I actually thought it might be a spritesheet thing. Good to know it takes that into account. As for these, I don't think that's too big an issue, just use a different sprite sheet for things like that. Even if they talk, the text box would still go above them in a useful way (you wouldn't want the box covering what they are carrying, I think).

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-message-core-pop-ups-when-characters-are-different-heights.139124/