[crossfire] Banking system

Mark Wedel mwedel at sonic.net
Sun Dec 25 00:37:55 CST 2005


Anton Oussik wrote:
> On 24/12/05, Mark Wedel <mwedel at sonic.net> wrote:
>>   At some level, it becomes a question of why not just make money a 'stat'.
>> Instead of gold pieces, silver, platinum, etc, floating in your inventory,
>> something just says you have 123456 gold pieces.
> 
>>   All this starts to get away from the discussion at hand, but is food for thought
> 
> No, it is very much on topic - the main issue here is to avoid the
> need to have large piles of money lying about in apartments and having
> to carry more than your own weight in platinum in order to go outside
> to the shop (perhaps the subject is misnamed though ;-) ).
> 
> Your idea seems more sensible. Perhaps make all players carry a
> special wallet/money pouch item, which is a container into which money
> automatically go and become weightless (or near enough so), which will
> say "you have foo gold" when clicked, and from which you can drop
> money?
> 
> This could also be implemented as a property and interfaced by adding
> new server commands and adding a UI pouch... but that is for version 2
> of CrossFire.

  As said, this wouldn't be really hard.

  Add a uint64 field to the player object.

  Modify the pickup code to check item type being picked up.  if type == MONEY, 
add it to that stat, a don't insert it (this could actually be done in the 
insert_ob_in_ob for that matter to make sure all cases are caught).

  For new clients, add a mechanism for server to tell client this value - 
probably via stats command makes the most sense.  For these new clients, it is 
then up to them how they should display that (could just be next to exp or 
something).

  For older clients, or maybe all clients until altars and the like are somehow 
fixed up, the server would fake inventory items for the coins.  For simplicity, 
probably only fake gold pieces (I don't think anything actually requires silver 
or platinum, and faking only 1 object instead of 3, makes sense).

  When player tries to drop some gold, the server would catch it is a fake 
object, and convert the objects into a pile of gold and insert it into the map. 
  Covers those altars, tables, etc.  Also, allows players to trade gold easily.

  For these fake objects, the draw_look function of previous/next object in 
large stacks could be used - basically set the high bit on the object tag, and 
drop and examine would catch this special tag and do the right thing.

  It actually isn't that hard to do, and probably a good thing to do.

  The biggest issue is making sure it works - having a bug and wiping out 
peoples gold would be a pain.

  the only real oddity is the weight values - that 'stat' of gold would 
basically be weightless (or presumably a much lower weight than currently in place).

  That said, it would seem an easy fix right now is just change the current 
weight of coins - the weight is currently 10 - it could be reduced to 1, and 
increase carrying capacity tenfold.




More information about the crossfire mailing list