Hello once again. I'm doing a system where you can only equip certain pieces of armor when a certain passive state is equipped, signaling gender. However, in Yanfly's Equip Core, the plugin that I'm using for this, there is no default option for having a requirement be that a certain state is equipped, requiring lunatic code to accomplish. What is the code for checking if you have a certain state to equip a certain piece of armor in Yanfly Equip Core? I need help with this ASAP. Thanks.
MV Yanfly Equip Requirements - Lunatic code for needing a state to equip something?
Javascript/Plugin Supportwhy are you using a plugin or notetag at all for this?
you can simply give the state itself an armor equip trait and then use an armor type "female armor" and there is no need for lunatic code
you can simply give the state itself an armor equip trait and then use an armor type "female armor" and there is no need for lunatic code
also, if you have fixed actors, why not just apply "Male Armor" and "Female Armor" on the Actors directly through the traits? If you do that, you don't need the states or plugins.
@Andar @zelanius That is because it's more than just armors, it's weapons too. Plus, a piece of armor or a weapon can only have one equipment type, not two or more, so "just using equipment types" like you suggested is impossible. I've asked already and I'll ask again: can someone please supply me with the lunatic code? The example shown in the plugin instructions goes like this:
I need the section that says "if (user.name() === 'Harold')" to be changed to something along the lines of "if current actor has state y" which I don't know how to write out in code. Can someone please help me with this? Thanks.
Edit: Found the answer. The code is right here.
Thank you to @JohnDoeNews for the help! Your effort are highly apricated! Closing thread now.
Code:
<Custom Equip Requirement Condition>
if (user.name() === 'Harold') {
condition = true;
} else {
condition = false;
}
</Custom Equip Requirement Condition>
I need the section that says "if (user.name() === 'Harold')" to be changed to something along the lines of "if current actor has state y" which I don't know how to write out in code. Can someone please help me with this? Thanks.
Edit: Found the answer. The code is right here.
Code:
<Custom Equip Requirement Condition>
if value = user.isStateAffected(x); {
condition = true;
} else {
condition = false;
}
</Custom Equip Requirement Condition>
Thank you to @JohnDoeNews for the help! Your effort are highly apricated! Closing thread now.
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.
Original thread: https://forums.rpgmakerweb.com/threads/yanfly-equip-requirements-lunatic-code-for-needing-a-state-to-equip-something.130980/