Question About VictorEngine Materia System

Hello, all! I'm in need of some help. I'm using VE's Materia System for a project, and I'm wanting to create a Materia that the player has to equip like any other Materia to gain AP through battle, but instead of giving access to spells, it is able to perform special abilities that allow the player to solve puzzles in dungeons or open secret paths depending on the Materia's level. (Example: A Wind Materia that allows the player to leap to a higher place on the map to reach a secret entrance if the Materia is at Level 2, or a Fire Materia that burns away a large tree to reveal a chest if it's at Level 3). I already know that I want to tie a variable to the Materia's AP, but I don't know what script I need to call up in the Control Variables tab to do this. Any help?

- Ian
You can do this via the materia objects on the actors, but in order to check the AP for a given materia you'd have to know its ID.
You can do this via the materia objects on the actors, but in order to check the AP for a given materia you'd have to know its ID.
What script do I use in the Control Variables command to do this? The IDs of the Materia are Armors 83 - 88.
So you want to store the AP of that materia in a variable, right? I'm guessing you need to make sure the materia is equipped as well?
So you want to store the AP of that materia in a variable, right? I'm guessing you need to make sure the materia is equipped as well?
Yes!
On a specific party member or just at least one of them?
On a specific party member or just at least one of them?
On at least one of them
And if more than one is equipped you want the highest?
And if more than one is equipped you want the highest?
That won’t be a problem as I’m planning on these being only one for each element.
Ah so you don't have the thing where a max level materia births a new one?
Ah so you don't have the thing where a max level materia births a new one?
Correct!
Okay, to check whether a party member has one equipped, do

Code:
$gameParty.members().some(member => member.equipedMateria($dataArmors[id of materia]))

Then to store the AP of that materia in a variable, do this inside the conditional branch using the above condition:

Code:
$gameParty.members().map(member => member.allMaterias()).filter(materiaList => materiaList[0] !== undefined && materiaList[0].id() === id of materia)[0][0].ap()
Okay, to check whether a party member has one equipped, do

Code:
$gameParty.members().some(member => member.equipedMateria($dataArmors[id of materia]))

Then to store the AP of that materia in a variable, do this inside the conditional branch using the above condition:

Code:
$gameParty.members().map(member => member.allMaterias()).filter(materiaList => materiaList[0] !== undefined && materiaList[0].id() === id of materia)[0][0].ap()
Thank you! You're a lifesaver!
It took me forever to get the syntax of that map and filter right. XD
It took me forever to get the syntax of that map and filter right. XD
I just tested it, but it won't pass the first conditional branch where it checks to see if the Materia is equipped. I'll copy what I put in to the Script below:
$gameParty.members().some(member => member.equipedMateria($dataArmors85))
You forgot the square brackets around the ID.
You forgot the square brackets around the ID.
Ohhhhhhhhhhh XD

UPDATE: IT WORKS!!!!!!!!!! THANK YOU!!!!!!!!
Always happy to be of assistance. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/question-about-victorengine-materia-system.124278/