Party leader check in conditional branch

Discussion in 'Javascript/Plugin Support' started by Failivrin, Sep 30, 2018.

  1. Failivrin

    Failivrin Final Frontiersman Veteran

    Messages:
    189
    Likes Received:
    182
    First Language:
    English
    Primarily Uses:
    RMMV
    The default "Conditional Branch" can check different parameters for party members, but it does not check who the party leader is. I am looking for a plugin that would create different conditional branches depending on which actor is the party leader.

    Example of usage: Therese rescues an old man from a monster. Later, the old man appears in a tavern. He's near-sighted, so if Harold speaks to him, he won't say anything important. If the player swaps so that Therese is the party leader, and Therese speaks to the old man, he will recognize her and give her a rare item.

    Any help would be much appreciated!

    PS - I am using the PH Swap Party plugin that allows the player to change party leader with the touch of a button. http://mvplugins.com/plugin/PrimeHover/PH - Swap Party
     
    #1
  2. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,585
    Likes Received:
    14,293
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    You can check party leader.

    Default Command:
    upload_2018-9-30_12-4-8.png
    Use Control Variable first then the condition.
    In this case it is saying, what is the actor ID of the 1st Position (Leader) and it checks if it's Actor ID #1 in my sample.

    Script Call Version:
    I can't remember a better version but this is what I use. It checks that if Actor 1 is in 0th position (aka leader of the party).
    Code:
    $gameParty.members().indexOf($gameActors.actor(1)) == 0
    How to use:
    upload_2018-9-30_12-2-59.png
     
    #2
    Failivrin likes this.
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,712
    Likes Received:
    11,421
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    $gameParty.leader().actorId() == 2

    is another one you can use.
     
    #3
    Failivrin and Archeia like this.
  4. Failivrin

    Failivrin Final Frontiersman Veteran

    Messages:
    189
    Likes Received:
    182
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks. I'm not very good at formulas but I'll try that!
     
    #4

Share This Page