RMMV YEP CUSTOM PASSIVE CONDITION HELP

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
152
Reaction score
18
First Language
English
Primarily Uses
RMMV
Hey all!

Just had a quick question. Does Yanfly's Custom Passive conditions accept operators? such as && ? i ask because I am
creating a passive that requres shield and spear to both be equipped. If so can anyone tell me what i am doing wrong in my code?
Please and thanks. Here is said code:



<Custom Passive Condition>

if(user.isAtypeEquipped(7) && if(user.isWtypeEquipped(12)) {

condition = true;

} else {

condition = false;

}

</Custom Passive Condition>




So to recap. If spear and shield equpped. Allow passive. Currently It just gives the user the passive, even when nothing is equipped.
 
Last edited:

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
554
Reaction score
229
First Language
english
Primarily Uses
RMMV
you say sword and spear up top but shield and spear in the recap....
i can say && does work cus someone helped me with passive conditions before that have it.
i cant help though cus horrible at code. but thought would point out the contradiction with the whole sword/spear/shield thing cus really confusing. and think might need space between if (
but again, im hopelessly horrible with code
 

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
152
Reaction score
18
First Language
English
Primarily Uses
RMMV
you say sword and spear up top but shield and spear in the recap....
i can say && does work cus someone helped me with passive conditions before that have it.
i cant help though cus horrible at code. but thought would point out the contradiction with the whole sword/spear/shield thing cus really confusing. and think might need space between if (
but again, im hopelessly horrible with code
sry meant spear and shield. will edit.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,895
Reaction score
1,028
First Language
Dutch
Primarily Uses
RMMV
lunatic code for custom passive works like all kind of operators,
like && (and), || (or), ! or !! or anything around those.
you just need to format it correctly in order to work.

but I think you need it around those lines:

</Custom Passive Condition>
if(user.isAtypeEquipped(7) && user.isWtypeEquipped(12)) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

the way you did,

"if(user.isAtypeEquipped(7) && if(user.isWtypeEquipped(12))"

you nested the "if" and also missing 1 ")" on the first part and it might not
work or not correctly.

I cant promise my way works but there are coders that know lunatic codes :)
 

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

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,017,004
Members
137,562
Latest member
tamedeathman
Top