Yanfly Limited Skill uses question.

Jenovation

Veteran
Veteran
Joined
Feb 11, 2016
Messages
73
Reaction score
16
First Language
English
Primarily Uses
Hi,

I'm having a hard time creating something with Yanfly's Limited Skill uses plugin.

I would like the Limited Uses to increase +1 Use with the player's LV as they Level Up.
However, with the included Lunatic Mode tags I am not getting the desired effect.

Using:
<Custom Skill x Use Max>
value += user.level;
</Custom Skill x Use Max>

This simply adds the amount of uses equal to the level, so with this setup, every Skill that has 0 uses will have uses equal to the
Actor's level (regardless of when they learnt it)

I would like the Actor to gain a +1 on each Skill upon Level Up.
For example:
Lv 1 (Skill A is learned with 1 use)
Lv 2 (Skill B is learned with 1 use, Skill A has 2 uses)
Lv 5 (Skill C is learned with 1 use, Skill A has 5 uses, Skill B has 4 uses)
etc....

Also I am unable to find any Plugin Commands or Script Calls to change a Skill's usage amount manually, so far it seems it needs to happen through an Item or other Skill.

I've also tried putting negative values in the Limit Uses tag, to compensate for the Level it is learned at, but it doesn't work as a negative value results in disabling the Limit Uses.


Any help or thoughts would be great!
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
710
Reaction score
228
First Language
English
Primarily Uses
Your going to have to hard code it in.
So skill A which is learned at level 1 has this code:
<Custom Skill x Use Max>
value += user.level;
</Custom Skill x Use Max>
Skill B which is learned at level 2 had this code:
<Custom Skill x Use Max>
value += user.level;
value -= 1;
</Custom Skill x Use Max>
Skill C which is learned at level 3 has this code:
<Custom Skill x Use Max>
value += user.level;
value -= 2;
</Custom Skill x Use Max>

And on and on it goes.
If you have different classess geting the same skills at different levels then use a code like this:

<Custom Skill x Use Max>
if (user.currentClass().id === 1){
value += user.level;
value -= 1;
}
else if (user.currentClass().id === 2){
value += user.level;
}
else if (user.currentClass().id === 3){
value += user.level-2;
}
else {}
</Custom Skill x Use Max>
The code:
Class 1 earns the skill at level 2, while Class 2 has the skill from the beginning, while Class 3 gets it at level 3.


Basically your doing the math for each skill's skill use based on when they recive it.
 

Jenovation

Veteran
Veteran
Joined
Feb 11, 2016
Messages
73
Reaction score
16
First Language
English
Primarily Uses
Of course, it's that simple! XD

Thanks so much!
 

Jenovation

Veteran
Veteran
Joined
Feb 11, 2016
Messages
73
Reaction score
16
First Language
English
Primarily Uses
Do you know if there is a way to round up/down the final value being calculated?

Let's say I want to use more than + or -
For example " value+= user.level/3; "

This would result in a decimal number such as 1.5 uses which doesn't seem to work with the plugin. (it reads it as unlimited uses)

So in that case, would it be possible to have say, the value 1.2 become 1 and 1.6 become 2?

</Custom Skill x Use Max>
Skill C which is learned at level 3 has this code:
<Custom Skill x Use Max>
value += user.level;
value -= 2;
</Custom Skill x Use Max>
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
710
Reaction score
228
First Language
English
Primarily Uses
Math.round(value)-Rounds normally.
Math.ceil(value)-Rounds up always.
Math.floor(value)-Rounds down always.

To round: "user.level/3"

var use = user.level/3;
value += Math.round(use);
 

Jenovation

Veteran
Veteran
Joined
Feb 11, 2016
Messages
73
Reaction score
16
First Language
English
Primarily Uses
Works like a charm! Thanks so much for all the help :)
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
710
Reaction score
228
First Language
English
Primarily Uses
Your welcome .:)
 

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,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top