how to make gold pieces and trade
Cress
11 Apr 2013, 13:43Hi, making a game that requires acquiring wealth.
To do this the player gets gold pieces from doing tasks,killing things,selling items and finding gold pieces.
Most items the player comes across can be sold at various shops dotted around the realm.
So question is:
How do I make Gold pieces so the player can have plenty of them and each item has a value on it.
To explain further some examples:
Player finds a dagger, they decide to sell it at a shop. the shop will pay 1 Gold piece (because its not a very good dagger) so he 'sell dagger' and receives 1 Gold piece.
Player finds 5 gold pieces and he wants to buy some boots with it, he goes to the shop to buy them. so he 'buy boots' and 5 gold is automatically taken from him.
Player receives 10 Gold pieces and decides to stick it in a safe, which can be retrieved at a later time. so he 'put 10 gold in safe'
I had a look at the shopping library short while ago and that looks great for buying stuff but do not know how to make it so you can sell stuff and have a physical representation of money. I have no idea about code so is there a way i can do the above examples without coding?
To do this the player gets gold pieces from doing tasks,killing things,selling items and finding gold pieces.
Most items the player comes across can be sold at various shops dotted around the realm.
So question is:
How do I make Gold pieces so the player can have plenty of them and each item has a value on it.
To explain further some examples:
Player finds a dagger, they decide to sell it at a shop. the shop will pay 1 Gold piece (because its not a very good dagger) so he 'sell dagger' and receives 1 Gold piece.
Player finds 5 gold pieces and he wants to buy some boots with it, he goes to the shop to buy them. so he 'buy boots' and 5 gold is automatically taken from him.
Player receives 10 Gold pieces and decides to stick it in a safe, which can be retrieved at a later time. so he 'put 10 gold in safe'
I had a look at the shopping library short while ago and that looks great for buying stuff but do not know how to make it so you can sell stuff and have a physical representation of money. I have no idea about code so is there a way i can do the above examples without coding?

jaynabonne
11 Apr 2013, 17:02I wouldn't try to have a separate object for each gold piece. I'd just have an attribute on the player (maybe called "gold") which is an integer, and it starts out 0 or whatever initial value you want. You can say they find 3 gold pieces, but all it does is add 3 to player.gold. Similarly, in your shop (however you implement it), each item would have an integer attribute like "cost". And when they purchase the item, you'd just subtract item.cost from player.gold.
I hope I didn't misunderstand your question!
I hope I didn't misunderstand your question!

Sora574
11 Apr 2013, 22:32I kind of just threw this together so it might have a bug or two but...
INSTRUCTIONS:
[list=1][*]Download the file and save it in the same folder as your Quest game[/*:m]
[*]In the editor, expand the 'Advanced' section on the left side of the screen and click 'Included Libraries'[/*:m]
[*]Click 'Add', and then in the dropdown box, select 'MoneyLibrary.aslx'[/*:m]
[*]Save the game, and then click the 'Reload' button that appeared at the top-right[/*:m][/list:o]
After that, to use the money system, go to the 'Script' tab inside of 'game', and add the script 'Enable money' (which is under the new section at the bottom, called 'Money'). Then, go to the 'Money System' tab and change those settings as you want.
After all that is done, just run the script 'Increase money' or 'Decrease money' (also under 'Money') whenever you need it.
Hope that helps.
INSTRUCTIONS:
[list=1][*]Download the file and save it in the same folder as your Quest game[/*:m]
[*]In the editor, expand the 'Advanced' section on the left side of the screen and click 'Included Libraries'[/*:m]
[*]Click 'Add', and then in the dropdown box, select 'MoneyLibrary.aslx'[/*:m]
[*]Save the game, and then click the 'Reload' button that appeared at the top-right[/*:m][/list:o]
After that, to use the money system, go to the 'Script' tab inside of 'game', and add the script 'Enable money' (which is under the new section at the bottom, called 'Money'). Then, go to the 'Money System' tab and change those settings as you want.
After all that is done, just run the script 'Increase money' or 'Decrease money' (also under 'Money') whenever you need it.
Hope that helps.
Cress
12 Apr 2013, 11:10Thank you Jaynabonne and Sora574, both answers are exactly what I needed. Experimenting with both of them right now 
