Two quick questions. One about conditional branches and another with a graphical error with a plugin

First question, how do I have a conditional branch looking for specific types of equipment? Like say I want a branch looking if the player has the sword type weapon equipped or if he has the full helm type armor equipped?


Second, I keep getting graphic error on Yanfly's party and row scenes in the menu.


M1Us3H0.png



The sprites appear distorted. I'm guessing it has something to do with using spritesheets that are much larger than the default ones. Is there any way to fix this or at least disable it?


Thank you for your time.
For the first there's a check under the conditions for conditional branch. Select the one for weapon then your item check include equip.


The second no you can't. The engine has to try to force the image to fit and if it is too big it will shrink it until it does. You'll need to either use a smaller faceset or see if there is a way to edit the plugin to use something else (which you'll have to do that in another thread as that belongs under plug-in support.)
Alright, thanks for the heads up. I'll ask at plugin support.


For the first question I was mostly talking about checking the general armor and weapon type, not a specific weapon but all items under a general weapon/armor type. Like all the helmet pieces belonging to the "Full Helm" type under the Armor Type tab. The conditional branch only has for individual items, not the general type. I know there was a way to do under the script section of the conditional branch event but I lost the code.
Hmmm...not sure. But if you need code that is under the javascript forums too. Might try under the post for javascript questions that don't need their own thread?
on the fourth page of conditional branch, there is "script". You can always put there... I think it is $gameActor(x).isWtypeEquipped(y), x being the actor's number and y the weapon type's.
Ah, thanks Waterguy. Do you happen to know the script for armor type? Would AtypeEquipped work?
You'll have to use a script call to change a switch.


I think it should be 


$gameSwitches.setvalue(x, $gameActor(y).armors().some(function(armor) {return armor.atypeId === z;}));


but I make no guarantees... could you check it out?
I get a "Type Error: Object not a function".
$gameSwitches.setValue(x, $gameActor(y).armors().some(function(armor) {return armor.atypeId === z;}));


Try now, I had put setvalue instead of setValue.


x is switch, y is actor, z is armor type.
No, sir. Still getting the same error has before.
$gameSwitches.setValue(x, $gameActors.actor(y).armors().some(function(armor) {return armor.atypeId === z;}));


Ok, try this one then.


This time I tested it, and it changed the switch for me. Hopefully it'll do it for you too.
@HasdrubalBarca Can you give a screenshot of the console output when that error happens, AND post here the exact code you wrote?


The last part is to see if you replaced x y and z correctly.
Ah, now it's working! Thanks Waterguy for your time, really appreciate it.


It's good now, Andar.

Original thread: https://forums.rpgmakerweb.com/threads/two-quick-questions-one-about-conditional-branches-and-another-with-a-graphical-error-with-a-plugin.69599/