Shops and vending machines

Started by , Sat 10/07/2004 21:16:21

Previous topic - Next topic

Blane_

In my game, I wanted to have Shops. Very easy, I know, place a few items, check to see if you have enough points and/or money, and then give the player that item. But what I DON'T know how to do is sell stuff, AND give the player a different amount of points for each item sold.
HELP?

Goot

You want the player to sell stuff to the shop? How exactly do you want them to do it?

TerranRich

Does this help? http://bfaq.terran-x.com/#guis04

I know it's very brief and short, but you can use an inventory item for the money (like Space Quest IV did).

OR, you could use a separate variable (like a globalint) for the money and display it seperately using status bar labels.
Use of GlobalInts: http://bfaq.terran-x.com/#coding09
Use of Status Bar: http://bfaq.terran-x.com/#guis05

:)
Status: Trying to come up with some ideas...

Blane_

   Basically, your points run as money. Therefore buying decreases points, which is easy enough. I need a good way to sell stuff to the shop. The problem is getting different amounts of money for each item. It is really hard to go through EVERY game item and set a price.
Is there an easier way???

TerranRich

What? So you want a different price for every item? Use variables. Look it up in the manual and the BFAQ.
Status: Trying to come up with some ideas...

Ashen

Are you talking about buying and selling inventory items? If so, you could create a custom property for each item to set its price, then use something like:

GiveScore (GetInvProperty(player.activeinv, "Price"));

You still have to set the property for every item, but it will save you having to write a different line of script for them.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk