So, I was creating a skill called 'Pillage' that steals a random item from the actors without fail. Steal as in subtracting an item from you. The variables are set to single and random. The Else Branch has a different dialogue that says you don't have any items for the enemy to steal. However, when I test the Pillage skills, the Common Event plays all the Else branches from the variables. So I had to add end-event processing to each and every one of them. When I test it once more, the event plays the first one's Else branch after the skill. Is there something I am doing wrong?
Else Branch plays instead of randomized Variable on a Common Event
RPG Maker MV SupportThe else branch happens whenever the conditional is not met. So in your event, if the random variable is 3, it will trigger the else branches for 1,2,4 and 5.
Did you mean to at some point check if the player has the item being stolen? The text seems to imply that, but you're not doing it anywhere.
Did you mean to at some point check if the player has the item being stolen? The text seems to imply that, but you're not doing it anywhere.
Your else-branches are referring to the check whether "Item Steal = 1" so of course they become true when Item Steal = 2 for example.
Your Eventing should look like this:
Your Eventing should look like this:
Code:
IF Item Steal = 1
IF Party owns Item Potion
Potion - 1
ELSE
Message: Luckily...
ELSE
IF Item Steal = 2
IF Party owns Item Magic Water
Magic Water - 1
ELSE
Luckily...
ELSE
...
you don't need nested conditionals.
just put the conditions one after another with no else clause.
just put the conditions one after another with no else clause.
You do need the ELSE when you want to show the "Luckily, nothing happened" message.
@Aerosys no, you don't:
"Message" is a redundant instruction if you always run it down all "else" branches.
therefore, you take it *out* of the branches, and make it the default instruction.
the resulting structure is essentially a Switch block.
Code:
Begin Event:
IF (condition1):
->instruction1.
->EXIT EVENT.
END
IF (condition2):
->instruction2.
->EXIT EVENT.
END
...
->Message: "..."
End Event.
"Message" is a redundant instruction if you always run it down all "else" branches.
therefore, you take it *out* of the branches, and make it the default instruction.
the resulting structure is essentially a Switch block.
You should have posted this right in the first place because the EXIT EVENT is essential. With that, I agree, it's a nice alternative to mine.
@Aerosys it was already in the pictures posted... I just rearranged the thing.
@gstv87 than you will you make the text of the said "item" you don't have?
I do agree @Aerosys way if you want the item name, else you need to store
that item name first to show the correct item in your way of the condition.
which is the variable name, else the end message needs to be different
that counts for all items at once, while its a random number 1-37 of stealing
so the name needs to correspond to it.
I do agree @Aerosys way if you want the item name, else you need to store
that item name first to show the correct item in your way of the condition.
which is the variable name, else the end message needs to be different
that counts for all items at once, while its a random number 1-37 of stealing
so the name needs to correspond to it.
Success! That really helped!
Original thread: https://forums.rpgmakerweb.com/threads/else-branch-plays-instead-of-randomized-variable-on-a-common-event.161575/