Yanfly Skill Learn and Job Points to upgrade variables with increasing costs

● ARCHIVED · READ-ONLY
Started by nitriso 4 posts View original ↗
  1. Hi all, I am using Yanfly's Skill Learn and Job Points plugins to allow characters to upgrade stats with job points. Yanfly has copy and paste code which shows how to have each upgrade cost more than the last, which works great. I am also trying to allow the player to increase a variable with this system, such as a variable for a mining skill. I am using this code:

    <Learn Cost Eval>
    var m = $gameVariables.value(48);
    ++m;
    $gameVariables.setValue(48, m);
    user.forgetSkill(skill.id);
    user.refresh();
    </Learn Cost Eval>

    <Hide in Battle>

    What I'd like to know is how to make it so this will cost more on each upgrade. For example, the first upgrade would cost 100 JP and the next would be 300 JP, then 500 JP, etc. What do I need to add in order to make this happen? Thank you!
  2. nitriso said:
    What I'd like to know is how to make it so this will cost more on each upgrade. For example, the first upgrade would cost 100 JP and the next would be 300 JP, then 500 JP, etc. What do I need to add in order to make this happen? Thank you!

    [embedded media]
  3. Thanks, Neo Soul Gamer. I use his copy and paste code from his video for stat upgrades already. What I'm wondering is what changes do I need to make to the code for raising a variable with increasing JP costs?

    Here is Yanfly's code from his website:

    <Learn Cost Eval>
    // Set the param ID of the stat you wish to adjust.
    var id = 0;
    // Increase the parameter by this amount.
    user._paramPlus[id] += 200;
    // Adjust the number of times upgraded by 1.
    user._upgradeParam[id] += 1;
    // Make the user forget the skill.
    user.forgetSkill(skill.id);
    // Refresh the user.
    user.refresh();
    </Learn Cost Eval>

    <Custom Learn JP Cost>
    // Set the param ID of the stat you wish to adjust.
    var id = 0;
    // Default the user's upgrade parameter times to empty.
    user._upgradeParam = user._upgradeParam || [];
    user._upgradeParam[id] = user._upgradeParam[id] || 0;
    // Adjust the cost of
    cost = user._upgradeParam[id] * 200;
    </Custom Learn JP Cost>

    <Custom Cost Display>
    \}Passive\{
    </Custom Cost Display>

    <Hide in Battle>

    I altered the first part of the code to what I mentioned in the OP. What would I need to change in the second part of the code under <Custom Learn JP Cost> to accommodate an increasing variable rather than an increasing stat parameter?
  4. So you want a growing cost of JP as in Octopah Traveler ???

    If so, it also interests me!