Item handover question

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
162
Reaction score
59
First Language
English
Primarily Uses
Not sure how to word this as a title but I can describe it a bit more.

What's happening is that the player has to go out and get 1 of 3 items; A, B, and C. The player then returns to an NPC and takes the item, stores if it's Neutral, Good or Bad result.

The problem I'm having is that i can't figure out a way for the NPC to take all 'possible' items and check which one is which. Instead I have to feed the NPC the right item with a choice interface like so
question.png

Of course the game checks and kicks you back to the start of the dialogue if you try to give him an item you don't have. I just wonder if there's an easy or smoother way to do this.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,949
Reaction score
13,585
First Language
English
Primarily Uses
RMMV
Try the Select Item command, which will put the item id into the variable you specify.
 

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
162
Reaction score
59
First Language
English
Primarily Uses
Try the Select Item command, which will put the item id into the variable you specify.
No I hadn't tried that, and... that might work but I'm unsure how to actually word it to account for the 2 variables I'm working with(Good or Bad).

Basically, how do I check to see not that they handed over an item, but handed over a Good or bad item. Or how do I apply the fact it's a good or bad item after the fact?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,949
Reaction score
13,585
First Language
English
Primarily Uses
RMMV
How do you define a "good" or "bad" item?

If your item ids are 1, 2, and 3, and you use the Select Item command, the variable you specify will be set to 1, 2 or 3. You then do conditional branches to see which item was handed over, and take action accordingly (which will include whatever you want to happen based on whether the item was good or bad, and maybe you want to remove the item from inventory too, if you're giving it to the NPC).
 

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
162
Reaction score
59
First Language
English
Primarily Uses
How do you define a "good" or "bad" item?

If your item ids are 1, 2, and 3, and you use the Select Item command, the variable you specify will be set to 1, 2 or 3. You then do conditional branches to see which item was handed over, and take action accordingly (which will include whatever you want to happen based on whether the item was good or bad, and maybe you want to remove the item from inventory too, if you're giving it to the NPC).
Is that how the command works? I might be able to do that then.

>Select Item - Hand over Item 1 2 or 3
>Conditional Branch coded to "Handed Over Item Variable". So if it equals 1, the game realizes "Oh item one was handed over" and does things as normal.

I jsut need to make sure the variable is equal to whatever number the item was. So if my items are 35. 36. 37; i need to set up the conditionals to check for 35, 36, and 37.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,949
Reaction score
13,585
First Language
English
Primarily Uses
RMMV
Yes, that's exactly how it works.

The one downside is that it'll let them choose ANY item, so you also have to cater for "what if they hand over bread?" So it'd be nested conditional branches with the three valid options, then a final Else for everything else (which wouldn't remove the item from inventory and might just show a message).

Or you could set them to be Key Items - either A or B, and in the Select Item command, choose Key Item as the type to show, then it'll only let them choose from anything marked as a key item.
 

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
162
Reaction score
59
First Language
English
Primarily Uses
Yes, that's exactly how it works.

The one downside is that it'll let them choose ANY item, so you also have to cater for "what if they hand over bread?" So it'd be nested conditional branches with the three valid options, then a final Else for everything else (which wouldn't remove the item from inventory and might just show a message).

Or you could set them to be Key Items - either A or B, and in the Select Item command, choose Key Item as the type to show, then it'll only let them choose from anything marked as a key item.
I did plan on switching it to Key Items and planned on rigging it to where hopefully those are the only items possible to turn over. Not entirely possible all the time but we'll see.

So it would be 3 conditionals with an Else statement. Checks the ID number of the item and does X. If they don't match, do the Else path which is "You stupid dog, you made me look bad" aka Wrong item.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I am happy because the RPG Maker MZ character comes with extra bust and full body art, but I am disappointed because the quality of the character's PIxel art has decreased.
Only My Opinion that Pixel art MV is better.
I think my SV will be weird, but I would love to change it up.

"Signature characters" - the mascots of your game. Cute, quirky, lovable, recognizable.
i.e.
Kirby, Disgaea prinnies, creepers, Sonic, Mario, DQ slimes, pikachu (all starters), chocobos.

You see what I'm saying.
Getchu one.
Made a video showcasing a plugin that changes the animation rate for animated tiles in our games.

(Plugin by Caethyril )
I guess if you're just going solo dev, minimize features is better choice.

Forum statistics

Threads
103,220
Messages
998,097
Members
134,701
Latest member
healthbeauty
Top