MZ Actor Gains Skill/Levels Up Class After Parameter Condition Met?

Here's what I'm trying to do:
Create a weapon system that affects a character's class, so they gain proficiency in a type of weapon, while also periodically gaining new skills tied to that weapon, and ultimately becoming a class based on that (sub)weapon. For instance, a Sword Fighter could use light blades or heavy blades. Light blades would allow more swings per attack while heavy blades would be all about slow power, and fighters could eventually become fencers or knights depending on which weapon they favor.

What I've done so far:
I've been using Eli's Custom Parameters plugin to make special parameters for each type of weapon (light swords, heavy swords, staffs, wands, etc etc). I made numerous attacks in the skills category, with each one tied to each parameter so when that attack is used it will add one to that parameter. And then each type of weapon would use that specific attack, so if the character is wielding a light sword, the parameter for the light sword would go up by one with every attack.

What I don't know how to do:
I'd like to find a plugin that can give a character a new skill / change their class when the parameter levels are reached, either announced during battle or by adding a message to the battle report (the thing at the end of battle that says how much gold & XP you got). Also, I'm not sure how to use Eli's Custom Parameters in damage formulas, or if that's a thing or not, but I'd like to, or if there's a way to use the number of the parameter for a damage formula even in a roundabout way. Thanks for any advice!
Hi there!

You can use the Eli Custom Parameters on the damage formula just like any parameter.
Just reference them using the Short Name:
1665448950661.png

1665448982920.png
Hi there!

You can use the Eli Custom Parameters on the damage formula just like any parameter.
Just reference them using the Short Name:
Awesome! And thanks so much for the quick response! 🙂 Your plugin rocks!

[edit: I'm having some more trouble getting this to work right, unfortunately. I'm not sure if I'm just doing something wrong or what.

So I have this in the note box for a skill:

Code:
<JS Post-Apply>

user.addCParam(MSXP,1);

</JS Post-Apply>

And I have that skill set as an attack for a specific weapon. And then in the troops events I have a conditional branch to check if the parameter is changing:

Code:
◆If:Script:$gameParty.members()[0].MSXP == 1
  ◆Text:None, None, Window, Bottom
  :    :It's 1
  ◆
:End
◆If:Script:$gameParty.members()[0].MSXP == 2
  ◆Text:None, None, Window, Bottom
  :    :It's 2
  ◆
:End

(I've also tried it with an else branch.) But I can't get it to ever give me the "it's 2" message, which leads me to think it's not adding to the parameter. Any idea what I'm doing wrong?
Had some help with this on a Discord. It seems like the short names aren't working? Got it to work with using the numbers instead. Would really love to find an easier way of giving level ups to job classes rather than making long conditional branch statements in battle events. Anyone know a better way?
Hmm. This sounds interesting! There's Galv's Weapon Proficiency plugin. Which allows actors to be more effective with weapon types ala Final Fantasy II.

Info:
Code:
Actors will have a new value for each weapon type in your project.
These values represent their proficiency with each weapon and can give a bonus
to their hit chance and critical rate when wielding them.
You can also add code to skill damage formulas to take the actor's weapon
proficiency of the currently equipped weapon into account and use it in the equation.
-
You can use the battler's currently equipped weapon proficiency in the damage formula.
This can be done by referring to a (attacker) or b (the target)and using wProf().
For example: a.atk + a.wProf() - b.def
-
Enemies can also each have a single weapon proficiency value for use in any skill formula calculations.

Script Calls:
Code:
Galv.WPROF.value(aId,wId);
aId = actor ID, wId = weapon type ID
Return an actor's weapon proficiency.
Leave wId out to get the currently equipped weapon ID.

Now you can use js to call an actor's weapon proficiency and if it is a certain level then you can show the skill in the menu. If you're using VS Skill/State Core there are notetags that allow this.

Notetags:
Code:
<JS Skill Visible>
if
Galv.WPROF.value(1);   == >20
then true or some sht idk i barely know how to code lmfao
</JS Skill Visible>

Then you would just need to set that notetag into each skill for each weapon type you want.

Database example:

WPN TYPES
Light Weapons- Wpn Type ID (1)
Heavy Weapons- Wpn Type ID (2)

SKILLS
Light Weapon Skills:
Light Strike - Skill ID (1) - Use JS Visible notetag to show at desired prof, ex = 2
Light Slash - Skill ID (2) - Use JS Visible notetag to show at desired prof, ex = 4

Heavy Weapon Skills:
Heavy Strike - Skill ID (3) - Use JS Visible notetag to show at desired prof, ex = 3
Heavy Slash - Skill ID (4) - Use JS Visible notetag to show at desired prof, ex = 5

WEAPONS
Light Weapon Items:
Dagger - Wpn Item ID (1) - Grant Skill ID (1)
Sword - Wpn Item ID (2) - Grant Skill ID (2)

Heavy Weapon Items:
Mace - Wpn Item ID (3) - Grant Skill ID (3)
Axe - Wpn Item ID (4) - Grant Skill ID (4)

---

Untested but what I believe should be the example expected results:

* Weapon Master class uses Light Weapon types and Heavy Weapon types
* If Weapon Master equips a Dagger or Sword he will raise Light Weapon prof
* If Weapon Master equips a Mace or Axe he will raise Heavy Weapon prof
* Dagger grants Light Strike skill
* Sword grants Light Slash skill
* Light Strike skill has notetag to show when Light Weapon prof equals 2
* Light Slash skill has notetag to show when Light Weapon prof equals 4
* Mace grants Heavy Strike skill
* Axe grants Heavy Slash skill
* Heavy Strike skill has notetag to show when Heavy Weapon prof equals 3
* Heavy Slash skill has notetag to show when Heavy Weapon prof equals 5
* When Wpn Mstr uses enough skills with the Weapon Type equipped he will gain weapon prof level
* At Light Weapon prof 2 with Dagger equipped he can use Light Strike
* At Light Weapon prof 4 with Sword equipped he can use Light Slash
* At Heavy Weapon prof 3 with Mace equipped he can use Heavy Strike
* At Heavy Weapon prof 5 with Axe equipped he can use Heavy Slash

So on and so forth with each weapon, type, and skills you want them to learn.

---

And for changing classes you could use a plugin or just use common events.

You could use a plugin to run a common event after every battle start/turn/end or do it via the database troop events.

The common event would check your weapon prof using script calls, the same way used above showing the skills in the menu. And then if your weapon prof is a certain level when the turn/battle ends, then change your class.
Wow thanks for the info, I'll check that plugin out! I really need a plugin to automate gaining skills/changing class tho as well since otherwise it'll be a huge conditional branch. If nothing else tho I can event it just fine.
Wow thanks for the info, I'll check that plugin out! I really need a plugin to automate gaining skills/changing class tho as well since otherwise it'll be a huge conditional branch. If nothing else tho I can event it just fine.

Could you give me more info on how you are gaining skills?

You have a weapon proficiency system that affects character's class promotion.
You learn skills based on the specific equipped weapon eg Steel Sword.
You change class based on the weapon type of the weapon equipped eg Light Bladed Weaponry.

Is that correct?
Yes that's all correct. I would either have a message pop up during or after battle (or preferably in the after battle message that says things like XP and Gold earned) that would say "You Learned X Skill" and "You Earned X Class."

[edit: And the class change occurs when you level up your proficiency in that particular weapon.]
Hmm. Maybe you could look into Fomar's Learn Skill Equipment plugin.

There's been some recent discussion and activity on the thread that you can read through to give you some more insight and ideas on how to implement.

So you can use Fomar's plugin to have your weapons grant skills after gaining a certain amount of AP is earned.

There's a thread here that utilizes Fomar's plugin to gain AP after skill use as a mastery system.

You could then tie that in with VS Class Change plugin and allow for auto unlocks at certain AP threshholds.

<Auto Unlock Requirements>
Class id: x AP
Class name: x AP
AP: x
</Auto Unlock Requirements>

I bet someone much smarter than I can tell you what js code/functions you would need to link them.

Speculating here but you may be able to utilize all of the plugins I mentioned together to achieve what you want.

In Galv's plugin there's this bit of code:
Code:
Game_Actor.prototype.gainWProfXp = function(amount,wType) {
    // get current wielded weapon type if none specified
    var wType = wType || this.equippedWType();
    this._wProf[wType] = this._wProf[wType] || 0;
    // Check WP levels
    var currentWp = this.getWProf(wType);
    var maxWp = this.getWProfMax(wType);
    if (currentWp >= maxWp) return; // At max, don't gain xp
    // Add xp
    this._wProfXp[wType] = this._wProfXp[wType] || 0;
    this._wProfXp[wType] += amount;
    // Check for level
    var xpRequired = Galv.WPROF.baseXp + (Galv.WPROF.levelXp * currentWp);
    if (this._wProfXp[wType] >= xpRequired) {
        // gain a weapon proficiency point.
        this._wProf[wType] += 1;
        // set xp for next WP level up
        this._wProfXp[wType] -= xpRequired;
        // play animation of gaining weapon proficiency
        if (SceneManager._scene.constructor.name == 'Scene_Battle') this.startAnimation(Galv.WPROF.profUpAnim, false, 0)
    }
};

The line I believe you could change is this one:
this._wProf[wType] += 1;

and change the +=1 to reference how much AP you gain from Fomar's plugin instead. I think that's possible but I'm not 100% sure.

Then when you gain AP it will go towards 3 different things:
1. AP to Weapon Proficiency
2. AP to Equipment Skills
3. AP to Class Level

Like I said though, idk if that's possible but I think it could work with someone else's expertise.
Oh wow that looks great! I'll check it out and see if I can get it to do what I need. Thank you so much for all the help!
Sure! And here's one more plugin that you might be interested in as well:

It doesn't look like Galv's Weapon Proficiency has an MZ equivalent. Do you know if it works with MZ or is it MV only?
It doesn't look like Galv's Weapon Proficiency has an MZ equivalent. Do you know if it works with MZ or is it MV only?

Ah yes, I forgot to mention you will need FOSSIL for Galv's plugin.

Original thread: https://forums.rpgmakerweb.com/threads/actor-gains-skill-levels-up-class-after-parameter-condition-met.151905/