Is applying a stat to just one specific actor possible?

Arctica

Veteran
Veteran
Joined
Jul 19, 2021
Messages
113
Reaction score
148
First Language
English
Primarily Uses
RMMZ
I have a new stat that I've added to the Game_BattleBase.prototype.initmembers(via alias), and as such it adds that stat to all actors of Game_Actor and Game_Enemy since they all inherit properties from this. What I want is for an actor to have that stat only, is this possible?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,619
Reaction score
8,598
First Language
Indonesian
Primarily Uses
RMVXA
What problem do you have by having all actors have the same stat?
 

Arctica

Veteran
Veteran
Joined
Jul 19, 2021
Messages
113
Reaction score
148
First Language
English
Primarily Uses
RMMZ
There isn't a problem, I just want to know if it's possible or not.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,619
Reaction score
8,598
First Language
Indonesian
Primarily Uses
RMVXA
Theoretically, you can add a unique variable to any actor.
Using this script call
Code:
$gameActors.actor(1)._yourStat = 1000
it adds a custom variable exclusively for actor 1. However, whether or not that the variable remains after you save the game and load it, is something I'm not sure about. Maybe you can try.
 

autodidact

Veteran
Veteran
Joined
Nov 13, 2020
Messages
75
Reaction score
62
First Language
English
Primarily Uses
RMMV
Happily, $gameActors is one of the variables that get saved with the game data on save.
I just tested it myself (on MV).

You probably found that out already, but I wanted to spell it out for anyone else that stumbles here.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,646
Reaction score
15,732
First Language
English
Primarily Uses
RMMV

I've moved this thread to Learning Javascript. Thank you.

 

Latest Threads

Latest Profile Posts

I wonder how one goes about picking a good font for a game. I find the default kinda lacking, but you gotta pick a font that's legible ya know.
Did you check out the new Restaff yet? ;3
I am proud of how much my friends are pure talent. This one is making my game possibilities bigger and bigger and I wanna share his word:
Fun fact. Today it's exactly 2600 days since I met my now gf for the first time. Sometimes being a programmer can be really useful. O:)

Forum statistics

Threads
118,473
Messages
1,116,202
Members
155,454
Latest member
mustluvv
Top