Re: [CODE] item loading/limits?

From: John Evans (evansj@HI-LINE.NET)
Date: 04/02/98

On Thu, 2 Apr 1998, Raven Jade Kenago wrote:

> Okay, well, I set up some code in db.c to make it so
> I could specify items in a "set" for the zonefile,
> and make it so it rolls a % chance for each one to load. Simple
> enough. But I got to thinking, I haven't
> tested this yet, but when you specify an item limit for an item, does
> it take into account all items possessed by players, or simply all in
> the game at that moment in time?

Stock code checks for items in the game, but not in the rentfile upon
bootup. This means that when the game reboots, all num_existing numbers
are reset to 0.

If you'll search through the mailing list archive for "count_objects" you
will discover a post about how to make the game count everything in the
rentfile upon game boot.

> in my mud universe. I figure I could simply move the max exist from
> the zonefile to the item file, and have the database check against
> that, so that isn't so big of a deal. However, I need some way to keep
> track of every item that has loaded and how many exist. Does circle by
> some miracle already take care of this? Or if not (I'm thinking it
> doesn't, it would make my life easy if it did), anyone have a
> convenient way to track how many items of a certain vnum exist in the
> world on all players for purposes of checking loads?

Circle already tracks when an object is loaded and extracted and updates
the proper variable in obj_index.

I moved the max existing variable for mobs and objs from the zone data
(which IMHO is an unweildy place for it) to the obj/mob data and it works
VERY well. While I was doing that, I also implemented some percentage load
code for objs. I've seen some talk around here about a percentage load
patch, but I've never looked at it so I can't vouch for its quality. You
may want to look at it and see what you think.

One other thing. I did not make it possible to make a mob's max existing
to be "Unlimited", but if an obj's max existing is set to ZERO, then the
game interprets that as Unlimited and there can be in infinite number in
the rentfile and in the game. This allowed me to make about three hundred
objects that were to be used as generic items. These generic items are
non-magical armors, weapons, containers, food, drinks, etc. that anyone
can use in any zone.

John Evans <>  --

Any sufficiently advanced technology is indistinguishable from magic.
--Arthur C. Clarke

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST