Exchanging items for a party member

I'm working on a game where you can exchange certain items for different monsters to join your party. I managed to do it (kind of) by using conditional branch> if player has 1 Fire Scroll> Fire Deamon joins the party.

The problem is that, that way, you can only exchange 1 item for a monster, while I need it to be more like:
If player has 20 Fire Scrolls> Fire Deamon joins the party

I'm new to RPG Maker and I have no idea how to do it.
Use control variables to get the number of items in inventory, then use conditional branch on the variable.
EDIT: Ok, I realised I didn't turn on the conditions. That solves everything, thank you for your help!


Alright, so I managed to make an NPC that gives +1 Bat Wing variable each time you talk to him, and then I can exchange it for a Bat Monster with another NPC.

But I can't seem to be able to make Bat Troops to drop Bat Wings Variables?

I made bat troops to add +2 variable:
y14DjMN.png


And then made an NPC that trades bat wings for a Bat:

h8uHxz1.png


What am I doing wrong?
Actually what Andar was suggesting is much more simple.
Taking your example, on your exchange NPC do :
- Variable 4 = Number of bat wings (select game data, item bat wings)
- if variable 4 = 3
...
So you don't need to bother feeding your variable 4 everywhere, just when checking with the npc.
And if you're doing that with the troops to get bat wings from a battle, you want to use the Enemies tab instead, and make it so that the Bat enemy drops bat wings.
@Qwilfish and the reason why your troop event didn't work is because you told it to never work: "don't run" means "never executed this event", that running is a Computer term that has nothing to do with escaping.
Actually what Andar was suggesting is much more simple.
Taking your example, on your exchange NPC do :
- Variable 4 = Number of bat wings (select game data, item bat wings)
- if variable 4 = 3
...
So you don't need to bother feeding your variable 4 everywhere, just when checking with the npc.

I tried it again but I can't understand what am I supposed to do, I end up with the same thing all the time 🙁

vSu34eO.png



@mlogan
That's what I was trying to do from the beginning, but I couldn't figure out how xD

@Andar Yeah, I figured it out after I posted it, thanks!
@Qwilfish you check for exactly 3 bat wings, which means the conditional branch will not only fail with less than 3, it will also fail if the player has four or more bat wings.
You control the item drop on the Enemies tab, like this:

batwing.png


And as Andar said, change your batwings check to > or equal to; it looks like the > with a line under it.

Original thread: https://forums.rpgmakerweb.com/threads/exchanging-items-for-a-party-member.93779/