Yanfly Skill Learn System - Question (about Lunatic code?)

Nantas

- Game developer -
Veteran
Joined
Jan 7, 2017
Messages
209
Reaction score
138
First Language
French
Primarily Uses
RMMV
Hello everyone !

I have a little question about a functionnality I would like to add to my game.
I am using the Yanfly's Skill learn system plugin.

I have created three skills, that are three versions of the fire spell. Each version is a bit better than the others.
(it's in fact like : Fire I, Fire II, Fire III)

I have no knowledge in javascript at all, that's why I am asking here : how could I make the Fire I disappear when you've learned Fire II, because you don't need Fire I anymore ?

It would be nice if the Fire I skill could disappear both in the skill learn scene and in combat when you choose your skills.
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
696
Reaction score
215
First Language
Vietnamese
Primarily Uses
RMMV
I guess it won't be too hard to do this. Let's mark Fire 1 as ID 1, Fire 2 as ID 2 and Fire 3 as ID 3 (Skill IDs in database, for example).
So for Fire 1, i think this note tag should help:
<Learn Show Eval>
if (user.hasSkill(2) || user.hasSkill(3)){
value = false;}
else{
value = true;}
</Learn Show Eval>
This will make Fire 1 disappear from Skill Learn window when you have Fire 2 or 3.
If you want to remove lower level skill when you are learning a higher level skill, for example you learn Fire 2 and want Fire 1 to disappear, put this note tag on Fire 2:
<Learn Cost Eval>
user.forgetSkill(1);
</Learn Cost Eval>

or you can simply use this note tag on Fire 1 if you have Yanfly's Skill Core plugin and don't want to play with Javascript:
<Hide if Learned Skill: 2>
This should remove Fire 1 from your skill list, and with that <Learn Show Eval> above, Fire 1 won't appear in your Skill Learn window again. For an easier way to erase a skill from Skill List,

The problem is we are checking user's skills manually, so if you have Fire 10, that "If" would be very long, but i can only help you this much.
Remember to change skills' IDs to fit your purpose.
 
Last edited:

SwiftSign

Veteran
Veteran
Joined
Aug 5, 2015
Messages
184
Reaction score
45
First Language
English
Primarily Uses
RMMV
^ Assuming that you have to learn them in order, then you can just keep using the <hide if learned skill: x> for each skill. It'll remain learnt, but hidden from the menu, so you just need to check whether the skill above is learnt and if so to hide it.

Should work OK with minimal effort?
 

Nantas

- Game developer -
Veteran
Joined
Jan 7, 2017
Messages
209
Reaction score
138
First Language
French
Primarily Uses
RMMV
It works perfectly ! Thank you you both !
 

masterorochimaru

Villager
Member
Joined
Jan 14, 2016
Messages
21
Reaction score
5
I guess it won't be too hard to do this. Let's mark Fire 1 as ID 1, Fire 2 as ID 2 and Fire 3 as ID 3 (Skill IDs in database, for example).
So for Fire 1, i think this note tag should help:
<Learn Show Eval>
if (user.hasSkill(2) || user.hasSkill(3)){
value = false;}
else{
value = true;}
</Learn Show Eval>
This will make Fire 1 disappear from Skill Learn window when you have Fire 2 or 3.
If you want to remove lower level skill when you are learning a higher level skill, for example you learn Fire 2 and want Fire 1 to disappear, put this note tag on Fire 2:
<Learn Cost Eval>
user.forgetSkill(1);
</Learn Cost Eval>

or you can simply use this note tag on Fire 1 if you have Yanfly's Skill Core plugin and don't want to play with Javascript:
<Hide if Learned Skill: 2>
This should remove Fire 1 from your skill list, and with that <Learn Show Eval> above, Fire 1 won't appear in your Skill Learn window again. For an easier way to erase a skill from Skill List,

The problem is we are checking user's skills manually, so if you have Fire 10, that "If" would be very long, but i can only help you this much.
Remember to change skills' IDs to fit your purpose.
good good but this ignoring level for learn skill we can see for learn skill for 10 level.


this best
<Learn Cost Eval>
user.refresh();
$gameActors.actor(x).forgetSkill(y);
</Learn Cost Eval>
this best
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top