Need help creating an upgradeable Skill system.

Hello everyone, I hope I'm posting this in the right place...

So I've been trying to create an upgradeable Skill system in my game, using Yanfly's Job Points and Skill Learn Plugins.
Unfortunately, my head is kinda whirling on this so I think I need some guidance from people as to how this could be achieved.


Here's an example of how I'd like it to work:

One Actor gains some Job Points and can now spend them to learn a new skill: Spellbane Slash.
This Skill has a 60% chance of reducing the target's Magic stat for 5 rounds.

(I've managed to get this far with the plugins, no problem).

Now, what I'd like next is for the Actor to be able to spend additional Job Points on the same Skill to upgrade it. For instance:
By spending 1 more Job Point on Spellbane Slash, it increases the chance of taking effect by 10% (up to 70% from 60%), and then so on until it reaches the maximum of 90% chance (and a total cost of 3 additional Job Points).

Where this gets complicated is I would also like the Actor to have the choice of upgrading Spellbane Slash to increase its duration: from 5 rounds to 6 (for 1 Job Point), to a maximum duration of 7 rounds.

The key thing is that the player has the option on how to upgrade the skill, rather than following a linear path.


I've looked into the Stat Upgrades tips & tricks but it seems to only allow for a linear progression of upgrades, rather than a choice. Can this be made to work as above?

I've been looking at trying to use variables to make this work but it's making my brain hurt at the moment 😛

Can anyone help point me in the right direction?
Thanks in advance for any guidance, and thanks for your time on this!
The problem is that neither the plugins you mentioned nor the default engine are designed to do anything like this.

Using MV and those plugins, there's no way to modify the attributes of a skill. You would have to have a separate version of the skill in your database for every possible upgrade. You can then control which ones are seen as choices to be learned using the Learn Require Skill notetags.

An alternate approach would be to not learn that actual skill again, but a skill that improves things. For example, you might learn Fire Slash and Fireball and Scorching Rain and have available a Fire Proficiency skill.

Fire Proficiency would use Yanfly's Auto Passive States to have a passive state that will be on the actor once the skill is learned; then you can use a Buffs & States Core notetag (or a check in the damage formulae) to have fire skills do more damage once you've learned it.

But you'd want to use moderation in that approach, also, as you don't want an actor to have dozens of passive states.

I can't think of a way for you to achieve exactly what you're describing without commissioning a new plugin that creates a new kind of skill object that's stored on the actor and can have its properties modified during gameplay.
The problem is that neither the plugins you mentioned nor the default engine are designed to do anything like this.

Using MV and those plugins, there's no way to modify the attributes of a skill. You would have to have a separate version of the skill in your database for every possible upgrade. You can then control which ones are seen as choices to be learned using the Learn Require Skill notetags.
I had a feeling I might need to resort to this... Definitely worth a try, at least.

I can't think of a way for you to achieve exactly what you're describing without commissioning a new plugin that creates a new kind of skill object that's stored on the actor and can have its properties modified during gameplay.
Slightly off-topic, but where should I look to commission a plugin like this - and how much does commissioning a plugin usually cost?

Thanks for the help again 🙂 Good to know what the options are!
There's a commissions section listed in the forum. I haven't hired another coder, so I don't know how anyone's pay rates are structured. I imagine it would be based on how much time they expect to spend working on it.
If your upgrades are mainly supposed to enhance specific skills, one way to achieve that with the given tools would be to introduce passive skills. Those skills could have a custom "passive" category to be out of the way in the skill menu, but allow you to check if an actor has learned them to introduce custom effects.

The downside would be that most of the more custom effects would likely still require script commands, but using Yanflys free Skill Core plugin you could try to add something like this to your "Spellbane Slash"'s notebox:
Code:
<After Eval>
  if (b.result().isHit()) {
    let chance, effect;
    // Apply State 17 with a custom chance:
    chance = 0.6;
    if (a.isLearnedSkill(31)) chance += 0.1;
    if (a.isLearnedSkill(32)) chance += 0.1;
    if (a.isLearnedSkill(33)) chance += 0.1;
    effect = {
      code : Game_Action.EFFECT_ADD_STATE,
      dataId : 17,
      value1 : chance
    };
    this.applyItemEffect(b, effect);
    // Increase Duration of the added State:
    if (b.result().isStateAdded(17) && b.isStateAffected(17)) {
      if (a.isLearnedSkill(34)) b._stateTurns[17] += 1;
      if (a.isLearnedSkill(35)) b._stateTurns[17] += 1;
    }
  }
</After Eval>
17 in this example is the ID of a "Magic Down" state,
skills 31-33 are passive skills to boost the success chance,
skills 34 and 35 are passive skills to boost the state duration.

You can look up the codes of other effects in your projects "js/rpg_objects.js" file line 1192ff:
Spoiler
Code:
Game_Action.EFFECT_RECOVER_HP       = 11;
Game_Action.EFFECT_RECOVER_MP       = 12;
Game_Action.EFFECT_GAIN_TP          = 13;
Game_Action.EFFECT_ADD_STATE        = 21;
Game_Action.EFFECT_REMOVE_STATE     = 22;
Game_Action.EFFECT_ADD_BUFF         = 31;
Game_Action.EFFECT_ADD_DEBUFF       = 32;
Game_Action.EFFECT_REMOVE_BUFF      = 33;
Game_Action.EFFECT_REMOVE_DEBUFF    = 34;
Game_Action.EFFECT_SPECIAL          = 41;
Game_Action.EFFECT_GROW             = 42;
Game_Action.EFFECT_LEARN_SKILL      = 43;
Game_Action.EFFECT_COMMON_EVENT     = 44;
As for the other fields, the "dataId" is always the database id of the effect item or, if the item is not a database entry, its position in the drop down list (starting at 0).
The value1 and value2 (if used) are the contents of the first- and second number fields of the effect (1.0 = 100% for percentages)

The code to increase the state turns may not work with certain plugins.
you could try to add something like this to your "Spellbane Slash"'s notebox:
That's a good call.

Just as a note, you wouldn't need to use a different skill type. If you just set the skills to Occasion: None, they won't show up in any skill lists after you learn them.
You guys are geniuses!

It freaking works 😀 Thanks so much!
After looking at in the editor one would not even have to do a custom category, as the default category is already "None". I may be mistaken here from what I remember "Occasion: None" should not prevent the skill from getting shown, it will just permanently disable it (which may or may not be what you are looking for).

I've been looking at trying to use variables to make this work but it's making my brain hurt at the moment 😛
If you prefer to work with variables instead of creating 10 different passive skills, there may be ways to do that too:

Digging deeper into the Skill Learn plugin, you could create a passive skill that counts up a variable when learned and then unlearns itself until the maximum rank is reached:
Code:
<Learn Cost Eval>
  v[51] += 1;
  if (v[51] < 3) {
    a.forgetSkill(31);
  }
</Learn Cost Eval>

One technical quirk is that if you want to use v[51] in effects like this or the damage formula, you may need to initalize the variable first, for example by explicitely setting it to 0 at the beginning of the game.
If the variable has never been set v[51] will return undefined instead of 0 and likely break your script.

Another advantage of using variables might also be that you can also include them in your skills description through message codes.
One technical quirk is that if you want to use v[51] in effects like this or the damage formula, you may need to initalize the variable first
You could use $gameVariables.value(51) and $gameVariables.setValue(51, $gameVariables.value(51)+1) for that and sidestep having to initialize, no?
incidentally, i had only learned about v[x] a few hours ago, but the getter already checks for the value being undefined and returns 0 in that case
Thanks for the help, guys 🙂
Moving on to making other types of skills like this, I can see from the list of other effects that I could effect the TP gain, problem is as a pleb who can't code, I'm not sure how to apply this.

Like, I get what the code you wrote is doing at each step, but I wouldn't know how to get the game to understand: 'I have used this skill, it checks for these additional passive skills (as above) and now it gives 10 TP as well (Short of swapping add state for Game_Action.EFFECT_GAIN_TP).

On a similar note, is there a way to increase the damage of a skill using this method?

Sorry for the stupid questions.
Hey,

The effects listed mimic the ones you can put into the "effects" box of your skill. Replace the "dataId" value with the database ID or the position (starting at index 0) of the item from the drop down list (if the effect uses one), and replace "value1" and "value2" with the contents of the first- and second number text field (if the effect uses them).
For the gain TP example, since the effect only uses a text field, you could write it like this:
Code:
effect = {
  code : Game_Action.EFFECT_GAIN_TP,
  value1 : 12
};

That said, most of these effects can usually be replaced with a single line of code. Adding a state is an outlier here since the effect will also take the enemies resistance and luk into account.

To increase the targets TP you can use b.gainTp(12); for example.

"Call Common Event" will also not work as an effect since this one is handled separately, but you can use $gameTemp.reserveCommonEvent(12); instead.

A starting place for this and other script commands could be the pinned RPG Maker MV / MZ Script Call List.

On a similar note, is there a way to increase the damage of a skill using this method?
The damage formula is interpreted as Javascript code, so pretty much anything can be added there as well. A simple way of increasing the damage by 50% if a specific skill is learned could be something like this:
(original formula) * (a.isLearnedSkill(36) ? 1.5 : 1)

For more options what to put in the damage formula box see the pinned RMMV Damage Formula - ideas and help.
This works fantastically!

Thank you so much 😀

Original thread: https://forums.rpgmakerweb.com/threads/need-help-creating-an-upgradeable-skill-system.163810/