Item handover question

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
149
Reaction score
57
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,930
Reaction score
13,567
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
149
Reaction score
57
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,930
Reaction score
13,567
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
149
Reaction score
57
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,930
Reaction score
13,567
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
149
Reaction score
57
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

Recent threads, and my very poor algorithm for my minimap plugin have made me face the fact that I need to review algorithms and such.

Going through Cracking the Coding Interview now. I am so excited.
Kes
I've seen a reference to a Community Lighting plugin for MZ, but cannot find it. Is it still in beta?

Todo:
Add fog of war
Add enemy indicators
Make window draggable
Optimise map drawing algorithm (5 seconds to load the map you see, so it's a... poo-poo algorithm)

Any suggestions? :kaoblush:
bleh studio hell job haha at least they like it didnt had time to do much laundry tho ;w;'....YES I DO AT LEAST TAKE A SHOWER everyday!
Ami
--- Food Ingredients ---

Hero: Since the Chef are in Hospital,we can't eat his Dish in 3 Days.
F.Mage: What we have to Eat?
M.Healer: Don't worry,we can Eat the Food Ingredients.
Hero & F.Mage
: Really?

(3 Days Later)

Chef: Hi,Guys. I'm Ba---
(Entire Party Collapse After Eat Raw Meat)
Chef: Wha...WHAT GOING ON HERE!!!!!!

Forum statistics

Threads
102,913
Messages
995,919
Members
134,363
Latest member
Wilsonliz
Top