Using Items instead of JP on specific note tag

● ARCHIVED · READ-ONLY
Started by Yawgmoth 4 posts View original ↗
  1. Hi all,

    So I've been playing with Yanflys Skill Learn and Job Point Plugins to create Stat Upgrades with increasing costs, however I do not want to use job points to buy the stat upgrades. I want to purchase the stat upgrade skills using an item and I want the item to increase by one each time the skill is bought, just like the following note tag does with job points. I just want it to use items.

    <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] * 1;

    </Custom Learn JP Cost>

    I'm not sure everything that needs altered in this note tag but know this should be feasible. The item I'm wanting to use is a soul shard and it's ID is 42.

    You can find Yanfly's video for Stats with Increasing Costs here at [embedded media]

    Thanks in advance for any help I receive.
  2. That notetag merely changes the JP cost. It's not designed for item costs
    However, it is possible to do so using the <Learn Require Eval>, <Learn Cost Eval> and <Learn Custom Text> notetags
    I'm still learning javascript, but here's the gist of what you should do:

    1. In <Learn Require Eval> notetag, check whether the item is present and enough. Something along the lines of
    var cost = user._upgradeParam[id] + 1;
    value = $gameParty.numItems($dataItems[42]) >= cost;
    Where cost is the item cost of said upgrade

    2. Add a line in <Learn Cost Eval> to consume the item, just before the line where it said user._upgradeParam[id] += 1. Something along the lines of
    var cost = user._upgradeParam[id] + 1;
    $gameParty.loseItem($dataItems[42], cost);

    3. Add <Learn Custom Text> notetag to inform the player about the item cost.
  3. @mmgfrcs Thanks!

    I knew it should be possible. Unfortunately I've already got everything working using events. It is nice to know that if my eventing fails I can always attempt this method though.

    Thread Solved. Please Close.
  4. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.