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

daisyfairy42

Villager
Member
Joined
Jun 6, 2016
Messages
9
Reaction score
4
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


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.
 

OmnislashXX

Veteran
Veteran
Joined
Mar 30, 2012
Messages
597
Reaction score
3,683
First Language
English
Primarily Uses
RMMV
Yanfly's Party System. Check it out.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,065
Reaction score
7,756
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.
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
622
Reaction score
329
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
 

daisyfairy42

Villager
Member
Joined
Jun 6, 2016
Messages
9
Reaction score
4
First Language
English
Primarily Uses
RMMV
Yanfly's Party System. Check it out.
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.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,627
Reaction score
1,061
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)
 

daisyfairy42

Villager
Member
Joined
Jun 6, 2016
Messages
9
Reaction score
4
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.
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.

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
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!

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:

View attachment 107412

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)
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:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,065
Reaction score
7,756
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.

 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I like being a butt to people.
Dirtnap wrote on Tyler Warren's profile.
Hi Tyler,

My name is Sean, I am the owner of an indie studio, and I am looking to get some paid art work done. I am working with MV, but our programmer will be heavily modifying it.

If you are interested, or would like to hear more, I can provide my personal e-mail address.

S.G.
The stream will be live shortly with some more Witcher 3! Feel free to drop by~
Its Chinese new year today! Happy year of the rat~
just got back from the doctor about my back - 3 -)~ will know in a week or so's time how bad the problem is. Overall doing better though! not hurting so badly.

Forum statistics

Threads
93,596
Messages
913,811
Members
123,145
Latest member
Esogard
Top