Re: [Code][Long] Coins Snippet -> thoughts about it.

From: Russ Brown (russelltbrown@netzero.net)
Date: 06/15/00


Hey Everyone,

This is my first post to the list since I have only been subscribed for
about 3 days.
I thought I would just lurk for a while to start with, but since I just
finished coding a
new money system into my mud I thought I would jump in....

<snip, snip>
>
>-- ANYWAYS --
>I have yet to read through the rest, but what are other peoples thoughts
>about NOT making the structure of the player (char_data) hold the coins
>info, but coins are of an OBJ TYPE?


I have not  read the snippet you refer to but I did consider making money
into objects that would be carried in inventory.  I rejected the idea for
several reasons
several of which you mentioned (ie long inventory lists, minimum weight
of one lbs per coin, large rent files, etc).  There is another you didn't
mention:
the fact that there is a limit to the number of items you can hold in your
inventory.
Good luck holding 1000 of anything (unless you add an exception for coins
in do_grab).


>But i could be mistaken and proven wrong.  It does restrict money to 4
types
>(v0->v3) or does it????

I opted for three types of money: copper, silver and gold. That are stored
as ints in
the character data.  Remember that there is an OBJ TYPE of Money that is a
stack of coins.  Normally it is used for piles of coins found in chests or
when you drop
money on the ground.  In stock circle, type Money uses v0 as #of coins and
the other
three are unused.  I simply changed v1 to be the type of coin (0=copper,
1=silver, 2=gold)
Using this method, you can have as many different money types as you need.
It occurs to me that you could just use type money in the inventory and
change the code
so that when a char picks up money, instead of destroying the obj and adding
the
money to the total, just combine all the piles of money with any others of
the same type.
That would eliminate the problems of mulitple coins in the iventory and rent
files.
Typing inventory would just list one "pile" of each coin type carried by the
char.
You could also make the coins have weight: each time two piles are combined,
set the weight of the pile to 1/10 of the #coins in the pile!

The one thing I still have to program into my money system is weight for the
money,
even though my money is not actually objects, a few lines in the function
that calculates
the weight carried will just add 1 lbs for every 10 coins that character has
to the total
weight carried.


I hope this Helps!

Russ Brown
aka Walker of Mosaic

_____________________________________________
NetZero - Defenders of the Free World
Click here for FREE Internet Access and Email
http://www.netzero.net/download/index.html


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT