Help with setting up a conditional branch

I have figured out half of what I want to do. I set up a conditional branch as parral process so when the character equips a short sword it changes his sprite to the one with the short sword, but I need to figure out how to add in there if he unequips it it changes his sprite back to no weapon? Thanks for any help.
Conditional Branches can have an "Else" branch. Click that checkmark and you can set up changing the sprite back in that part of the Conditional Branch.
Its always a good start to show what youve done. It sounds like you just need an else block for the conditional branch that sets the actor back to their default sprites
Its always a good start to show what youve done. It sounds like you just need an else block for the conditional branch that sets the actor back to their default sprites
1734743103416.png


Yes sorry I should have included this. this works good but its very laggy after the character equips the shortsword. not sure how to stop the lag, and not really sure how to make him revert back if he unequips the sword. Thanks for all your help.
Conditional Branches can have an "Else" branch. Click that checkmark and you can set up changing the sprite back in that part of the Conditional Branch.
Thank you, I see the checkmark but not sure what to do from there, But I will keep playing around with it. BTW I like your game on itch. Your battler's are really nice.
not sure how to stop the lag
parallel events run 60 times a second. the usual way to prevent that is to add a wait command. Try adding a 20 frame wait and it should be fine after then.
a parallel event thats always on and is checking for the actor's equipment isnt how id go about it personally, but should work for you if you say it does

and not really sure how to make him revert back if he unequips the sword
if your initial condition is "if the actor has the sword equipped", then the else is what happens if that isnt true. you dont need to make the else do anything other than change the actor's sprite back to its default just like how you changed it initially
It is laggy, because the "has sword equipped" condition is always valid. So your actor's image will be changed every frame.

In the ELSE case you can define, what shall happen, if the if conditon is NOT true.

"If equipped, do this - if not, do that."
parallel events run once 60 times a second. the usual way to prevent that is to add a wait command. Try adding a 20 frame wait and it shold be fine after then.
a parallel event thats always on and is checking for the actor's equipment isnt how id go about it personally, but should work for you if you say it does


if your initial condition is "if the actor has the sword equipped", then the else is what happens if that isnt true. you dont need to make the else do anything other than change the actor's sprite back to its default just like how you changed it initially
Thank you for the help, I'm starting to understand now 🙂. Can I ask what you would do different? because im going to have to run a lot of these events because everytime the character changes equipment i have to have an event to change his sprite, like armor and weapons. I already made all the sprites. I have a feeling its not gonna work good with so many events running at the same time lol, not to mention thats a lot of events on every map.
It is laggy, because the "has sword equipped" condition is always valid. So your actor's image will be changed every frame.

In the ELSE case you can define, what shall happen, if the if conditon is NOT true.

"If equipped, do this - if not, do that."
Thank you for your time. I'm sure I will learn this stuff just gonna take me some time. I'm an old fart and Its hard for me to catch on now a days
No worries. It's a good idea to use as few Parallels as possible. Too many of them (or too busy ones) will slow down your game a lot. For example, you can put all your equipment checks into one event, instead of doing multiple for every possible equipment.

If Sword
-> do this.
ELSE If Axe
-> do that.
ELSE If Bow
-> do something else
ELSE ... etc.

Actually I can't think of an easy way to check this only once with eventing only. The default menu of the RPG maker is a shell that's hard to customize. So maybe you can find a plugin that will change the appearance of your hero according to their equipment.

It seems, they are discussing some options here:

What I would do personally is to always set a Switch to ON, when the player opens the menu.
So, if they leave the menu, the active switch will trigger your equipment check once, assigns the correct charset, and will be set to OFF. This way, your check will be done every time once, the player actually had the chance to change something. Not all the time.
But this requires a little Plugin too.
No worries. It's a good idea to use as few Parallels as possible. Too many of them (or too busy ones) will slow down your game a lot. For example, you can put all your equipment checks into one event, instead of doing multiple for every possible equipment.

If Sword
-> do this.
ELSE If Axe
-> do that.
ELSE If Bow
-> do something else
ELSE ... etc.

Actually I can't think of an easy way to check this only once with eventing only. The default menu of the RPG maker is a shell that's hard to customize. So maybe you can find a plugin that will change the appearance of your hero according to their equipment.

It seems, they are discussing some options here:

What I would do personally is to always set a Switch to ON, when the player opens the menu.
So, if they leave the menu, the active switch will trigger your equipment check once, assigns the correct charset, and will be set to OFF. This way, your check will be done every time once, the player actually had the chance to change something. Not all the time.
But this requires a little Plugin too.
Thank you! I am going to read up on it for sure. I do have a plugin I got that lets you run a common event when you leave the menu, So I think I'll try to do like you said and run a common event with the else's, because i'll hjave to run one huge comment event because the plugin i have will only call one common event. the plugin I have is from Hakuen, it works good.
I see - if there's a common event running anyway, if you leave the menu, it's the perfect place for the check.

If you want to keep it clean, you can place your equipment check in a different common event and just call it during your menu common event. So you don't have a lot of unrelated code stuffed in there.
Can I ask what you would do different?
my first choice takes a little but of script, but would have been using a plugin like waynee's equip eval to make the weapons change the actor's sprites as theyre equipped and removed. No idea how well it works for MZ however.
my second choice and first recommendation for a beginner would have been to use a plugin to facilitate running a common event as you leave the menu to update the sprites since theres no real need for this to be parallel. youre already figuring that one out.
I see - if there's a common event running anyway, if you leave the menu, it's the perfect place for the check.

If you want to keep it clean, you can place your equipment check in a different common event and just call it during your menu common event. So you don't have a lot of unrelated code stuffed in there.
Thank you for all your time, I'm going to fart around with it I will let you know how it goes. So you said I can keep going with the else's? it don't matter how many are in my common event?
my first choice takes a little but of script, but would have been using a plugin like waynee's equip eval to make the weapons change the actor's sprites as theyre equipped and removed. No idea how well it works for MZ however.
my second choice and first recommendation for a beginner would have been to use a plugin to facilitate running a common event as you leave the menu to update the sprites since theres no real need for this to be parallel. youre already figuring that one out.
Yes , I did not know i could keep going with the or else's in a common event, (Zia) informed me of that. so im going to make one huge common event with all my equip options, then just use my plugin to call the common event when i leave the menu. Many thanks for your time
Thank you for all your time, I'm going to fart around with it I will let you know how it goes. So you said I can keep going with the else's? it don't matter how many are in my common event?
Yes. That'll be fine, no matter how many Elses you nest together.

What'll happen is, your game will start reading your IF-Condition from the top, checking if your condition is True. If not, it will check the Else Case. Put another IF-Condition in there, and it'll check this aswell, then the next Else, etc ... Until it finds the first one to return True. That will be performed, all other cases will be ignored.
Also, if all turn out False, none of them will be performed.
Yes. That'll be fine, no matter how many Elses you nest together.

What'll happen is, your game will start reading your IF-Condition from the top, checking if your condition is True. If not, it will check the Else Case. Put another IF-Condition in there, and it'll check this aswell, then the next Else, etc ... Until it finds the first one to return True. That will be performed, all other cases will be ignored.
Also, if all turn out False, none of them will be performed.
That is so very nice to know. Thank you!
BTW I like your game on itch. Your battler's are really nice.
Not my game but hadecynn's, I leave it in my signature because I had talked about the game a lot back then (it's been seven years?!) and wanted to give people easier access to it.

Also, others have said this already but yeah, Parallel Events absolutely can cause lag, it's a place newer developers tend to accidentally bog down their games without realizing.

my second choice and first recommendation for a beginner would have been to use a plugin that lets you run a common event as you leave the menu to update the sprites since theres no real need for this to be parallel. youre already figuring that one out.
I sadly don't know if there's a similar plugin for MZ (or one that's free), but this probably works with FOSSIL.
It is laggy, because the "has sword equipped" condition is always valid. So your actor's image will be changed every frame.

In the ELSE case you can define, what shall happen, if the if conditon is NOT true.

"If equipped, do this - if not, do that."
hiya Zia, thanks for all your help yesterday...I was wondering if you might be able to set up how you were talking about doing the conditional branches with the elses? only if and when you have time. I just need a screenshot of how you do it, I farted around with it for a few hours and im having no luck, the way i did it it only equips the first one on the list and it doesnt equip anything else. here is what i have going on. like i said no rush only if you have some spare time.
1734816352236.png
What you want to do won't work with this approach; you can only check one equipment type at a time, and each of your character images contains only a single matching item. In order to do it with this method, you'd have to cross-reference every possible combination of armour and weapons, and have a conditional branch (and walking graphic) for every single configuration. This also means that every new piece of equipment you add will exponentially increase the number of checks you need.

For example, if you have only a single sword and piece of armour, you will need to check:

1. Nothing equipped
2. Just the sword
3. Just the armour
4. The sword and armour together

Add an additional sword, and you need:

1. Nothing equipped
2. Just the first sword
3. Just the second sword
4. Just the armour
5. Armour with first sword
6. Armour with second sword

Add an additional armour:

1. Nothing equipped
2. Just the first sword
3. Just the second sword
4. Just the first armour
5. Just the second armour
6. Armour 1 with sword 1
7. Armour 1 with sword 2
8. Armour 2 with sword 1
9. Armour 2 with sword 2

And so on, and so forth...

Original thread: https://forums.rpgmakerweb.com/threads/help-with-setting-up-a-conditional-branch.174055/