Giving NPC Items That They Love or Hate

I hate asking for help again, but blame the jam! 😛

I have a section in my game that goes like this: NPC asks Player for certain items > Player obtains items in back of shop > Player gives NPC items. If the items were the correct ones, then Player gets points, but if they were the wrong ones, Player loses points and NPC walks away.

Using the method of obtaining items and selecting them works just fine, but I can't figure out how to make the NPC mad for getting the wrong items. I tried looking over other written tutorials or threads about this. Perhaps I can't wrap my head around this. (Eventing was never my strong suit lol).

Customer1_Ev3.png

This is the event that works just fine. However, I'm not sure how or where to add the negative consequence?

Thanks! <3
YOu would add it in the if check. So it would be something like if Item given == 60 and they hate whatever item 60 is, you put all the stuff there.
I think what bg is tryna say is that you need an else condition. If bread == 22 cool, else not cool.
Untitled.png
A few more added comments:

1) you misunderstood how select item works.

You have ONE variable, something named "selected_item" or so.
Then you check the results in conditional branches one after another:
if selected_item == 20 (ID of bread) then
if selected item == 22 (ID of salt) then

and so on.
You don't use dozens of select item commands, but only one of them.

2) as said above you have to check for anything else.
that can be by one conditional branch for every ID
or it could be that after checking every good item and using exit event processing to skip in those cases) you make an angry answer if nothing fits.
or you could activate the else-branch and give the answer there

it all depends on how many different items you have that are good and how many are bad.
I did understand the else branch, but I guess I didn't get WHERE. o.o
A few more added comments:

1) you misunderstood how select item works.

You have ONE variable, something named "selected_item" or so.
Then you check the results in conditional branches one after another:
if selected_item == 20 (ID of bread) then
if selected item == 22 (ID of salt) then

and so on.
You don't use dozens of select item commands, but only one of them.

2) as said above you have to check for anything else.
that can be by one conditional branch for every ID
or it could be that after checking every good item and using exit event processing to skip in those cases) you make an angry answer if nothing fits.
or you could activate the else-branch and give the answer there

it all depends on how many different items you have that are good and how many are bad.
Thank you for explaining how select item works in detail! This knowledge actually gave me what I needed to figure it all out!!

You are all awesome! <3
Actualy for select item as you want it, you would do a bunch of ifs, no elses. This is because you may want to give 3+ items and they may like 2 and hate 1.

Doing an if/else would make it that anything BUT the item they want gets the dislike reaction (and they also would do it if you cancel out and give nothing due to how it checks the variable), which is not quite the same thing. But as a straight if then they only react to the disliked item.
I would declare a control variable as an array of the item ids the person wants, e.g.

Control variable 10 wantedItemPool = [5, 8, 12];

Then use array.includes to check whatever variable number is holding your Select Item, let's say 1, e.g.

If: $gameVariables.value(10).includes($gameVariables.value(1))

The implementation is going to depend on how many items are in the pool of what the person wants, whether you can give them more than one of the same item, or they want only one of each item in the pool, etc.
The array solution would work better too! Tricker to implement.

I just wish RPGMaker did case.
You can do (switch) case in RPG Maker, one of my common events looks like this
1744475313147.png

But I don't know why you would use it in this situation over the array unless you wanted, for example, the NPC to have different reactions to a bunch of different items given to them.
Which in my case I actually do. Hmmmm.....

But we have deviated too. I hope these extra ideas help the OP.
Oh, yup, Andar's explanation helped me finish the event. 😀 Forgot to hit solve. 😛

Original thread: https://forums.rpgmakerweb.com/threads/giving-npc-items-that-they-love-or-hate.176897/