IS IT POSSIBLE TO CHANGE ENEMY STATS ON THE FLY? [SCRIPTING] [RMMV]

Posts

Pages: 1
I've hit a wall trying to figure out how to change the stats of a particular enemy from battle. I've found that I can call up an enemy's stats to be viewed, for example I can see the agility of the first enemy in a battle using either $gameTroop.members().param(6) or $gameTroop.members().agi

However, when I try to assign these, first from a script as above and then (thinking it was a scope problem) from a plugin that creates a function within Game_Troop, when the game isn't crashing it seems to be ignoring the command. This function, for example, seems to do nothing at all when called:

Game_Troop.prototype.agilityup = function() {
this.members().agi = 14
};

Thanks for any help you can provide.
You could just use a hidden buff that increases the stat by percentage. It wouldn't be hard to add in battle and you can have the same status effect/buff change a bunch of them.
author=Liberty
You could just use a hidden buff that increases the stat by percentage. It wouldn't be hard to add in battle and you can have the same status effect/buff change a bunch of them.


Thank you for your help. I'm not sure if this solution would do everything I want, but it got me looking in the right place. I ended up in the section of Game_Battler that alters stats for all battlers, and I found that I can change current hp in this manner:
this._hp = value;

while parameters have the following
this._paramPlus[paramId] += value;

and happily this seems to work when applied to troop members.

Currently I'm still stumped on everything else that makes an enemy (such as exp and gold drop) but I think this opens up a lot of doors for me.
Pages: 1