Conditional Issues

ItsAri

Villager
Member
Joined
Dec 9, 2019
Messages
13
Reaction score
4
First Language
English
Primarily Uses
RMMV
I'm using both Yanfly's Equip Core and Equipment Requirements, and I copied and pasted and even tried to modify the requirements myself but it still doesn't work.
Here's the Code:
<Custom Equip Requirement Condition>

var condition = true

if (user.name() === 'Lynn') {

condition = true;

} else {

condition = false;

}

</Custom Equip Requirement Condition>
It's possible I spelled the name wrong and my Java isn't the best, so is there a way that a certain weapon can only be equipped by a specific character with the Equipment Plugins?
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,617
Reaction score
3,790
First Language
English
Primarily Uses
RMMV

I've moved this thread to Javascript/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.



Maybe try removing the () after the user.name. So it would look like something like if (user.name === 'Lynn') . I never really used YEP plugins a lot, but in the default engine the name property never really needed () (it wasn't a function, but more like a property).
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
155
Reaction score
94
First Language
French
Primarily Uses
RMMV
Hello, I used those plugins and I just pasted your code in the notebox of a weapon in my project (only changing the character name to fit mine) and it worked: only the named character can equip the weapon bearing this notetag.
Simplier syntax would look like this:
Code:
<Custom Equip Requirement Condition>
   var condition = false
   if (user.name() === 'Name') {
     condition = true;
   }
</Custom Equip Requirement Condition>
But it should also work the way you writed it so it might be more a problem of other plugins compatibility or plugins order... Or you did mispelled your character name..?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,540
Reaction score
6,874
First Language
German
Primarily Uses
RMMV
you can also use an exclusive armor type to do this completely without any plugin.

You make an armor type "Lynn Armor" and have only the Lynn actor get that armor type, then all armors that have this type can only be equipped by that actor.
 

ItsAri

Villager
Member
Joined
Dec 9, 2019
Messages
13
Reaction score
4
First Language
English
Primarily Uses
RMMV
It's working but now when I start the game she doesn't have it equipped at all, it happened when I removed the ()
 
Last edited:

ItsAri

Villager
Member
Joined
Dec 9, 2019
Messages
13
Reaction score
4
First Language
English
Primarily Uses
RMMV
I finally got it working, thanks :3
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,617
Reaction score
3,790
First Language
English
Primarily Uses
RMMV

@ItsAri , please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Great to know that everything is now working. If your thread has been answered, you can report it to be closed.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Making it a rule that I don't do any world building for my new game before the actual gameplay is concrete and working. I have 16 years of lore to work with anyway.
Cheesy power metal makes everything better. No matter what you do, you'll feel heroic doing it.
Starting to really like the first of my madness areas. I think the eyes looking at them really helps to sell the place. :LZSexcite:
Made idle animation for character. It first had only three frames but looked too different from walking animation and I had to draw five more.
MV and VX Ace both have good qualities.

Forum statistics

Threads
95,693
Messages
931,064
Members
126,032
Latest member
MadAtticGames
Top