RPG Maker MV

RPG Maker MV

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)?
< >
Näytetään 1-6 / 6 kommentista
normaly every Scene has it's own .refresh function.
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 8.1.2016 klo 14.32 
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();
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()
Viimeisin muokkaaja on Slim Jimmy; 9.1.2016 klo 10.35
Sabi 9.1.2016 klo 14.17 
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.
Thanks! Works like a charm!
< >
Näytetään 1-6 / 6 kommentista
Sivua kohden: 1530 50

Lähetetty: 7.1.2016 klo 1.28
Viestejä: 6