YEPEquipSkills Return Array as Variable

Discussion in 'Javascript/Plugin Support' started by Catog, May 7, 2018.

  1. Catog

    Catog Professional Internal Screamer Veteran

    Messages:
    37
    Likes Received:
    11
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi all,

    For my game I'm using a mix of HIME's ActorBattleCommand/BattleCommandUseSkill and Yanfly's EquipBattleSkills. I've set up a common event with the intention of: "when a character has a skill equipped, the battle command shows, and when it's unequipped, it's hidden."

    The method I'm using is this:


    Unfortunately, the skills are not showing up in the list -I'm assuming because I've made some error in converting/reading the array into the variable (I'm not at all familiar with arrays). Would someone please be able to have a quick look at it and tell me what I'm getting wrong?

    Thank you!
     
    #1
  2. ramza

    ramza Lunatic Coder Veteran

    Messages:
    490
    Likes Received:
    261
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    Your issue is that you're checking an array for a flat number.

    Assuming your control variable command actually saves an array into the variable, you need to check the array elements for the skill id, not the array itself.

    Change your if condition to a script and put this in the box:
    $gameVariables.value(24).contains(18)
    This will check the array in variable 24 to see if it contains skill Id 18, and return true if it does.
     
    #2
  3. Catog

    Catog Professional Internal Screamer Veteran

    Messages:
    37
    Likes Received:
    11
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    He's done it, the absolute madman!

    That works perfectly, thank you so much :LZSjoy:
     
    #3

Share This Page