Help with Yanfly's 'Skill Learn System' Plugin

Status
Not open for further replies.

Zakarijah

I love making maps!
Veteran
Joined
Aug 18, 2019
Messages
121
Reaction score
16
First Language
English
Primarily Uses
RMMV
I'm using Yanfly's 'Skill Learn System' to raise a character's MaxHP by 10 every time he upgrades using this skill.

Similar to how the JP cost increases by 50 per each learning, I'd like the MaxHP to increase by an additional 5 points each time it's learned.

So it would level up like so each time.

1st) HP +10 --- 100 JP
2nd) HP +15 --- 200 JP
3rd) HP +20 --- 300 JP

I know next-to-nothing about JS, so any help would be GREATLY appreciated :D

(the '0' below is the parameter ID for MHP)

<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 0;
// Increase the parameter by this amount.
user._paramPlus[0] += 10;
// Adjust the number of times upgraded by 1.
user._upgradeParam[id] += 1;
// Make the user forget the skill.
user.forgetSkill(3);
// Refresh the user.
user.refresh();
</Learn Cost Eval>

<Custom Learn JP Cost>
// Set the param ID of the stat you wish to adjust.
var id = 0;
// Default the user's upgrade parameter times to empty.
user._upgradeParam = user._upgradeParam || [];
user._upgradeParam[id] = user._upgradeParam[id] || 0;
// Adjust the cost of
cost = user._upgradeParam[id] * 100;
</Custom Learn JP Cost>

<Custom Cost Display>
\}Passive\{
</Custom Cost Display>

<Hide in Battle>
 
Last edited:

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
399
Reaction score
221
First Language
English
Primarily Uses
RMMV
I don't have any real experience with Yanfly's Skill Learn System, but as it's just a js eval I'll take a stab anyway.

As the first increase (level 0 -> 1) is 10 and the rest are 5, we just need to say add 5 extra on the first upgrade.

Code:
<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 0;
// If this is the first time upgrading parameter add an extra 5.
if (user._upgradeParam[id] === 0) {
   user._paramPlus[id] += 5
}
// Increase the parameter by this amount every additional level.
user._paramPlus[id] += 5;
// Adjust the number of times upgraded by 1.
user._upgradeParam[id] += 1;
// Make the user forget the skill.
user.forgetSkill(3);
// Refresh the user.
user.refresh();
</Learn Cost Eval>
 

Zakarijah

I love making maps!
Veteran
Joined
Aug 18, 2019
Messages
121
Reaction score
16
First Language
English
Primarily Uses
RMMV
I don't have any real experience with Yanfly's Skill Learn System, but as it's just a js eval I'll take a stab anyway.

As the first increase (level 0 -> 1) is 10 and the rest are 5, we just need to say add 5 extra on the first upgrade.

Code:
<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 0;
// If this is the first time upgrading parameter add an extra 5.
if (user._upgradeParam[id] === 0) {
   user._paramPlus[id] += 5
}
// Increase the parameter by this amount every additional level.
user._paramPlus[id] += 5;
// Adjust the number of times upgraded by 1.
user._upgradeParam[id] += 1;
// Make the user forget the skill.
user.forgetSkill(3);
// Refresh the user.
user.refresh();
</Learn Cost Eval>
Okay, so I put this in and replaced all the [id] with 0 but all it did was increase my HP by 10 the first time, and then added only 5 afterwards. It wasn't stacking as +10, +15, +20, etc.

I may have just done something wrong?

Was I not supposed to replace my old <Learn Cost eval> with this one you provided?
 

Zakarijah

I love making maps!
Veteran
Joined
Aug 18, 2019
Messages
121
Reaction score
16
First Language
English
Primarily Uses
RMMV
I don't have any real experience with Yanfly's Skill Learn System, but as it's just a js eval I'll take a stab anyway.

As the first increase (level 0 -> 1) is 10 and the rest are 5, we just need to say add 5 extra on the first upgrade.

Code:
<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 0;
// If this is the first time upgrading parameter add an extra 5.
if (user._upgradeParam[id] === 0) {
   user._paramPlus[id] += 5
}
// Increase the parameter by this amount every additional level.
user._paramPlus[id] += 5;
// Adjust the number of times upgraded by 1.
user._upgradeParam[id] += 1;
// Make the user forget the skill.
user.forgetSkill(3);
// Refresh the user.
user.refresh();
</Learn Cost Eval>
So I did input the custom eval incorrectly.

Thanks so much!
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top