Hime's Learn Condition Formula Help

Discussion in 'RGSSx Script Support' started by Vis_Mage, Jun 12, 2018.

  1. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    388
    Likes Received:
    141
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Hey! :kaohi:

    In my project, I'm using Hime's Learn Condition Formulas script, which allows you to set formulas that determine if an actor can access a skill.

    Could someone help me create a condition that will only allow access to a skill if the actor already knows skill 170?

    Thank you! :kaopride:
     
    #1
  2. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    800
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    If you want to check whether the actor learned skill X already, you can use this:
    Code:
    a.skill_learn?($data_skills[skill_id])
    If you want to check whether the actor has skill X from any source (learned, equipment, states, etc), you can use this instead:
    Code:
    a.skills.include?($data_skills[skill_id])
    In both cases, just replace the skill_id part with the database ID of the skill you want to check for.
     
    #2
    Vis_Mage likes this.
  3. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    388
    Likes Received:
    141
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Hey, thanks for the quick reply!

    Your formula seems to work great, although I ran into a bit of a snare. Not so much due to the formula, just due to my understanding of the script.

    Is there an "exclude?" script command that I could use in that formula instead? Basically checking if I don't have a skill.
     
    #3
  4. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    800
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Just put a ! sign at the beginning of them and it will negate the condition.
     
    #4
    Vis_Mage likes this.
  5. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    388
    Likes Received:
    141
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Works like a charm! Thanks a ton! :kaopride:
     
    #5

Share This Page