- Joined
- Aug 23, 2018
- Messages
- 7
- Reaction score
- 2
- First Language
- English
- Primarily Uses
- RMMV
I'm a bit of a stranger to Java and programming in general, but I plan on having both weapon and armor skills for certain actors which can be learned or upgraded, such as being highly skilled with Bows but not Crossbows and that sort. Currently, I've utilized some of Yanfly's plugins such as Passive States, which is what I needed to replicate the Weapon Passives which can be found here: http://www.yanfly.moe/wiki/Weapon_Mastery_Passive_(MV_Plugin_Tips_&_Tricks)
What I'm requesting is information on which of these variables or places in the code I need to change and what to change them to in order to have a similar effect with Armor Passives which trigger whenever the user equips a specific type of armor. Thanks for the help!
To clarify, the script Yanfly made for weapon passives is:
<Custom Passive Condition>
// Get all currently equipped weapons for the user.
var weapons = user.weapons();
// Set the swords variable.
var swords = 2;
// Set the initial condition to be false.
condition = false;
// Loop through each of the weapons.
for (var i = 0; i < weapons.length; ++i) {
// Get the currently looped weapon.
var weapon = weapons;
// Check if the weapon exists and if the weapon type ID matches the sword ID.
if (weapon && weapon.wtypeId === swords) {
// Set the condition to be true.
condition = true;
// Break the loop.
break;
}
}
</Custom Passive Condition>
And the script I tried to use was:
<Custom Passive Condition>
var armors = user.armors();
var lightarmor= 1;
condition = false;
for (var i = 0; i < armors.length; ++i) {
var armors = armors;
if (armor && armor.atypeId === lightarmor) {
condition = true;
break;
}
}
</Custom Passive Condition>
What I'm requesting is information on which of these variables or places in the code I need to change and what to change them to in order to have a similar effect with Armor Passives which trigger whenever the user equips a specific type of armor. Thanks for the help!
To clarify, the script Yanfly made for weapon passives is:
<Custom Passive Condition>
// Get all currently equipped weapons for the user.
var weapons = user.weapons();
// Set the swords variable.
var swords = 2;
// Set the initial condition to be false.
condition = false;
// Loop through each of the weapons.
for (var i = 0; i < weapons.length; ++i) {
// Get the currently looped weapon.
var weapon = weapons;
// Check if the weapon exists and if the weapon type ID matches the sword ID.
if (weapon && weapon.wtypeId === swords) {
// Set the condition to be true.
condition = true;
// Break the loop.
break;
}
}
</Custom Passive Condition>
And the script I tried to use was:
<Custom Passive Condition>
var armors = user.armors();
var lightarmor= 1;
condition = false;
for (var i = 0; i < armors.length; ++i) {
var armors = armors;
if (armor && armor.atypeId === lightarmor) {
condition = true;
break;
}
}
</Custom Passive Condition>

