Eval Help (Yami Skill Shop)

● ARCHIVED · READ-ONLY
Started by Blue001 5 posts View original ↗
  1. (Related Script = Here )

    Hello.

    I am using Yami Skill shop to emulate FF1's spell shops that only let you buy 3 of each tier spell (with 4 being available)
    So when a character buys his/her third spell, the remaining 4th spell they didn't choose is locked away.

    I kind of have it working, but I'm not very good at evals yet... and I'm getting some inconsistent results...
    So in the custom Requirement Eval... I have

    <Buy Custom Require>

    !actor.isLearnedSkill(8 && 9 && 10);

    </Buy Custom Require>

    the actor eval to check if a player has the 3 spells listed (must be all three at once) is where my question lies. It seems to work with what Ihave here, but when I do the same for the other 3 spells (and change the spell numbers to always be the opposite spells) sometimes the spells all get locked away after one is bought, and other times, it works with the all three.

    Am I Evaling incorrectly to check for 3 skills being owned at the same time?
  2. Yes, the function can only check for one skill at a time, you need to use it multiple times to check for multiple skills.
    And you need to specify which actor has learned the skill (actor ID).
  3. Actually, it seems like the way I have it with just "actor." is affecting only that actors purchases.

    So If I buy a spell with one actor the other actors can still buy stuff, only they actor that bought one gets locked out. (I think it's the way this coder made their script that allows for just calling the "actor currently acting")


    As for the "check one skill at a time" ... how do I do that inside the notetag??
    is it....
    <Buy Custom Require>
    !actor.isLearnedSkill(8);
    !actor.isLearnedSkill(9);
    !actor.isLearnedSkill(10);
    </Buy Custom Require>

    I need all three to be checked and be true for the eval to pass, otherwise this system won't work the way I need it.
  4. <Buy Custom Require>
    !actor.isLearnedSkill(8) && !actor.isLearnedSkill(9) && !actor.isLearnedSkill(10);
    </Buy Custom Require>
  5. That's not working... is there a way I can do something like this....

    <Buy Custom Require>
    if !actor.isLearnedSkill(8) then
    set variable of my choosing to val+1
    if !actor.isLearnedSkill(9) then
    set variable of my choosing to val+1
    if !actor.isLearnedSkill(10) then
    set variable of my choosing to val+1
    then
    if variable <= 3 eval passes?
    </Buy Custom Require>

    of If I wanted to do it outside the eval is there a way to call a common event to add +1 to a variable for an actor if they just learned a new spell without having to have a common event call continuously (so only when the spell is learned)? Is there a script function like "hey someone is currently learning spell!!! DO something"