Conditional Branch: How many Party Members?

Black Noise

Veteran
Veteran
Joined
Aug 23, 2012
Messages
94
Reaction score
20
First Language
English
Primarily Uses
RMMV
As I'm working on my game, I basically want to implement dialogue that varies based on how many party members


are present.


For example, I want to rest at an inn and if my Party leader is alone, he'll say


"I wish to stay for the night."


But if he has at least one party member with him, he'll say


"We wish to stay for the night."


I just simply need to know the script code to put in the conditional branch.


Thanks.
 

mrcopra

Veteran
Veteran
Joined
Jul 21, 2015
Messages
452
Reaction score
162
First Language
Not English
Primarily Uses
N/A
$gameParty.members().length
 

Black Noise

Veteran
Veteran
Joined
Aug 23, 2012
Messages
94
Reaction score
20
First Language
English
Primarily Uses
RMMV
And where do I write the numeric value in?


Sorry if this is a dumb question.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
724
Reaction score
581
First Language
French
Primarily Uses
@Black Noise


Use a control variable: script command and put what mrcopra provided inside.


You'll then be able to check the variable in a normal conditional.


You could also do a conditional : script with


$gameParty.members().length === 1
//or
$gameParty.members().length > 1


Edit: Ah yes, almost everytime someone mentions a script call I forget what can be done with the basic commands...


Game data > other > party members


Indeed no use for a script call.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,841
Reaction score
14,036
First Language
English
Primarily Uses
RMMV
You don't need to use the script command for this.  Control Variables already gives you the party size, under Game Data.
 

Black Noise

Veteran
Veteran
Joined
Aug 23, 2012
Messages
94
Reaction score
20
First Language
English
Primarily Uses
RMMV
Thanks a lot.


This has really helped!
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

What Reviews say on RPG Maker MZ?
Looking back at some sketches, and game design documents on my PC dated summer of 2015. I started development with the release of MZ, but in 2015, I felt a strong desire to make a game out of the blue. I remember feeling sad for no apparent reason, and all these ideas rushed into my head. Now that I think about it, since that day, everything has become easier to do on my PC . . . it’s very creepy.
Everything's going to be alright! We're all in this together. <3
Aaaaannd published my game's tech demo. :D

Feel free to download and play it. And give feedback!
Hey everyone, we know that the edit bar is missing. We're working on it. You can talk about it in the announcement here: https://forums.rpgmakerweb.com/index.php?threads/forum-errors-missing-edit-bar-etc.132715/

Forum statistics

Threads
107,801
Messages
1,032,306
Members
139,946
Latest member
Yatsekonn
Top