Yanfly Skill Learn

overlordmikey

BroCo. Gaming
Veteran
Joined
Sep 2, 2015
Messages
89
Reaction score
286
First Language
English
Primarily Uses
N/A
Welp here I am finally directly asking for help on that who using variable points to buy stats and skill increases using Yanfly's Skill Learn System. (http://yanfly.moe/2015/11/14/yep-28-skill-learn-system/)

In my quest to try to remember how I'd done it before I tried three codes.

<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 10;
// Increase the parameter by this amount.
user._paramPlus[2] += 1;
// Remove one Growth Point.
$gameVariables.setValue(10, -1);
// Make the user forget the skill.
user.forgetSkill(55);
// Refresh the user.
user.refresh();
</Learn Cost Eval>
Only leads to setting the Variable 10 to negative one.


Then:


<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 10;
// Increase the parameter by this amount.
user._paramPlus[2] += 1;
// Remove one Growth Point.
$gameTemp.reserveCommonEvent(16);
// Make the user forget the skill.
user.forgetSkill(55);
// Refresh the user.
user.refresh();
</Learn Cost Eval>
Lead to nothing which makes sense because I think $gameTemp.reserveCommonEvent(n) might be the wrong code to call up a common event.

Finally the last one which I assumed would do nothing (besides bring up a minor error) anyway (which it did)

<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 10;
// Increase the parameter by this amount.
user._paramPlus[2] += 1;
// Remove one Growth Point.
$gameVariables.value(10) - 1;
// Make the user forget the skill.
user.forgetSkill(55);
// Refresh the user.
user.refresh();
</Learn Cost Eval>

So that leads me to seeking yer help. I know I pulled it off before so there must be a way. Any know what I'm doing wrong?
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
146
First Language
English
Primarily Uses
RMMV
I'm still not clear as to what you're actually trying to do. What are you trying to accomplish with this code? More clarification is needed.
 

overlordmikey

BroCo. Gaming
Veteran
Joined
Sep 2, 2015
Messages
89
Reaction score
286
First Language
English
Primarily Uses
N/A
I'm still not clear as to what you're actually trying to do. What are you trying to accomplish with this code? More clarification is needed.
Everytime a character levels up you gain ten Growth Points.
GrowthPoint2.PNG


But for some reason I can't remember how I tell the game to remove -1 from the variable after purchase. I used to know how, but now I don't.
// Remove one Growth Point.
$gameVariables.setValue(10, -1);
Closest I got is this SETS the Value to Negative 1.

GrowthPoint3.PNG
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
146
First Language
English
Primarily Uses
RMMV
Oh I see, it'll work like this:

// Remove one Growth Point.
var x = $gameVariables.value(10);
$gameVariables.setValue(10, x-1);
 

overlordmikey

BroCo. Gaming
Veteran
Joined
Sep 2, 2015
Messages
89
Reaction score
286
First Language
English
Primarily Uses
N/A
Oh I see, it'll work like this:

// Remove one Growth Point.
var x = $gameVariables.value(10);
$gameVariables.setValue(10, x-1);
It worked, thank you so much! There is another issue involving this kinda stuff that I need to test, but if I run into a problem again ya mind if I message ya so I don't have to create another thread? :D
 

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