System where you can only attach one element type

So I am using Yanfly's Attachable Augments and I'm trying to make a system where you can add a element to your weapon but you can not attach more than 1 element to said weapon or armor, every element has 10 stages of increase to reach a total of 500% elemental damage. I have no clue how would I be able to do this in lunatic mode.
my idea is as follows.

<Augment Attach Eval: Slot1>

if (weaponElement == Fire || weaponElement == null)
{
Slot1 = Fire
}
else
{
Slot1 = null
}

</Augment Attach Eval: Slot1>

Same thing for slot 2, slot 3, slot 4, ect and also with every other element.

I'm a complete noob in javascript and only know C# so I can't figure out how to call on the elements of RMMV's database and evaluate the weapon's element to determine weather or not the slot can be used for the element the player has chosen.

Link to Attachable Augments:
http://yanfly.moe/2016/04/15/yep-92-attachable-augments-rpg-maker-mv/
So today I discovered what handles the elements and how to access them, I also learned about another plugin from Yanfly called Item requirements.

My code is as follows for that:

Fire Augments:
<Custom Enable Requirement>
condition = $dataSystem = elements[2]
</Custom Enable Requirement>


Water Augments:
<Custom Enable Requirement>
condition = $dataSystem = elements[3]
</Custom Enable Requirement>

But it does not work, it just adds both items to the same weapon like if the condition didn't exist. I have a feeling I'm doing something wrong and the condition is just looking into the database to figure out if the element exist in the database. I don't know how to make it figure out if the item has a certain element or not to determine if the item can be added to the slot.

Link to Item Requirements:
http://yanfly.moe/2017/05/12/yep-136-item-requirements-rpg-maker-mv/
You are trying to use the assignment operator for a comparison(?), when you should be using the equals comparison operator. It looks like in some places you're referencing something as a variable when it might be a string (strings are surrounded by quotes). Last, using a variable that has not been declared will result in an error.
These would also be issues in C# btw.

Some suggestions:
1.) Please edit your post to include links to the plugins so people don't have to go searching
2.) Experiment with the debugger console (press F8 during a playtest). It will show you any errors, and you can explore all of the variables in the game with an auto-complete feature
You are trying to use the assignment operator for a comparison(?), when you should be using the equals comparison operator. It looks like in some places you're referencing something as a variable when it might be a string (strings are surrounded by quotes). Last, using a variable that has not been declared will result in an error.
These would also be issues in C# btw.

Some suggestions:
1.) Please edit your post to include links to the plugins so people don't have to go searching
2.) Experiment with the debugger console (press F8 during a playtest). It will show you any errors, and you can explore all of the variables in the game with an auto-complete feature

Well the variables are declared and they function since I can call them and use them just fine, my problem is the item is not looking at the condition and executing the barrier I'm trying to bring up. also F8 doesn't give me any errors at all which is why I'm stuck. I did change it to a equals operator, that was my mistake but even with a equals operator it does the same thing. I'll keep digging and trying something different or find another way to do it.
The easiest way I can see for this is to make the other element attachments unselectable once one is attached.
That part will likely require an update to the plugin as it doesn't do augment restrictions by default.

(The element stacking itself I'll leave to you)
The easiest way I can see for this is to make the other element attachments unselectable once one is attached.
That part will likely require an update to the plugin as it doesn't do augment restrictions by default.

(The element stacking itself I'll leave to you)

Actually after countless hours of work and trying to figure out how to do it I realized two things:

1. Item Requirements doesn't work on restricting the use on augments.
2. Augments doesn't have any kind of restrictions. which is what you just said in this post.

So yeah, my only option is to use another method with the Disassemble Plugin from Yanfly and do Enchantments through that which is easier but it comes with the cost of the weapon not keeping anything the player might have done to the previous version of the weapon with the other plugins I use for other upgrades, But I'll work through that.

But anyways, thanks for the assistance <3
My fault. I just realized I hadn't made my intention clear:
I was going to make the augment restriction add-on to the plugin.
If you'd rather go another route, fine but ima try the new plugin anyway.
My fault. I just realized I hadn't made my intention clear:
I was going to make the augment restriction add-on to the plugin.
If you'd rather go another route, fine but ima try the new plugin anyway.

Oh, That's very nice of you! I'll wait for it and use it once it's done, it would actually make the system I'm trying to build a lot better 😀
All done!



I actually got a few ideas to expand it, but for now this is pretty much what you needed.
Let me know if you have any trouble with the plugin.

(I'll formally post it in the completed plugin section after I finish expanding it.)
So I don't think I'm understanding how to use the plugin.

On what item do I add <augRestrictType: x>?
I added it to the Enchantment stone and nothing happened, I also added it to the weapon and lastly I added it to both.

also what do I replace "item" with? the name of the Weapon Type in database or with the number in database or the name of the weapon? I got TypeError using weapon names, their number in database, Weapon type and their number in database.
Ok. I'll try to explain this with a scenario:

Let's say you have a sword in your game that can accept 5 Gem type Augments.

Now, your game system allows building that sword up with any of 3 elements: Fire, Water, Wind.
Let's give these elements numbers.
Fire = 1
Water = 2
Wind = 3

Now, let's say you want to be able to only equip Fire Gems.
What you would first do is set each Augment Item (Gem) with the restriction type.
Fire Gems - <augRestrictType: 1>
Water Gems - <augRestrictType: 2>
Wind Gems - <augRestrictType: 3>

Now, which each Gem set, you want to establish that once equipped, the other
Gems can't be added.

To do this, you'll have to add the restriction to the Sword after equipping a Gem.
Fire Gems should restrict Water and Wind
Water, restricting Fire and Wind
Wind, restricting Fire and Water

To do this on the Fire Gem, you'd use the Lunatic Mode code:

<Augment Attach Eval: Orb>
$gameParty.addAugmentRestrictType(item, 2);
$gameParty.addAugmentRestrictType(item, 3);
</Augment Attach Eval: Orb>

("item" here refers to the sword and will work as typed here)

Once this item is attached to the sword, no other element Gem will be able to be.

But if you want to Detach the gem, you'll have to remove the restriction:

<Augment Detach Eval: Orb>
$gameParty.removeAugmentRestrictType(item, 2);
$gameParty.removeAugmentRestrictType(item, 3);
</Augment Detach Eval: Orb>

Give this setup a try and see if that works for you.
Yes, Yes and Another Yes!

This is exactly as I envisioned! Thank you so much for your work and sorry if I was a bit of a pain.
Again thank you very much and please let me know of the plugin you expand on as maybe I might use the other functions you have been inspired to do.
Maliki, you seem to be the guy to ask arround here 😀 I do have a similar problem:

I have 10 additional Armor Slots declared as Rune slots and plan on having 30+ diffrent runes with x tiers each.
Now i would like the player only to be able to equip one of each category. and i would like to definde those categories with notetag or similar if possible. How would i go about this. (would use any plugin u recommend. Using a lot of Yanfly, but the EquipRestrictions either doesnt have it or not as easyly found as i would want it to be)
the unique only feature excludes me from equipping the same rune all over. but not higher tiers or runes with similar effect and different name.

F.E.:
Upon Equiping a "Sun Rune 5" with (M.Att 20) and (INT 5) in 1 slot you can'T equip any other Sun or Fire(M.att 20) rune, but u could equip a Moon Rune (20 INT + 5 M.att) or any other Rune that doesnt share the higher value in any of the other 9 slots.
Hmmm....

So to try to make sense of this, allow me to reinterpret your example:

Your game will have, say 4 different rune types: Sun, Moon, Star, Sky. (I know you said 30, but this is for simplicity's sake.)
Each type will have 5 tiers: A, B, C, D, E with E being the weakest and A the strongest.

You want it so once you equip a weapon with Sun-B you cannot equip any more Sun runes?
Or do you want to not be able to equip a Sun-A while still having access to B, C, D and E runes and any other rune type?

If you want the first one, then you can use my plugin above.
Just give the Sun runes this notetag: (assuming you want Sun Runes to have Augment Restrict type 1)

<augRestrictType: 1>
<Augment Attach Eval: Orb>
$gameParty.addAugmentRestrictType(item, 1);
</Augment Attach Eval: Orb>
<Augment Detach Eval: Orb>
$gameParty.removeAugmentRestrictType(item, 1);
</Augment Detach Eval: Orb>

*Since my plugin does NOT auto-UNequip augments, you can easily use this to force users to have only a certain number of a set type of augments on an equip.
(This setup allows use of only one augment per augment type. You'd have to have a bit more JavaScript know-how to do several, but it is fairly easy.)

This has gotten fairly long. 🙂
If you need the second scenario, let me know and I'll walk you thru it.

Hope this helps!
Well, first off thx for the fast reply.

So: Yes basically your variant would work i guess i could define all fire(all tiers) and sun runes Type one. Moon and star type 2 and so on...

But - my question was a bit diffrent:
-I do not have equipment(armor or weapons) with slot augments.
I did add 10 more armor slots, like rings or body or head. i defined them all to be rune slots. So my Runes are basically armor.
Now my question is if this script of yours could be made to exclude ...

ahhm for simplicitys' sake: i got 4 ring slots. i got 2 of each ring color. i would like to be able to exclude any other yellow or orange ring after equipping 1 either yellow or orange ring.
So after i equip the first yellow the 2 orange and the otehr yellow cant be equipped.
So then i could equip a blue ring in the next slot. this will exclude me from equipping any more blue and violet rings. and so on..

important thing is that i want to do this with armor. not some kind of augments. Show.png



And for the bigger picture:

The goal would be, if u played ffxi or warframe a mix of FFXI's switching all your gear in battle for exactly the stats u want for the next spell and Warframes modding of a skill.

In the end i want to cast a spell, and before doing so the char will automatically equip the runes (which either I or the player defines in some way) best suited for that spell.
I found switching your whole armor during a 5 sec spell cast as was in FFXI surreal. but i liked picking the stats of the gear where its needed.
So in my game gear will only get base values (prolly only hp, def & m.def). all the other stats will be on the runes and those should then switch as needed before each spell.

This would be the goal - if i'll ever get there 😀
I get it.

So to answer your question, no.
My plugin is designed to work with YF's Item Augments.

If you're asking me to make a plugin for equipment restrictions like I did for
the Augments, you should make another thread and ask there.
If any plugin designers (including myself) are up to it, then we will do it there.
k thx. was just wondering if it could be done with this or some adjustments to this. thx
If I had more experience with YF's Equip plugins, I'd probably be able to alter the plugin more.
In fact, I just might see if I can figure it out.
I'll pm you if I decide to try it.
This is incredible! Thank you a lot, i was looking forward to recreate the way FFX customize system worked and it was impossible without restricting certain types of augments!

Original thread: https://forums.rpgmakerweb.com/threads/system-where-you-can-only-attach-one-element-type.96957/