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.
Varying shop prices

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
Definitely better than Hitler.
2014 Best IRC Chatterbox2014 Best Musician2013 King of RMRK2013 Best Musician2013 Best Use of Avatar and Signature Space2013 Funniest MemberFor the great victory in the Breakfast War.2012 Best Username2012 Best MusicianFor frequent good quality Wiki writing [citation needed]2011 Funniest Member2011 Best MusicianMost entertaining member on the IRC2010 Most Missed Member
I was thinking last night on a new feature to implement into games, that I haven't seen yet. After a while I realized that in these games, all the items are the same price in all the shops, but that's not very realistic, now is it? So, I figured it would be cool to find a way to vary the prices, so that maybe you could have two shops in a town, where maybe Potions are cheaper at the Potion Store rather than say... the General Store. This way, it gives a nice new feature to your game that everyone will be like "oooo that's neat" and where the player also has to shop smart.

So here's how I figured out how to do this. (This is made specifically on 2003, although it is not hard at all to do it on any version. Just some of the names of things are different.) Let's start a test project. Open up your database and go to the items. Let's make two items now; we'll call them Potion, and Potion (Expensive). In your real game, they'll both be named the same, but for purposes of this tut, that's what we'll call them. Give both of them the exact same description; everything exactly the same EXCEPT the price. Let's make the regular Potion cost 50, and the expensive cost 100. Ok, now let's make a shop event. The first thing we'll do is to make a variable operation. Let's name the variable Potions Cheap, and set it to "Item" and the "Number Held" of the regular Potions. Now do the same thing with the Expensive Potions, only changing the variable to Potions Expensive, and the number of expensive potions. Now we're going to say this is the shop that sells cheap potions, so let's make an Item Management command and Remove 99 Potions and another remove 99 Potions (Expensive). Why do we do this? I'll tell you:

Since this shop sells cheaper potions, that means we have to be able to sell the potions at a price comparative to the price we can buy them. If we try to sell the expensive potions here, we can sell them for 50, but also buy potions for 50. It doesn't work like that in real life, so we "switch" potions. The player will never know we did this, and it will seem like you're an event master, or something. We also do this so you don't have the same item taking up two slots in the Item menu.

So far the event should look like this:

<>Variable Oper [0001: Potions Cheap] Set, Potion possessed
<>Variable Oper [0002: Potions Expensive] Set, Potion (Expensive) possessed
<>Change Items: Potion 99 Remove
<>Change Items: Potion (Expensive) 99 Remvoe

Ok, now we have to give back the amount of potions they had, which ensures they have the cheap potions, since this is our cheap shop. So make another Item Management command and make it add Potions, and the number is the Amount Stored In 0001: Potions Cheap. This is why we have the variables.

Now, just make a Open Shop Window command, and there you go. So our event looks like this now:

<>Variable Oper [0001: Potions Cheap] Set, Potion possessed
<>Variable Oper [0002: Potions Expensive] Set, Potion (Expensive) possessed
<>Change Items: Potion 99 Remove
<>Change Items: Potion (Expensive) 99 Remvoe
<>Change Items: Potion V[0001] Add
<>Open Shop: Potion

Of course making the shop that sells expensive potions is just as easy, just make sure to substitiute the proper things where they go. And you can also do this with any item, just make sure you do it the same way. The drawback is that you have to have a variable for each item you want to have varying in price, and you have to do a lot more event work each time you have a shop if you want to have lots of items varying in price.

But, I'm sure someone here who is good with events may be able to improve upon this, or even explain it better, or more likely tell me what I did wrong. But hey, I'm not great with events so I was pretty proud of myself. Anyway, I hoped this helped, and I hoped this made sense.
:tinysmile:

******
Rep:
Level 91
hmm there is not much room for improvement, good thinking halo though you can easily save variables

say you have 2 shops
1 that have potion (expensive one but we ain't going to tell the player ><) and one that sell normal priced potion

well we bought them we are happy now what?

making a parallel process that looks like that:

potion(variable)=potions possessed
if item(expensive potion) is possessed then
-if potion(variable) < 99 then
--remove expensive potion
--add normal potion
-else
--potion(variable) = expensive potions possessed
--remove 99 expensive potions
--moneyomg(variable) = potion(variable)
--moneyomg(Variable) * 100(price of an expensive potion)
--message: "you had more than 99 potions, shame on you.. don't you know this game is limited? you have been refunded \v[moneyomg]
--add money + moneyomg(variable)

or you can leave it at max 198 potions if you feel like it, you can also make variables to change the potion type every time you get one resulting in having the option to have say 990 max potions (10 diffrent items)
and also resulting in hard work Xx
holy shit my sig was big!

**
Rep: +0/-0Level 89
cant we just make another item taht is exactly the same ???

*
Rep:
Level 97
Secret Santa 2013 ParticipantSecret Santa 2012 Participant2011 Most Successful Troll
I might just have to kill you, your knowledge is to great!
 good tut guys now i must implement!
<was that the right word?

******
Rep:
Level 91
Quote from: Ragingflamez
cant we just make another item taht is exactly the same ???


that's the bottom line.. we just make it so that it will fuse into 1 item and sell for as low as the lower priced is sold for.. making it a bit more realistic
holy shit my sig was big!