Re: Object Stacking

From: George Greer (
Date: 09/05/01

On Wed, 5 Sep 2001, Caniffe wrote:

>Just on the topic of George's object stacking code that's being worked upon
>currently - is the main aim with this solely to either increase speed,
>decrease memory usage, or both?  I'm guessing both?

Neither.  The shop code goes through various contortions to sort the
shopkeeper's inventory so it can present a listing of the various items it
has for sale and the number available.  Also, the duplication of:

  a bread
  a bread
  a bread
  a bread

is hardly considered a positive feature.  So if I can make the shop code
cleaner and keep it compatible with old code, then we get inventory/room
object stacking for "free."

>As such, is there a need to keep all the items in the game if they're all
>identical?  Or, could a new function be added to have one item in the
>game for that character, followed by two variables such as the IDNum of
>the player, and the number of the item a player has?

I suppose you could.  You'd just be changing the view from "the player has
objects" to "the objects have players."  Whether or not that's a better
view I couldn't tell you.  Not all objects are going to stack, such as:
bags, wands, drink containers, staves, etc.

George Greer

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/06/01 PST