Main Menu
  • Welcome to The RPG Maker Resource Kit.

Buying an item from an NPC?

Started by mattyrose2, February 13, 2010, 05:39:14 AM

0 Members and 1 Guest are viewing this topic.

mattyrose2

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!

modern algebra

Just use the open shop window event command on the second page of event commands, first column second row.

mattyrose2

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!

Nessiah

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


mattyrose2

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!)

Sirius

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]

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.

Nessiah

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.


mattyrose2

Thanks Sirius,

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

thanks again.

Roy

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
Insanity is the Emergancy Exit, so smile... It's the only way out alive

mattyrose2

#9
OK thanks its very hard!