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):
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!
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!