[SOLVED] Armor Database/Index for Armor Skills and Passives

Status
Not open for further replies.

Sa8er

Villager
Member
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>
 

Sa8er

Villager
Member
Joined
Aug 23, 2018
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RMMV
I figured it out! For those of you who might find this later, the code I've inserted into the state notebox for, in this example, Light Armor Mastery goes as such:

<Custom Passive Condition>
var armors = user.armors();
var light = 3;
condition = false;
for (var i = 0; i < armors.length; ++i) {
var armor = armors;
if (armor && armor.atypeId === light) {
condition = true;
break;
}
}
</Custom Passive Condition>


---
As it turns out, I forgot to include the "" stitch in the above examples I gave, as well as a few other issues I discovered after I found an index site:
which seriously helped me out. To anyone who plans on using a similar system for your game, I hope this
post helped!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,447
Members
137,820
Latest member
georg09byron
Top