RPG Maker Forums

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:

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>

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top