I thought I had figured this out but seems I just thought I did.
What I'm trying to do specifically at the moment is add homemade variables to Game Data: Enemy: [1.]'s DEF. It looks like I'm going to need some kind of script to do this - because unless I'm just being blind or stupid (both possible) the only parameters you are allowed to change through events for an enemy is HP and MP and that's not going to cut it for my game.
So if someone could describe the process of how I can add my variables to the Game Data it would be a big help. Ideally something that looks like this:
[Enemy 1.]'s DEF = [Homemade Variable 1]
You can't change the DEF of a monster outside the editor, but usually that's not neccessary for two reasons:
1) You can change the DEF by adding a state or a buff to the monster
2) You can modify all skill's damage formulas
The first solution requires careful definition of the buff/state's removal options and has a few difficulties in finetuning
The second solution requires a lot of work in programming the skills since you'll have to change all skills, but allows full control.
If you read about the parameter's description in the help files, you'll learn that ATK, DEF, MAT and MDF have absolutely no hardcoded function in the engine.
They are ONLY used in the damage formula - and if you don't like the default damage formula of 4*ATK-2*DEF, then simply write another formula there.
And since that is a scripted field, you can access all ruby commands and all variables from there...
Tell us why you would want to make the enemies DEF variable and we'll give you the best solution to get to that - scripts aren't neccessary in most simple cases, they would only be needed for extremely rare cases of complex formulae...
It has a bug.
I will post it again when I fixed it.
Add this script:
class Game_Enemy < Game_Battler def change_param(param_id, value) enemy.params[param_id] = value endendCall Script:
$game_troop.members[ID].change_param(param_id, value)ID: 1, 2, 3,... (in Troops)
param_id: (0 is Max HP, 1 is Max MP)
def mhp; param(0); end # MHP Maximum Hit Points def mmp; param(1); end # MMP Maximum Magic Points def atk; param(2); end # ATK ATtacK power def def; param(3); end # DEF DEFense power def mat; param(4); end # MAT Magic ATtack power def mdf; param(5); end # MDF Magic DeFense power def agi; param(6); end # AGI AGIlity def luk; param(7); end # LUK LUcKvalue: the var.
using that script, you should check wether that data is consistent through savegames or not. Or you should use that to set the values anew before each battle.
I don't know what part of the editor data and database is included in the savegame and what not, and everything that is not in the savegame will revert to original values whenever a game is loaded...
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.