RMMV Yanfly Message Core pop ups when characters are different heights

ladylannistarth

Villager
Member
Joined
May 9, 2017
Messages
20
Reaction score
1
First Language
English
Primarily Uses
RMMV
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!
 

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
922
Reaction score
667
First Language
English
Primarily Uses
N/A
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.
 

ladylannistarth

Villager
Member
Joined
May 9, 2017
Messages
20
Reaction score
1
First Language
English
Primarily Uses
RMMV
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.
 

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
922
Reaction score
667
First Language
English
Primarily Uses
N/A
Does it stay in place for big sprites, too? If they are big enough, does it overlap their sprite?
 

ladylannistarth

Villager
Member
Joined
May 9, 2017
Messages
20
Reaction score
1
First Language
English
Primarily Uses
RMMV
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.
 

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
922
Reaction score
667
First Language
English
Primarily Uses
N/A
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).
 

Latest Threads

Latest Profile Posts

51F2AC5E-A605-446E-9439-D77AA6A0B0ED.pngAdded console to my content thread here
Sweet nostalgia. My fave Final Fantasy game.
Steam page is now live!
1632768058957.png
just discovered thig game called Willowbrooke Post... beautiful artstyle if I do say so myself... does anyone know what this kind of style is called??
In one of my game projects, I am working on an arena where you can fight combatants or bet on monsters, and, man, it is taking so long, lmao. I do not think that it helps that I am using an evented combat system with a lot of things that I have to edit.

Forum statistics

Threads
115,423
Messages
1,089,742
Members
150,169
Latest member
switchstone
Top