Conditional Branch - Actor not wearing any equipment

Discussion in 'Javascript/Plugin Support' started by Fifix, Mar 30, 2016.

  1. Fifix

    Fifix Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    Polish
    Hi. I was wondering if it's possible to make a conditional branch with a script that checks if actor (number x) doesn't have anything equipped in his equipment slots.


    In RPG Maker VX, the script looked like this:


    $game_actors[1].equips[0].nil?


    Can anyone convert this script so it can be used with RPG Maker MV?
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,326
    Likes Received:
    11,133
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    That VX script would only tell you if an actor had a weapon equipped.  It would not tell you whether any of the armor slots were filled.  Is that what you want - by "equipment slots" do you mean "weapon"?  Or do you mean ANY equipment?
     
    #2
  3. Fifix

    Fifix Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    Polish
    Just one slot is fine, because I could make other conditional branches to check the rest of slots.


    If I'm correct, the first part would be:


    $gameActors.actor(1).


    What about the rest?
     
    Last edited by a moderator: Mar 30, 2016
    #3
  4. mrcopra

    mrcopra Veteran Veteran

    Messages:
    448
    Likes Received:
    144
    Location:
    Your Heart
    First Language:
    Not English
    Primarily Uses:
    N/A
    There is trick and i think its useful


    it will check every slots


    !($gameActors.actor(x).equips()==",,,,")
     
    Last edited by a moderator: Mar 30, 2016
    #4
  5. Fifix

    Fifix Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    Polish
    Thank you!


    I also found a script which I can't make to work in a conditional branch. Getting syntax error "Unexpected end of input".


    This is the script:


    if ($gameActors.actor(Id).equips(SlotID).contains($dataArmors[Id])


    What it's supposed to do is to check if a specific armor is equipped in the selected slot. Any help why I'm getting the error?
     
    Last edited by a moderator: Mar 30, 2016
    #5
  6. mrcopra

    mrcopra Veteran Veteran

    Messages:
    448
    Likes Received:
    144
    Location:
    Your Heart
    First Language:
    Not English
    Primarily Uses:
    N/A
    you forgot ")"


    if ($gameActors.actor(Id).equips(SlotID).contains($dataArmors[Id]))
     
    #6
  7. Fifix

    Fifix Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    Polish
    Weird, still getting the same error...


    Ok nevermind, it worked when I removed the "if".


    Thanks for help!
     
    Last edited by a moderator: Mar 30, 2016
    #7
  8. mrcopra

    mrcopra Veteran Veteran

    Messages:
    448
    Likes Received:
    144
    Location:
    Your Heart
    First Language:
    Not English
    Primarily Uses:
    N/A
    that's how i do it


    conditional Branch > Script >  $gameActors.actor(1).equips().contains($dataArmors[1])
     
    #8
  9. Morizel

    Morizel Villager Member

    Messages:
    29
    Likes Received:
    1
    First Language:
    Russian
    Primarily Uses:
    RMVXA
    Okay!
    Then what I need to write if I want to check same on ALL actors in party?
     
    Last edited: Jul 6, 2019
    #9

Share This Page