Issues with Conditional Branches

Hello, simply put, I'm trying to make it so the player cannot leave the map until 2 pieces of equipment are in his inventory. It doesn't matter if it's equipped, just as long as he has it. Once he has the 2 pieces of equipment, his friend will say it's ok to move forward.

 

I've been stuck on this for a few days and I haven't found out how to create an event where 2 items are needed to move forward.

 

Here's an "If, Then" example of what I'm attempting to do:

 

  • IF Player has Weapon in Inventory
  • THEN Players Friend says something but mentions that the Armour is needed before they can leave

  • IF Player has Armour in Inventory
  • THEN Players Friend says something but mentions that the Weapon is needed before they can leave

  • IF Player has Weapon AND Armour in Inventory
  • THEN Player's Friend says that now they're good to go...
 

I can seem to only make it happen when one piece of equipment is acquired, not both...

 

Maybe it would be best to make it so the player already has the armour in his inventory so that this whole situation revolves around acquiring the weapon?

 

Please tell me what I'm doing wrong...

 

Here are screenshots of my attempts at creating this event:

 

Event 015 - Page 1

Event 015 - Page 1.png

 

Event 015 - Page 2

Event 015 - Page 2.png

 

Event 015 - Page 3

Event 015 - Page 3.png
All you have to do for this is nest a conditional branch within the first conditional branch. Example:

Conditional Branch: item[weaponid] is in inventory

   Conditional Branch: item[armorid] is in inventory

   Alright, let's go kill some monsters! 

   else:

   you do not have the correct armor for this.

else:

Conditional Branch: item[armorid] is in inventory

You need to get your weapon before we can go.

else:

You need to buy both a weapon and armor before we can leave, idiot.
the second conditional branch needs to be inside the first conditional branch, so that it's only executed when the first check is passed. And the result that should only happen when both checks have been confirmed goes into the then-branch of the second, inner conditional branch.

Code:
>conditional branch: weapon in inventory>>conditional branch: armor in inventory>>> this will be done if both conditions are met>>else>>> empty - here would be what happens if weapon but not armor>else>> empty - here would be what happens if NOT weaponend of first conditional branch
Put simply, put the second cond. branch in the first, just above the first's 'Else'. I do this a lot with my transfer event workaround for Lite. (See attached image.)

Now, the added image has a few mistakes, but for all intents and purposes in showing you how to do it, it serves its purpose.

Untitled.png
Ok, I created 2 different events based on Alexander's advice and Andall's advice.

Alexander's Advice:

Event based on Alexander.png

My Feedback:

This event works but seems to go smoothly when I acquire the weapon first because the friend will then say that you have your weapon but now need your armor which makes this a specific response. If I were to acquire the armour first, he would say that the player needs to acquire the equipment which is a general response. The general response is tied to the first conditional branches' Else condition.

What I want to do is create 3 different responses: 1 for when no items are acquired, 1 for when the weapon is acquired and 1 when the armour is acquired.

Andall's Advice:

Event based on Andall.png

My Feedback:

This event doesn't seem to work correctly because after I place the conditional branch [casual clothes] in the [knife]'s conditional branch, during the playtest, the player is told that he still needs his weapon, then, is told that they can't leave until he buys his equipment immediately after. It would've worked fine if he wasn't told that he needs to buy his equipment right after he's told that he still needs his weapon.

It seems as though if I acquire the weapon first, this event progresses smoothly, but if I bought the armour first, it doesn't progress smoothly.
Looking at the second example:

In the ELSE for the knife, you need to add ANOTHER "if player has armor". In the true branch for THAT test, it means the player has armor but not a weapon, so you should mention needing a weapon. In the ELSE branch for that test, it means the player has no weapon OR armor, so you need to tell them they need both.

So it'll be like this:

Code:
If player has weapon  If player has armor    Ready to go beat someone up?    (turn on a self switch, and add a new page conditioned by this self switch that just has the transfer)    Transfer  Else    (player has weapon but no armor)    Show Text: You need armor  EndElse  (player has no weapon)  If player has armor    Show Text: You need a weapon  Else    (player has no weapon OR armor)    Show Text: You need equipment  EndEnd
Ok Shaz that fixed it...thank you very much for your help (including everyone else)!

Tune in next time to solve a noobs problem...
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/issues-with-conditional-branches.22726/