Skill/Equip Question

Hi readers !

I'm posting here because I believe that the subject is almost the same.

Here is my situation :

By default my actor have the skill A (id = 1)
If I equip my actor with an Orb (Amor ID 10), he will have the skill A' a better version of skill A.
My problem is, I don't want the Skill A to be visible when the Orb is equip.

I tried this :


<Custom Show Eval>
if (user.equips()[0].atypeId = 10) {
visible = false;
} else {
visible = true
}
</Custom Show Eval>

But it doesn't work. Actually it's always invisible, even if the orb is not equip...

I both have Skill core and Equip core. So my character can equip 3 differents orbs.

Does anyone have an idea ? 🙂

Thanks a lot and have a great day !

Gregaur.
<Custom Show Eval>
if (user.equips()[0].atypeId = 10) {
visible = false;
} else {
visible = true
}
</Custom Show Eval>

I'm still kind of a noob at JS, but I'm pretty sure you need two = in that if statement, so like this:

if (user.equips()[0].atypeId == 10) {

Otherwise, one = means to assign the value after it to what's before it, but that doesn't make sense in that case, so nothing happens.

Hope this helps! Let me know if it does, I want to know if I'm understanding it too.
@Gregaur I've split your question into it's own thread - and hopefully have a reasonable title and have put it in the correct place.

We ask members not to necropost and not to post in other support questions, even if it seems very similar. That's because often it's not.
Hi all ! So I'm still unable to solve my problem : Here I am :

<Custom Show Eval>
if (user.equips()[0].aTypeId == 10) {

visible = false;
} else {
visible = true;
}
</Custom Show Eval>



Doesn't work even if I change the = into == (but I think it was he right things to do)
I have a few questions :

1 - What does the 0 in user.equips()[0] stand for ? Is it the Number of the Armor slot ?

2 - Do I use the good function ? my problem is the aTypeId. For me type sound like the kind of armor you define in the 14th tab. Should I use an other function like "user.equips()[0].amorId" (Does it exist ?). I want my IF to check is the Armor number 10 (6th tab) is equip.

Thank you very much all and envoy your Sunday !

Greg
User.equips()[0] is looking at the users first equip slot which for most games is a weapon.

AtypeId is the number of the armor type as set in the database.

Since you are looking at a weapon, the conditional with always return false since weapons dont have atypeIds. (Or more likely return an error in the console. YF put some nice checks in his code so errors like this won't crash the game, but it will still cause strange behavior like this if coded incorrectly.)

Have it look for wtypeId instead.
First, thank you 🙂

1 -
User.equips()[0] is looking at the users first equip slot which for most games is a weapon.

My actor has this notepad :
<Equip Slot>
Weapon
Shield
Head
Body
Access.
Access.
Access.
Orb
Orb
Orb
</Equip Slot>

So if i want my game to check the Orbs slot, should I use User.equips()[8] , User.equips()[9] , User.equips()[10] ?

2 -
AtypeId is the number of the armor type as set in the database.

What is the function for the amor ID (not type) ?

Thank you for your clarifications !
<Custom Show Eval>
if (user.hasArmor($dataArmors[10])) {
visible = false;
} else {
visible = true;
}
</Custom Show Eval>
<Custom Show Eval>
if (user.hasArmor($dataArmors[10])) {
visible = false;
} else {
visible = true;
}
</Custom Show Eval>


That's Perfect and solve my problem !

Thank you very much and a very nice week to you guys !

Original thread: https://forums.rpgmakerweb.com/threads/skill-equip-question.91074/