RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Buying an item from an NPC?

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 82
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!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Best Use Of Avatar And Signature Space2010 Favourite Staff Member
Just use the open shop window event command on the second page of event commands, first column second row.

**
Rep: +0/-0Level 82
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!

*****
Rep:
Level 85
I am the wood of my broom
2010 Project of the YearProject of the Month winner for January 2010Project of the Month winner for January 2009Project of the Month winner for April 2010
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


**
Rep: +0/-0Level 82
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!)

***
Rep:
Level 86
Sonic Dog -> Light Spear -> Overlimit -> Slash
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 for:


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

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.

*****
Rep:
Level 85
I am the wood of my broom
2010 Project of the YearProject of the Month winner for January 2010Project of the Month winner for January 2009Project of the Month winner for April 2010
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.


**
Rep: +0/-0Level 82
Thanks Sirius,

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

thanks again.

pokeball RoyOfflineMale
**
Rep:
Level 82
My insanity keeps me sane
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

**
Rep: +0/-0Level 82
OK thanks its very hard!
« Last Edit: February 17, 2010, 05:27:10 AM by mattyrose2 »