RMMV Help with Yanfly's Skill Learn Plugin? Trying to do a custom skill cost where the cost is lower if the actor knows a skill/skills.

Status
Not open for further replies.

Terozu

That guy who started two years ago. (wow O:)
Veteran
Joined
Mar 3, 2019
Messages
58
Reaction score
39
First Language
English
Primarily Uses
RMMV
So I'm trying to use the Skill Learn plugin along with the JP Plugin, and it works fine, but I'm I'm stuck on how to do a custom skill cost.

What I'm doing is a basic Job system, the player can learn a variety of skills in each job, for example;

Lower Encounters - 5 JP
Poison Immunity - 5 JP
First Aid - 5 JP

Then there's another skill;

Increase Job Level - 50 JP

Learning this skill unlocks the next set of skills for the Job, which have their own costs.
What I'm trying to do is lower the JP cost of 'Increase Job Level' if one or more of the other skills are learned, so if the player learns 'Lower Encounters', 'Increase Job Level' should have it's cost reduced.

Like this;

Lower Encounters - Learned
Poison Immunity - 5 JP
First Aid - 5 JP

Increase Job Level - 47 JP

And if multiple skills are learned, it should drop further, for example;

Lower Encounters - Learned
Poison Immunity - Learned
First Aid - 5 JP

Increase Job Level - 44 JP

Does anyone know a way to do this? It should be noted that any character in the party can use any job.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,673
Reaction score
2,760
First Language
EN
Primarily Uses
RMMZ

I've moved this thread to JavaScript/Plugin Support. Thank you.

(You originally posted this in MV Support, but plugin/scripting stuff has its own areas here.)

Plugin link for ease of reference:
Maybe try something like this:

<Custom Learn JP Cost> cost = 50; if (user.isLearnedSkill(10)) cost -= 3; if (user.isLearnedSkill(11)) cost -= 3; // etc </Custom Learn JP Cost>
I.e.
  • Start at cost = 50.
  • If skill ID 10 has been learned: -3 to cost.
  • If skill ID 11 has been learned: -3 to cost.
  • Etc
Alternatively, if all those skills apply the same deduction:

<Custom Learn JP Cost> cost = 50; for (var i of [10, 11, 12, 13, 14]) { if (user.isLearnedSkill(i)) cost -= 3; } </Custom Learn JP Cost>
I.e.
  • Start at cost = 50.
  • For each of the IDs 10, 11, 12, 13, and 14:
    • If that skill is learned: -3 to cost.
 

Terozu

That guy who started two years ago. (wow O:)
Veteran
Joined
Mar 3, 2019
Messages
58
Reaction score
39
First Language
English
Primarily Uses
RMMV
[move]JavaScript/Plugin Support[/move](You originally posted this in MV Support, but plugin/scripting stuff has its own areas here.)

Plugin link for ease of reference:
Maybe try something like this:

<Custom Learn JP Cost> cost = 50; if (user.isLearnedSkill(10)) cost -= 3; if (user.isLearnedSkill(11)) cost -= 3; // etc </Custom Learn JP Cost>

I.e.
  • Start at cost = 50.
  • If skill ID 10 has been learned: -3 to cost.
  • If skill ID 11 has been learned: -3 to cost.
  • Etc
Alternatively, if all those skills apply the same deduction:

<Custom Learn JP Cost> cost = 50; for (var i of [10, 11, 12, 13, 14]) { if (user.isLearnedSkill(i)) cost -= 3; } </Custom Learn JP Cost>

I.e.
  • Start at cost = 50.
  • For each of the IDs 10, 11, 12, 13, and 14:
    • If that skill is learned: -3 to cost.
Hey, this worked perfectly! I know enough about coding that in retrospect, it actually seems kind of obvious now that I'm awake a little, but I still had no idea how to check if the Actor knew the skill.

I appreciate the help.

(And sorry, I saw another plugin help request in there, or what looked like one since it mentioned Visustella, so I just assumed I had the right place with that and MV. I seem to make this mistake a lot though, so still, I'm sorry for the trouble.)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,673
Reaction score
2,760
First Language
EN
Primarily Uses
RMMZ
Great, you're welcome!

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.

And no worries: lots of threads get moved, it's not a big deal. We're just trying to keep things organised~
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Update on the Unity thing: I had to redo all my map graphics for Unity because the originals were from XP, but it actually looks so much better now in Unity, so I genuinely might make the switch.
Messing around with fragment shaders (filters). This thing is HUGE and I'm surprised almost no one makes good use of. Even the number of plugins that do this stuff are limited.
ScreenShot_6_28_2022_3_2_40.png

There's 7 main areas in the game that are all connected. This train get's you from an underground lab to the center of someone's subconscious. inside the train you can talk to some of the passengers. but going to the top of it, there's battles.
Speedrunning all character portraits just so they all have the same quality. Not sure if this was a good idea, but now I'm almost done.
We now have a gameplay video!

Forum statistics

Threads
123,154
Messages
1,154,453
Members
161,503
Latest member
Asinthew
Top