MZ Refresh equipment changes?

Hello,

so if I go to the menu screen and change equipment there, and return to the map screen, the changes I want with my plugin happen instantaneously. However, if I use the change equipment event command to change the equipment, there is a 4-5s(?) delay, before the changes start taking effect (or in some cases it doesn't seem to happen at all, depending where I'm launching the event from).

If I do change the equipment with an event command and then very quickly just go in/out of the menu screen, it starts working. (I don't even need to go the the equip section, just flashing the menu open/close is enough.

So is there some way to imitate what happens when going to the menu screen, without accessing it?
(I'm using the official ABS plugin, but not sure if it matters in this case).
Try $gamePlayer.refresh() or $gameMap.refresh()

I'd have to look to see which one might do what you're looking for, or if one calls the other.
All core script equipment changes ultimately go through the changeEquip method of Game_Actor (rmmz_objects.js), which refreshes the actor immediately afterwards (this.refresh()).

$gamePlayer is a character (battler would be $gameParty.leader()), but it depends exactly what kind of changes you're looking for.
Going to the menu screen and back is actually a completely different scene in MV, so you're reloading literally every part of the screen.

Actually the map that's behind the menu is just a screenshot of the previous map scene.

What exactly are you trying to update visually, that would help to know. Most stuff can be refreshed by $gamePlayer.refresh or $gameMap.refresh but things like the tilemap usually only get redrawn on player transfer or scene start and require a different approach
So in the plugin you can define what is a normal attack for each weapon. So when I change weapons I want a different skill to launch when pressing the action button for different weapons.

I tried those scripts which @ATT_Turan mentioned, but they don't seem to work here.

However, I just noticed that this seems to again be a case of the plugin not wanting to work properly on the very first map when starting play. Because I just realized that when I changed maps, it started working as expected. So this shouldn't be a problem, I hope, since the game starts on a map that doesn't have combat. [EDIT: Actually not sure about this anymore. Still seems to be some problems depending where I launch the change]

But thanks for the help anyway, hopefully it works normal in the subsequent maps.
As caethyril mentioned above, you could try refreshing the actor, then: $gameParty.leader().refresh()
Seems like I spoke too soon. The map change or opening/closing the menu screen only helps if I change the equipment through an event (like I have a test parallel event, if SHIFT is pressed -> change the weapon). Without the map change or menu opening it doesn't work at all.

And if I change the equipment through the plugin skill / common event, it starts working with the multiple second delay, but changing maps or opening the menu doesn't help. Really annoying and confusing.

As caethyril mentioned above, you could try refreshing the actor, then: $gameParty.leader().refresh()

I'll try this tomorrow. How do I refresh the actor?
...with the script call I typed that you quoted? O__o
...with the script call I typed that you quoted? O__o

Oh, I thought the comma meant that first refresh the actor and then use that script call, LOL. Anyway, I'll try it tomorrow, thanks.
Oh, I thought the comma meant that first refresh the actor and then use that script call, LOL.
I understand - no, here "then" was meaning "in that case."

Good luck!

Original thread: https://forums.rpgmakerweb.com/threads/refresh-equipment-changes.158487/