Thanks mate, I understand you, I do have all the sprite images with different combinations, but my problem is I am not sure how to set up the conditional branch for more than one item, i tried to set it up with the sword or the armor just for testing but it was only changing the weapon and not the armor. i do not think im setting up the branches right, i did the sword by itsself and it works fine. but when i run another branch for the armor it should switch to the armor sprite, but its not. i even unequipped the sword and just equipped the armor and it didnt change to the armor sprite.
Help with setting up a conditional branch
RPG Maker MZ SupportYou will need to nest each successive branch inside an else for the previous one, otherwise they'll overwrite each other.
Thanks mate, I am understanding you, I do have all the sprite images for the different comboinations. my problem is I dont think im setting up the branches right. It only equips the first thing on the list. I even unequipped the sword then equipped the leather armor and it does not change to the armor sprite, it only works with the first branch the sword.
Show me what you have currently.
To cover all combinations, you'll have to combine If Conditions.
By setting them up like this, you can check multiple conditions to be true, before changing the image of your charset. Be careful to keep track which ELSE belongs to which IF.
PS:
What might be easier for you to follow is a line of Script in your conditional branch to specify the equipment.
You can do that on page 4 of your conditional branch window.
Maybe someone can correct me, but it should be something like this:
$gameActors.actor(1).isEquipped($dataWeapons[1]) && $gameActors.actor(1).isEquipped($dataArmors[3])
This line will check, if actor 1 has weaponID 0001 and armorID 0003 equipped.
Change the numbers in the [ ] to define the weapons and armors, and nest as many conditional branches as you need to cover all your combinations.
By setting them up like this, you can check multiple conditions to be true, before changing the image of your charset. Be careful to keep track which ELSE belongs to which IF.
Code:
◆If:Reid has equipped Short Sword
◆If:Reid has equipped Leather Armor
◆Comment:Change Image to Sword+Leather Armor
◆
:Else
◆If:Reid has equipped Iron Armor
◆Comment:Change Image to Sword+Iron Armor
◆
:Else
◆Comment:Change Image to Sword only
◆
:End
◆
:End
◆
:Else
◆If:Reid has equipped Hand Axe
◆If:Reid has equipped Leather Armor
◆Comment:Change Image to Axe+Leather Armor
◆
:Else
◆If:Reid has equipped Iron Armor
◆Comment:Change Image to Axe+Iron Armor
◆
:Else
◆Comment:Change Image to Axe only
◆
:End
◆
:End
◆
:Else
◆If:Reid has equipped Leather Armor
◆Comment:Change Image to Leather Armor
◆
:Else
◆If:Reid has equipped Iron Armor
◆Comment:Change Image to Iron Armor
◆
:Else
◆Comment:Change Image to nothing
◆
:End
◆
:End
◆
:End
◆
:End
PS:
What might be easier for you to follow is a line of Script in your conditional branch to specify the equipment.
You can do that on page 4 of your conditional branch window.
Maybe someone can correct me, but it should be something like this:
$gameActors.actor(1).isEquipped($dataWeapons[1]) && $gameActors.actor(1).isEquipped($dataArmors[3])
This line will check, if actor 1 has weaponID 0001 and armorID 0003 equipped.
Change the numbers in the [ ] to define the weapons and armors, and nest as many conditional branches as you need to cover all your combinations.
Code:
◆If:Script:$gameActors.actor(1).isEquipped($dataWeapons[1]) && $gameActors.actor(1).isEquipped($dataArmors[3])
◆Comment:Change Image to Weapon1+Armor3
◆
:Else
◆If:Script:$gameActors.actor(1).isEquipped($dataWeapons[1]) && $gameActors.actor(1).isEquipped($dataArmors[4])
◆Comment:Change Image to Weapon1+Armor4
◆
:Else
◆If:Script:$gameActors.actor(1).isEquipped($dataWeapons[1]) && $gameActors.actor(1).isEquipped($dataArmors[5])
◆Comment:Change Image to Weapon1+Armor5
◆
:Else
◆If:Script:$gameActors.actor(1).isEquipped($dataWeapons[2]) && $gameActors.actor(1).isEquipped($dataArmors[3])
◆Comment:Change Image to Weapon2+Armor3
◆
:Else
◆If:Script:$gameActors.actor(1).isEquipped($dataWeapons[2]) && $gameActors.actor(1).isEquipped($dataArmors[4])
◆Comment:Change Image to Weapon2+Armor4
◆
:Else
◆If:Script:$gameActors.actor(1).isEquipped($dataWeapons[2]) && $gameActors.actor(1).isEquipped($dataArmors[5])
◆Comment:Change Image to Weapon2+Armor5
◆
:Else
◆Comment:Change Image to nothing
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
Is there a reason you're doing all this instead of using a character creator plugin? MPP CharacterMake or SRD Character Creator are free
Wow, Thank you Zia....I'm going to try this it looks less confusing then all of those if's and else's lol many thanks for all you guy's help not sure what i would do with you guys!
well i have tried to use them, but my sprites will not work with them plugins, because my spriutes don't have pieces i only have the full character sprites with different stuff equipped. the plugins i tried required you to have different pieces, unless i just didnt know what i was doing.
What Zia said is what I meant when I said you'd have to nest the if conditions inside each other to stop them overwriting...which is exactly what you have that I told you wouldn't work. 😛
Thank you very much im thinking of just going ahead and making pieces for the main character and use some sort of plugin, can you recommend one for mz? the less complicated the better haha I'm an old fart and get confused easy when it comes to stuff. Thanks again for all your help.
Use MPP CharacterMake or SRD Character Creator with FOSSIL and the Yorae Rosantae add-on
SRD's CharacterCeatorEx Enhanced Extension (with MZ and MV3D compatibility patches) by YoraeRasante
Extension for SRD's CCEx with a few fixes and additions, plus MV3D compatibility and a help for FOSSIL
yoraerasante.itch.io
sweet! thank you
Original thread: https://forums.rpgmakerweb.com/threads/help-with-setting-up-a-conditional-branch.174055/