[Solved] yanfly mini label overlapping pictures

Plugin: Yanfly Event Mini Label
http://www.yanfly.moe/wiki/Event_Mini_Label_(YEP)

Issue: The labels that show up on events, are shown over Top of 'Show Picture' events. If I show a picture on the screen, and there was an event behind the photo with a label on it, the label shows through the photo even though the event does not.

There is infact a "Hide" plugin command, but it causes a 1-2 second lag spike each time it is triggered. This is my sole issue with it, and I am trying to get away from using the 'hide'/'show' plugin commands to avoid the lag spikes they generate (assuming because of a map refresh?)

Possible Solution: What I've been trying to figure out myself is simply how to prevent it. I tried looking through the code to find a Z axis, or a layer, that it was assigned to... but it seems that's now how it works. I'm a novice coder (at best), with my better talents being manipulating code, but this one has me stumped good.

labelissue.png


Thank you in advance for any assistance on this issue.
got links?
Links to what?
To the plugin you're using, so we don't have to waste time searching for it ourselves.
Apologies, thought it was a fairly commonly known one. http://www.yanfly.moe/wiki/Event_Mini_Label_(YEP)
I think it's just a courtesy when you're asking people to help you with something, that you make it easy for them to find. It just saves time.

I also don't use other people's plugins, so there's zero chance I already have it and don't have to go looking.

So there is this function:
Code:
Sprite_Character.prototype.setupMiniLabel = function() {
    if (this._miniLabel) return;
    if (!SceneManager._scene._spriteset) return;
    this._miniLabel = new Window_EventMiniLabel();
    this._miniLabel.setCharacter(this._character);
    //this.parent.parent.addChild(this._miniLabel);
    SceneManager._scene._spriteset.addChild(this._miniLabel);
};

where Yanfly commented out that one line and added another. I suspect that is related to this change log:
Code:
 * Version 1.08:
 * - Added <Mini Label Require Facing> comment tag.
 * - Moved the priority of the Mini Labels to be later added to the spriteset
 * so they can stay on top of more effects.

What's happening here is that the mini labels are being added to the spriteset after the pictures, so they just go on top of everything that's already there. Changing it back to what was originally there might solve your problem, but it depends on what those "more effects" are and if you are using any.

So try changing it to this and see how it goes:
Code:
Sprite_Character.prototype.setupMiniLabel = function() {
    if (this._miniLabel) return;
    if (!SceneManager._scene._spriteset) return;
    this._miniLabel = new Window_EventMiniLabel();
    this._miniLabel.setCharacter(this._character);
    this.parent.parent.addChild(this._miniLabel);
    //SceneManager._scene._spriteset.addChild(this._miniLabel);
};

If it doesn't work, or has other undesirable effects (like now it's too low and there are things it's under that it really should be over), we'll need to be a bit more fussy about where it goes.
Thank you so much, I saw that line but it really escaped me it's purpose was for that. I very much appreciate the help.

I understand about the linking part, I will absolutely be sure to include a link in future posts.

I appreciate the heads up on possible unintended effects of changing the position, but it removes so much lag from the game for me. Thank you again.
No worries. If your issue is resolved, just report your post and let the mods know, and they'll close the thread. However, I'd wait a day or two and continue to test, so if you do discover an issue, you can just come back to this thread instead of starting a new one or getting mods to reopen it 🙂

Also, swapping which of those lines is disabled would not have any impact on lag. I'm guessing you're referring to the need to hide the labels, which you said is slow.
Yup I'm just giving it a day, will be testing it all night. I edited the title for the meantime.

Yea it's the hide label command I was using, to hide labels at every menu/function/scene, and the moment of lag it causes to hide/show was really becoming a noticeable issue. Now everything is so smooth its fantastic!
While this change in code does solve the layering issue, it breaks compatibility with YEP_EventSpawner.

After using the script call to spawn an event, I get this error message in the console:
Spoiler: Console
1628553664150.png

Then, if I try to transfer maps, the game crashes and I get this error message:
Spoiler: Error
1628554041894.png

I think am looking at this final block of code in the Event Spawner plugin to see if I can make the label fix outlined here work with the Event Spawner:
Spoiler: Create Spawned Event Function
JavaScript:
Spriteset_Map.prototype.createSpawnedEvent = function(target) {
  this._characterSprites = this._characterSprites || [];
  var length = this._characterSprites.length;
  this._characterSprites[length] = new Sprite_Character(target);
  this._characterSprites[length].update();
  this._tilemap.addChild(this._characterSprites[length]);
};

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-yanfly-mini-label-overlapping-pictures.112489/