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
540
Reaction score
219
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,823
Reaction score
991
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 have an audio you want me to animate? If so send me the youtube link and I’ll animate it.
Okay, so I'm working on Draft 2 of my game's script.
Will try to keep you guys posted, if you're interested!

This is vid of my new game, Crystalgazers. A demo is available on my Gamejolt

I just thought of the best achievement for my game: "'I Didn't Know You Were a Developer!' Find and enter one or more dev room(s)."
I made this animation to apply to a job, what do you think?

Forum statistics

Threads
105,590
Messages
1,014,837
Members
137,253
Latest member
Koshibari
Top