Main Menu
  • Welcome to The RPG Maker Resource Kit.

Varying shop prices

Started by haloOfTheSun, January 23, 2006, 11:56:26 PM

0 Members and 2 Guests are viewing this topic.

haloOfTheSun

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:

blueXx

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!

Ragingflamez

cant we just make another item taht is exactly the same ???

Dwarra?

I might just have to kill you, your knowledge is to great!
good tut guys now i must implement!
<was that the right word?

blueXx

Quote from: Ragingflamezcant 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!