here's a link/guide about using attributes:
viewtopic.php?f=18&t=5559and near the bottom of the first post of mine in the link above is this, on how to use transactions (such as currency):
(if you want to do more complex stuff, than using Objects is good/neccessary, but for simple stuff, don't use Objects, just use Attributes)
HK wrote:anyways, finally about your question, conceptually about Attribute usage:
you're used to using and thinking in terms of Object (physical thing) usage, but these are very unweildy, such as:
imagine having actual individual 'silver and gold coins' Objects for your currency~transactions, the sheer quantity of them + having to move them around .. YUCK !!!!
INSTEAD, you want to use Attributes!
Your Objects have Attributes, which you can simply adjust, no moving of actual physical things around, nor in having those physical things. Attributes are awesome! see below, using the currency~transactions example (in code):
we're only moving the 'sword' Object around, no 'gold coins' and 'silver coins' extra Objects being moved around
shop_owner.cash = 500
player.cash = 100
sword.price = 50
Buying:
sword.parent = shop_owner
player.cash = player.cash - sword.price
shop_owner.cash = shop_owner.cash + sword.price
sword.parent = player
Selling:
sword.parent = player
player.cash = player.cash + (sword.price / 2)
shop_owner.cash = shop_owner.cash - (sword.price / 2)
sword.parent = shop_owner
*note: this should require 'if' scripting to check if you have enough 'cash' to buy the sword and the shop owner to buy the sword, of course, which I've left out, obviously.