Conditional Branch "character in party" question

Status
Not open for further replies.

TheGamedawg

Veteran
Veteran
Joined
Aug 29, 2014
Messages
350
Reaction score
133
First Language
English
Primarily Uses
So I have some events in my project that are only suppose to go off when you have a character in your party.  However, it doesn't seem nearly picky enough.  You get a lot of characters in this game, and you  only get to use 4 at a time.  The rest you can swap in at save points.

The problem is that it will trigger the event if the character has been acquired, but not in the immediate 4.  Is there a way to make it so the Actor in Party conditional branch will only check the first 4 actors?
 

Heartbreak61

Wandering Noob
Veteran
Joined
Sep 5, 2012
Messages
188
Reaction score
88
First Language
Indonesian
Primarily Uses
RMMV
Pardon my english but do you want to check wether an actor is on the main party (the first four member)?

You can store party members to variables then check wether any of those variable equal your desired actor's ID/
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,502
Reaction score
12,045
First Language
English
Primarily Uses
RMMV
The "in your party" test only cares about whether they are "in your party" - not whether they are a battle member. The game party includes battle members and reserve members.


In the conditional branch, you can use this in the Script box:

Code:
$gameActors.actor(n).isBattleMember()
where n is the actor id.
 

TheGamedawg

Veteran
Veteran
Joined
Aug 29, 2014
Messages
350
Reaction score
133
First Language
English
Primarily Uses
The "in your party" test only cares about whether they are "in your party" - not whether they are a battle member. The game party includes battle members and reserve members.

In the conditional branch, you can use this in the Script box:

$gameActors.actor(n).isBattleMember()where n is the actor id.
Ah, I see.  I've never played around with that script option before but now I see how useful it can be.  Thanks!
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
210
First Language
English
Primarily Uses
If you create your own formation system, instead of using the engine's, you can limit party members to the 4 active slots, then you assign a switch to each char(if the char is added to your party, it turns on the switch associated with that char, and if the char leaves, it turns off the switch), to allow for more efficient party member tracking.

All of that can be done without any plugins/scripts too :)

In truth, since only 4 member can be in your battle party, there's little reason to allow more then 4 characters in your party at any given time anyway.
 
Last edited by a moderator:

pEcOsGhOsT

Villager
Member
Joined
Jan 5, 2016
Messages
28
Reaction score
20
First Language
English
Primarily Uses
Thanks guys!
This really helped me out!!!
 
Last edited:

Psykai

Veteran
Veteran
Joined
Dec 8, 2017
Messages
104
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Hey! Hopefully it's ok to resurrect old threads but I just tried the code Shaz posted (changing only 'n' to the actor's number) and received this error when interacting with the event that uses the script:

"Script 'Game_Interpreter' line 450: NoMethodError occurred.
undefined method 'actor' for nil:NilClass"
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,051
Reaction score
4,261
First Language
Dutch
Primarily Uses
RMXP

Psykai, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



Please make a new topic with your question.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

I just noticed the minigame challenge. Now considering...
My project just started lagging during battletest and I haven't been able to figure out why...
Oh, Google is now warning users against installing extensions on Edge Chromium
on my plate today- animation.
"Your service has been identified as part of an outage. This is expected to be restored by 7pm IN SEVEN DAYS!!!" Guess I won't be around as much over the next week :(

Forum statistics

Threads
94,471
Messages
921,165
Members
124,311
Latest member
cadenm1223
Top