NowiFate

Villager
Member
Joined
May 12, 2021
Messages
9
Reaction score
0
First Language
Dutch
Primarily Uses
RMMV
I am writing a little bit of script. In this, I want to check if a certain actor is NOT in the party. I found the code:

$gameParty.members().contains($gameActors.actor(002)))

But I want to do the exact opposite. I wish to check if they're not contained. What is the command for this or how do I work around it? Thanks in advance
 

WilsonE7

Veteran
Veteran
Joined
Oct 12, 2019
Messages
87
Reaction score
39
First Language
English
Primarily Uses
RMMZ
Can't you just add "==false" at the end of that code in the Conditional Branch's script line? (And you have one too many close parentheses.)
 

NowiFate

Villager
Member
Joined
May 12, 2021
Messages
9
Reaction score
0
First Language
Dutch
Primarily Uses
RMMV
Can't you just add "==false" at the end of that code in the Conditional Branch's script line? (And you have one too many close parentheses.)
The "==false" did the trick. Thanks a bunch for that. And yeah, but for some reason the game says it misses a ")" when I remove one? Kind of strange, but it work, so?
 

WilsonE7

Veteran
Veteran
Joined
Oct 12, 2019
Messages
87
Reaction score
39
First Language
English
Primarily Uses
RMMZ
Glad it worked! Weird about the parentheses though. I haven't used that long of a script call before, so I've never seen that error. But hey, if it ain't broke, as they say.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,926
Reaction score
8,256
First Language
German
Primarily Uses
RMMV
1) please NEVER use leading zeroes in a number in programming. the ID is 2, NOT 002.
The problem is that a leading zero is a mark for a change in the number system, like 0x marks hexadecimal numbers. 00 means "the following is an octal number", and that means the numbers only work for IDs 1 to 7. Octal 0010 for example is decimal 8, and that often messes people up.

2) if the computer says you're missing a ) then you placed the comparison at the wrong position. we would have to see the actual code to be able to point you to the mistake. And please use === instead of == for comparisons, for javascript that is better.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,529
Reaction score
14,848
First Language
English
Primarily Uses
RMMV
Actor is in the party:
$gameParty.members().contains($gameActors.actor(2))

Actor is not in the party:
!$gameParty.members().contains($gameActors.actor(2))

! is the "not" operator.
 

Latest Threads

Latest Posts

Latest Profile Posts

Hope he recovers fast :|
Looks like it's functional:
It's a common thing to forget eating &drinking while you are working concentrated, right?
If I had discovered RPG-Maker before moving together with my girlfriend, I'd have died of dehydration a long time ago.
Ami
trying to change my picture & got screwed up...
I've been busy working on my next music pack, and I've also been busy composing some personal compositions. Depending on the type of mood and setting, sometimes I just really love the sound of music created in lofi mono. It has its charm.

Forum statistics

Threads
112,491
Messages
1,068,660
Members
146,161
Latest member
Zuumie
Top