- Joined
- Oct 12, 2016
- Messages
- 17
- Reaction score
- 1
- First Language
- English
- Primarily Uses
Hey everyone, I feel like there is a simple solution to this, but I am spinning my wheels a LOT on this...
I'm using Yanfly's Skill Learn System to set up a shop where the player purchases upgrades to their stats. I have everything working great, except that I need the cost of the upgrades to increase each time that the player buys it (i.e. the first time, it is 100G, then 200G, then 300G, etc). I already have a variable set up that determines how many times the upgrade is purchased...Yanfly even has a Tips & Tricks video to explain how to do this...however only with JP and not Gold.
Basically, the note <Learn Cost: x Gold> is used to set the gold cost on the skill, but I cannot just put "<Learn Cost: $gameVariables.value(1) Gold>"...this causes it to use the Default Gold Cost parameter since it doesn't recognize the variable. Similarly, if I put $gameVariables.value(1) into the Default Gold Cost parameter field in the plugin manager, and I get a weird result where "NAN" shows up.
I even tried opening up the Yanfly script and just hard-coding the value but I keep getting TypeErrors and whatnot...
Thoughts?
BONUS: Is there a better (more succinct) way to code this:
I'm using Yanfly's Skill Learn System to set up a shop where the player purchases upgrades to their stats. I have everything working great, except that I need the cost of the upgrades to increase each time that the player buys it (i.e. the first time, it is 100G, then 200G, then 300G, etc). I already have a variable set up that determines how many times the upgrade is purchased...Yanfly even has a Tips & Tricks video to explain how to do this...however only with JP and not Gold.
Basically, the note <Learn Cost: x Gold> is used to set the gold cost on the skill, but I cannot just put "<Learn Cost: $gameVariables.value(1) Gold>"...this causes it to use the Default Gold Cost parameter since it doesn't recognize the variable. Similarly, if I put $gameVariables.value(1) into the Default Gold Cost parameter field in the plugin manager, and I get a weird result where "NAN" shows up.
I even tried opening up the Yanfly script and just hard-coding the value but I keep getting TypeErrors and whatnot...
Thoughts?
BONUS: Is there a better (more succinct) way to code this:
Code:
<Learn Cost Eval>
user.forgetSkill(80);
$gameVariables.setValue(1,$gameVariables.value(1)+1);
$gameActors.actor(1).refresh();
$gameActors.actor(2).refresh();
$gameActors.actor(3).refresh();
$gameActors.actor(4).refresh();
$gameActors.actor(5).refresh();
$gameActors.actor(6).refresh();
$gameActors.actor(7).refresh();
$gameActors.actor(8).refresh();
$gameActors.actor(9).refresh();
$gameActors.actor(10).refresh();
$gameActors.actor(11).refresh();
$gameActors.actor(12).refresh();
$gameActors.actor(1).recoverAll();
$gameActors.actor(2).recoverAll();
$gameActors.actor(3).recoverAll();
$gameActors.actor(4).recoverAll();
$gameActors.actor(5).recoverAll();
$gameActors.actor(6).recoverAll();
$gameActors.actor(7).recoverAll();
$gameActors.actor(8).recoverAll();
$gameActors.actor(9).recoverAll();
$gameActors.actor(10).recoverAll();
$gameActors.actor(11).recoverAll();
$gameActors.actor(12).recoverAll();
</Learn Cost Eval>
Last edited by a moderator:


