I'm working on a non-leveling type system with RPG Maker MV, I can level skills just fine, and other attributes but I want to make it so whenever you're attacked by an enemy and "MISS" appears the actors "AgiEXP" increases and once it reaches the MaxAgiExp you level up your Agility and gain more to it. I've searched for methods but cannot seem to find my answer. Any and all help is most appreciated.
Tracking "MISS" and adding a set variable to level up a stat
● ARCHIVED · READ-ONLY
-
-
Bump, not sure the rules on bumping.
-
Well this can be done using Yanfly's Buffs and States Core Plugin and his Auto Passive States Plugin.
Make a state and add that state's id in the passive states 'Actor Passives' parameter to make it active for all actors.
Then, in the state notebox, use this notetag:
<Custom Deselect Effect>
var paramId = 6; // Agility Param Id
target._agiExp = target._agiExp || 0;
var maxAgiExp = value; // The value for maxAgiExp
if (target.result().miss) {
var agiExpGain = value; // How much agiExp to gain if miss
target._agiExp += agiExpGain;
if (target._agiExp >= maxAgiExp) {
var agiGain = value; // How much agility to gain if agility level up
target.addParam(paramId, agiGain);
target._agiExp = 0;
}
}
</Custom Deselect Effect>
Replace the terms 'value' in red with numbers to fit your game. I mentioned what each value is for.
Also, if you wanted to give a different maxAgiExp per actor, you could replace this line:
Code:var maxAgiExp = value;
with this:
Code:var maxAgiExp = eval(target.meta.maxAgiExp);
And add the notetag <maxAgiExp:value> on each actor's notebox.
You could also make it class specific by adding the above notetag to each class instead, and replacing the maxAgiExp line with:
Code:var maxAgiExp = eval(target.currentClass().meta.maxAgiExp); -
Well this can be done using Yanfly's Buffs and States Core Plugin and his Auto Passive States Plugin.
Make a state and add that state's id in the passive states 'Actor Passives' parameter to make it active for all actors.
Then, in the state notebox, use this notetag:
<Custom Deselect Effect>
var paramId = 6; // Agility Param Id
target._agiExp = target._agiExp || 0;
var maxAgiExp = value; // The value for maxAgiExp
if (target.result().miss) {
var agiExpGain = value; // How much agiExp to gain if miss
target._agiExp += agiExpGain;
if (target._agiExp >= maxAgiExp) {
var agiGain = value; // How much agility to gain if agility level up
target.addParam(paramId, agiGain);
target._agiExp = 0;
}
}
</Custom Deselect Effect>
Replace the terms 'value' in red with numbers to fit your game. I mentioned what each value is for.
Also, if you wanted to give a different maxAgiExp per actor, you could replace this line:
Code:var maxAgiExp = value;
with this:
Code:var maxAgiExp = eval(target.meta.maxAgiExp);
And add the notetag <maxAgiExp:value> on each actor's notebox.
You could also make it class specific by adding the above notetag to each class instead, and replacing the maxAgiExp line with:
Code:var maxAgiExp = eval(target.currentClass().meta.maxAgiExp);
This is amazing thank you very very much!
EDIT: I'm actually getting an error.
Code:CUSTOM STATE 10 CODE ERROR YEP_RowFormation.js:2437 var paramId = 6; target._agiExp = target._agiExp || 0; var maxAgiExp = eval(target.meta.maxAgiExp); if (target.result().miss) { var agiExpGain = 1; target._agiExp += agiExpGain; if (target._agiExp >= maxAgiExp) { var agiGain = 4; target.addParam(paramId, agiGain); target._agiExp = 0; } } YEP_RowFormation.js:2438 TypeError: Cannot read property 'maxAgiExp' of undefined {stack: (...), message: "Cannot read property 'maxAgiExp' of undefined"} YEP_RowFormation.js:2436 CUSTOM STATE 10 CODE ERROR YEP_RowFormation.js:2437 var paramId = 6; target._agiExp = target._agiExp || 0; var maxAgiExp = eval(target.meta.maxAgiExp); if (target.result().miss) { var agiExpGain = 1; target._agiExp += agiExpGain; if (target._agiExp >= maxAgiExp) { var agiGain = 4; target.addParam(paramId, agiGain); target._agiExp = 0; } } -
Oops, my bad. Made a mistake with the meta tagging.
Instead of this line:
Code:var maxAgiExp = eval(target.meta.maxAgiExp);
Use these lines:
Code:var actorId = target.actorId(); var actor = $dataActors[actorId]; var maxAgiExp = eval(actor.meta.maxAgiExp);
So it'll look like:
var paramId = 6;
target._agiExp = target._agiExp || 0;
var actorId = target.actorId();
var actor = $dataActors[actorId];
var maxAgiExp = eval(actor.meta.maxAgiExp);
if (target.result().miss) {
var agiExpGain = 1;
target._agiExp += agiExpGain;
if (target._agiExp >= maxAgiExp) {
var agiGain = 4;
target.addParam(paramId, agiGain);
target._agiExp = 0;
}
} -
Oops, my bad. Made a mistake with the meta tagging.
Instead of this line:
Code:var maxAgiExp = eval(target.meta.maxAgiExp);
Use these lines:
Code:var actorId = target.actorId(); var actor = $dataActors[actorId]; var maxAgiExp = eval(actor.meta.maxAgiExp);
So it'll look like:
var paramId = 6;
target._agiExp = target._agiExp || 0;
var actorId = target.actorId();
var actor = $dataActors[actorId];
var maxAgiExp = eval(actor.meta.maxAgiExp);
if (target.result().miss) {
var agiExpGain = 1;
target._agiExp += agiExpGain;
if (target._agiExp >= maxAgiExp) {
var agiGain = 4;
target.addParam(paramId, agiGain);
target._agiExp = 0;
}
}
So no more errors, but it doesn't seem to want to add onto my agi attribute, did i need to make the variables myself? Or are they only being made for the JS part of this condition? -
Replace target.result().miss with target.result().missed. My bad :rswt
-
Replace target.result().miss with target.result().missed. My bad :rswt
That did it, thanks again! :)