The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: mattyrose2 on February 13, 2010, 05:39:14 AM

Title: Buying an item from an NPC?
Post by: mattyrose2 on February 13, 2010, 05:39:14 AM
I have an NPC who when you talk to them i want them to offer an item to sell to you any help?
also i want the computer to ask whether or not i want it and have a yes or no choice! thanks!
Title: Re: Buying an item from an NPC?
Post by: modern algebra on February 13, 2010, 02:08:27 PM
Just use the open shop window event command on the second page of event commands, first column second row.
Title: Re: Buying an item from an NPC?
Post by: mattyrose2 on February 14, 2010, 04:32:41 AM
thanks for that now i know how to do that but that wasn't what i wanted!

what i wanted was to be able to make the NPC offer him something to buy just once and when its bought you cant buy it again! thanks!
Title: Re: Buying an item from an NPC?
Post by: Nessiah on February 14, 2010, 10:02:29 AM
What you can do is  make a switch :)

So the code will be like

If Switch Already Bought is on
Shop Menu without those items
else
Shop Menu with that one item
  If hero has item possessed
    Switch Already bought is on.
end
end
Title: Re: Buying an item from an NPC?
Post by: mattyrose2 on February 15, 2010, 04:52:14 AM
OK thats confusing is there anyway you could simplify it? also i think your getting at the same point as..........? the other guy who posted before you.

What i need is an NPC to say:

message: hi woulds you like to buy a club/sword/whatever

Then: yes/no options come up (not really sure how to use them!)

After you have bought the item it stops selling the item (i think you use a switch to turn on a variable, correct?)

Or if you say no then it closes and you can come back later.

Or if you say yes but don't have enough money a message comes up saying you don't have enough money to buy that or: haha you don't have enough money you can %$#@ off! (lol not really!)
Title: Re: Buying an item from an NPC?
Post by: Sirius on February 15, 2010, 06:06:21 AM
Okay, since I figured it would be easier to show the finished product rather than a cryptic text walkthrough, here's one way you can make that specific event:

[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg694.imageshack.us%2Fimg694%2F4736%2Fshopman.jpg&hash=1dc76badd23c8429b2b66013cf32cf5b4d621ccc)

You could make that first conditional branch the precondition switch instead, but it really doesn't matter.[/spoiler]

This is, of course, assuming this person is only selling this one rare piece of equipment. If you want to know how to do something like this in tandem with a regular shop, just ask. It requires one more little event; nothing big.
Title: Re: Buying an item from an NPC?
Post by: Nessiah on February 15, 2010, 11:56:18 AM
That's what I said! Well this was just me assuming you know Fork/Conditional Branches already know and the show message system and shop system and switches or even just looking at them in the event editor :|

ah well~ Next time I'll dumbify/simplify my posts.
Title: Re: Buying an item from an NPC?
Post by: mattyrose2 on February 16, 2010, 05:10:35 AM
Thanks Sirius,

um, the branches and else handler options, how do they work please?

thanks again.
Title: Re: Buying an item from an NPC?
Post by: Roy on February 17, 2010, 02:58:44 AM
You find and push the conditional branch button

event commands > page 3 > conditional branch

it will ask you for a condition, really it's just asking if (what ever you select) = true or false

then you put in what you want it to do if true in the top aria, and what to do if false under the else handler

fiddle with it, you'll work it out
Title: Re: Buying an item from an NPC?
Post by: mattyrose2 on February 17, 2010, 04:37:28 AM
OK thanks its very hard!