RPG Maker MV

RPG Maker MV

Slim Jimmy Jan 7, 2016 @ 1:28am
Refresh function
is there a sort of built-in refresh function that we can use to update an actor (like when putting in a new state)?
< >
Showing 1-6 of 6 comments
RedLink Jan 7, 2016 @ 2:13pm 
normaly every Scene has it's own .refresh function.
Slim Jimmy Jan 7, 2016 @ 9:34pm 
I'm using Yanfly's Equip Upgrade Slots and Auto Passives to give my items passive upgrades. When I upgrade, say, a weapon that's already equipped, the passive state doesn't fire up until the actor has something done to him (healing spell, using a consumable, etc) or if he re-equips the weapon.

Now I'm aware about a function call that does the "Optimize" sequence, and if I add that to the notetag, the states do show up right after I upgrade the equipped gear, but it just doesn't seem very elegant. I mean, if there's another way to do this without having to "repurpose" some other function, it'd be great, right?
Sabi Jan 8, 2016 @ 2:32pm 
First, you probably want to check that you are using the most up-to-date version of Yanfly's script. In a more direct answer, though, find the scene that upgrades your equipment, such as Scene_Item or Scene_Equip, and make sure the command that upgrades your equipment calls the refresh command of the actor status window. Typically, it is a command that looks like:

this._statusWindow.refresh();
Slim Jimmy Jan 9, 2016 @ 10:29am 
Is there a difference between refreshing a window and "refreshing" an actor?

Because from the way I observed things, if I do that item upgrade on an already equipped piece of gear and simply exited the menus and re-entered it, the passive state doesn't fire up. But if I, say, unequip and the re-equip the item, that's when the state kicks in.

Btw, the function I used is $gameActors.actor(1).optimizeEquipments()
Last edited by Slim Jimmy; Jan 9, 2016 @ 10:35am
Sabi Jan 9, 2016 @ 2:17pm 
There is a difference. Refreshing the window clears the display and redraws all the stats based on what the actor currently has, where refreshing the actor re-evaluates the actor's stats. The command you use at the end also refreshes the actor, so you could try

$gameActors.actor(1).refresh();

to refresh the actor without any of the equipment change that might happen from using optimize equipment command.
Slim Jimmy Jan 9, 2016 @ 6:56pm 
Thanks! Works like a charm!
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Jan 7, 2016 @ 1:28am
Posts: 6