How to refresh an actors stats?

Lear

Veteran
Veteran
Joined
Aug 12, 2012
Messages
59
Reaction score
11
Primarily Uses
I can't figure out how to use a script call to refresh an actors stats for the menu screen.
I thought it would be something along the lines of:


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


But that doesnt seem to help my issue. Anyone know what I can use to refresh a characters stats (hp/mp/other stats)?
 
 

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
I feel like what you have in the script call should work.  We might need a little more info to figure this out.  What is the exact circumstance that you're refreshing for?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
What exactly do you want to "refresh"? There are several different ways how that name is used in programming, and most likely you simply got the wrong function.


I've moved this thread to Javascript Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

Lear

Veteran
Veteran
Joined
Aug 12, 2012
Messages
59
Reaction score
11
Primarily Uses
To summarize without overwhelming with details as to what I'm attempting to do:
I'm working on an event that basically allows your character to reset their stats (HP, MP, Atk, Def, etc.) back to their default values, as there is a player controlled stat distribution mechanic.

I've got it all working basically how I want it upon the reset. This is a condensed version of the code I'm inputting via script command:
 


[2101,2102,2103,2104].forEach(function(id) { $gameActors.actor(1).forgetSkill(id) } );
$gameActors.actor(1).refresh();


However, some of the skills the actor learns/unlearns affects the actors stats. After this event/code is run, I can enter the menu but the character still visually displays the old HP/MP from before the code is run. However, when I enter the skill screen, the actors information display corrects/refreshes itself. I'm trying to resolve the issue of this information not displaying upon first entering the menu screen.
 

Lear

Veteran
Veteran
Joined
Aug 12, 2012
Messages
59
Reaction score
11
Primarily Uses
Wow, welp I just found my culprit.
I had called the refresh above some other code I had input. Sorry for the trouble and thanks for the assistance!


/facepalm
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top