bookco

Regular
Regular
Joined
May 29, 2023
Messages
161
Reaction score
155
First Language
English
Primarily Uses
RMMZ
In my current project, magic users need to hold an arcane focus in one of their weapon slots in order to cast spells. I'd like to offer a variety of these, possibly up to ten: a spellbook, an orb, a wand, a staff, a rod, a small or large crystal, a geode, a grimoire (yes I know that's a spellbook but I'd differentiate the two on account of a grimoire's sentient nature), and a diamond. It would be nice to have a plugin where the required weapons for a skill could be modified via notetag. Just a thought. Otherwise I'll have to duplicate magic five times over in the database.

As an aside, it would be *really* rad if there could be an *armor* prerequisite for a skill.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,764
Reaction score
11,416
First Language
English
Primarily Uses
RMMV
Have you Googled it? I know people have made this - probably for MV, but I can't think of any part of the involved functions that should be different between the versions.

Hey, look...I even answered it for MZ already :stickytongue:

There's no equivalent function to see if a particular armor type is equipped, but you could do
Code:
user.armors().some(armor => armor.atypeId==x)
where x is the ID of the type you're looking for.
 

bookco

Regular
Regular
Joined
May 29, 2023
Messages
161
Reaction score
155
First Language
English
Primarily Uses
RMMZ
EDITED: So if I’m understanding correctly, with the Skills and States VS plugin I can type in the notes of a given skill:

Code:
<JS Skill Enable>
user.armors().some(armor => armor.atypeId==x || armor.atypeId==y || armor.atypeId==z)
</JS Skill Enable>

and it will make the skill dependent on x, y, or z, armor being equipped?
 
Last edited:

Arthran

Regular
Regular
Joined
Jun 25, 2021
Messages
1,251
Reaction score
1,946
First Language
English
Primarily Uses
RMMZ
and it will make the skill dependent on x, y, or z, armor being equipped?
It will make it dependent on x, y, or z armor *type* being equipped. It could also be shortened a bit:

Code:
<JS Skill Enable>
user.armors().some(armor => [x, y, z].includes(armor.atypeId));
</JS Skill Enable>
 
Last edited:

bookco

Regular
Regular
Joined
May 29, 2023
Messages
161
Reaction score
155
First Language
English
Primarily Uses
RMMZ
It will make it dependent on x, y, or z armor *type* being equipped. It could also be shortened a bit:

Code:
<JS Skill Enable>
user.armors().some(armor => [x, y, z].includes(armor.atypeId));
</JS Skill Enable>
Even better. I have my armor types finely differentiated already—they aren't "light, medium, heavy" differentiations, they denote what the armor is in general, with different armors falling into these categories separated by +0, +1, +2, +3 qualities and durability characteristics. Glad to know that work wasn't for nothing. Thanks for the abbreviated solution.
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
730
Reaction score
944
First Language
English
Primarily Uses
RMMZ


Should work for MZ
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,764
Reaction score
11,416
First Language
English
Primarily Uses
RMMV
It will make it dependent on x, y, or z armor *type* being equipped. It could also be shortened a bit:
Yeah, that was an older post before I familiarized myself with JavaScript's array functions :wink:
 

Latest Threads

Latest Posts

Latest Profile Posts

My Game Jam entry is a bunch of mini games wrapped within an epic story that will rival the deepest plots of the earliest CRPGs! As a small spoiler, here is one example of a game you will be able to play. Anyone want to try Brat, Krampus, Santa?
so I had two plugin that essentially overwrite each other depending on where they are in the list. so I had to edit what was overwriting one into the other and now they both work. I REALLY need to sit down and just learn JavaScript. I hate that I know just enough to know I don't know NEARLY enough lol.
The Open Hand scandal got even more spicy. The Completionist streamer Jirard made a video response and tossed a bunch of links and documents, but apparently none of it actually addressed why donations he collected sat for 10 years (way too long to justify). He also seemed to threaten defamation suits vs. people for what amounts to pointing out publicly available records. The IRS should definitely audit.
My next update is going to amazing! There's been major additions and things I've wanted to do in previous versions that weren't possible until now. It's not ready yet, but will be soon!
made an RTP edit to try to save on work, found out I was editing the wrong tilesheet of cliffs.
It's fine... I'm fine... I'm sure fixing this won't take too long

Forum statistics

Threads
136,911
Messages
1,271,347
Members
180,700
Latest member
ahiru
Top