Check if Actors are in the party, and if so show them as a choice.

Discussion in 'RPG Maker MV' started by daisyfairy42, Jan 18, 2019.

  1. daisyfairy42

    daisyfairy42 Villager Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Pennsylvannia
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm trying to set up a decision where the player will have to choose a party member to leave behind in exchange for a new one, but this is an abnormal event, so I hadn't gotten a party management plugin yet and was trying to do it through eventing. I've tried setting up conditionals to check for actors, and variables to check for actors, but just can't get it to cooperate.

    Part of why I need it to check is because the player has the option to walk right past 2 of the party members at the beginning of the game (multiple endings and party interactions and such being a focus of the game), so if they aren't in the party, they can't be choices, and if 1 but not the other is in the party, that needs to be accounted for.

    I attached the project if anyone would like to take a look at the situation in detail, but also in the spoiler, there's a screenshot of the spot I'm trying to implement.

    Any sort of solution is appreciated, be it through scripting or plugins! I'm just not amazing at writing the scripting myself.

    Project File Here

    [​IMG]

    Side note: If you do playtest, I'm aware of the texture errors with the transparent areas becoming other random tiles sometimes, I don't know why, and I'll fix it later as it isn't game breaking and fixes itself randomly.
     
    #1
  2. OmnislashXX

    OmnislashXX Veteran Veteran

    Messages:
    591
    Likes Received:
    3,634
    Location:
    Maryland
    First Language:
    English
    Primarily Uses:
    RMMV
    Yanfly's Party System. Check it out.
     
    #2
  3. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,667
    Likes Received:
    7,536
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    How many actors do you have? If not many, it might be possible, but a little complicated, to event this.

    Also, at what point does the transparent tiles thing happen? I downloaded your project to see if I could spot why.
     
    #3
  4. Zevia

    Zevia Veteran Veteran

    Messages:
    613
    Likes Received:
    317
    First Language:
    English
    Primarily Uses:
    RMMV
    If you're using RMMV 1.6 or above, you could use the following code in your conditional:
    Code:
    $gameParty.members().find(member => member._actorId === x);
    
    Replacing x with the ID of the Actor you want to check for. It will evaluate to a truthy statement if the actor is in the party and a falsey one if not.

    If you're using an older version of RMMV, you could use:
    Code:
    $gameParty.members().filter(function(member) { return member._actorId === x; }).length
    
     
    #4
  5. daisyfairy42

    daisyfairy42 Villager Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Pennsylvannia
    First Language:
    English
    Primarily Uses:
    RMMV
    I gave it a look, installed it and went through the help file, I don't think it does what I need. I'm looking for a way to do this within an event, not the formation menu. The plugin doesn't do anything with "checking" what actors are active, which is the primary thing I'm looking for.
     
    #5
  6. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,520
    Likes Received:
    959
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    You can event this with a bunch of conditional branches, but it'll get messy fast. An alternative is that you can use my Conditional Choices plugin. An event would look like this:

    upload_2019-1-17_19-22-53.png

    Code:
    !gp._actors.contains(3)
    means hide that choice if the party doesn't have actor #3 in it. (gp is an abbreviation for $gameParty)
     
    #6
  7. daisyfairy42

    daisyfairy42 Villager Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Pennsylvannia
    First Language:
    English
    Primarily Uses:
    RMMV
    I think what Zevia said will work, but I have 4 active actors. (The 5th one exists for the tutorial, and might come back later).
    The transparent tiles bit happens on the maps that use the truesight goggles (the one with the fireplace called "Truesight Goggles" in the project, and the "Crystal Lord" map.) It might have something to do with how I originally ran the event, changing the tile out for one that I edited the passability of, but have since changed the goggles to use "through" events to allow the player to walk on them.

    This seems to do what I want, I just have to figure out how to set things up right for what menu appears based on the party members. Thank you!

    Oh my god thank you. This will save me so much time in the long run with this game since so much is based around what party members you have.
     
    Last edited by a moderator: Jan 18, 2019
    #7
  8. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,667
    Likes Received:
    7,536
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV

    @daisyfairy42 , please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.

     
    #8
    daisyfairy42 likes this.

Share This Page