Re: Objects in Objects

From: Akuma/Chris Baggett/DOOMer (doomer@BAYOU.COM)
Date: 10/10/97

heh, all i did was figure out how to ascii-fy the current objsave
and autoeq seemed to work fine, of course it took a LOT
of debugging, and a special way of reading in the obj_save files :-P

course, it's kinda hard to work out, but it was worth it.
now i have restring working, and i've created vehicles
from bugs (item 0) :-P
pretty kewl.

good luck :-P

Code On
Akuma the Raging Coder

At 06:22 PM 10/10/97 -0800, you wrote:
>On Friday, October 10, 1997 12:48 AM, Soren P. Skou [SMTP:serces@MUD.DK]
>> Hi all..
>> I've tried tracking down the error. But it doesn't seem like there is
>> anything wrong. 'Cept maybe, I took a good look at the Rentfiles, and
>> what location the different EQ's was saved at. And as far as I can
>> see, then Objects saved from Inventory has Location 0, regardless of
>> if they are in another object or not. Dunno, maybe I'm reading the
>> code wrong or something, but I've got the impression that EQ coming
>> from a bag, will have a negative number, corresponding to the
>> container they are in, or am I totally looney here????
>Why not just write an ascii based object save/load routine?
>Here's how I did it.
>Objects in Inventory are at level 0
>Objects in a bag are at successively increasing numbers based on how
>many bags deep you are currently processing.
>Use a routine to scan inventory, saving each obj. When a bag is encountered,
>save it, then increment the count var and start looking in the bag. When you
>are done with the bag's contents, decrement the counter var and continue
>with the inventory scan. Repeat this process for worn equipment and put
>a marker in the file so you know when inventory stops and eq begins.
>If you save the object flags, the values, weight and text strings (if
>from the prototype) you will have a pretty good system to handle your
>rent files.
>Loading is even easier. Just keep an array of object pointers to store the
>bags at each level. WHen you increment the counter var you store a new
>object in the array. When you decrement it, you take the new highest object
>and start using it as the new 'container' for loaded objects.
>It's also portable to just about any system. No binary files to worry about.
> 0 bread
> 0 barrel
> 0 bag
> 1     wand
> 1     staff
> 1     bag
> 2        cookie
> 2        flask
>I can picture in my mind a world without war, a world without hate.
>And I can picture us attacking that world, because they'd never
>expect it.     - Jack Handey
>     +------------------------------------------------------------+
>     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>     | |
>     +------------------------------------------------------------+
  | "The poets talk about love, but what I talk about is DOOM, |
  |      because in the end, DOOM is all that counts." -       |
  |   Alex Machine/George Stark/Stephen King, The Dark Half    |
  |        "Nothing is IMPOSSIBLE, Just IMPROBABLE"            |
  |   "Easier Said Than Done, But Better Done Than Said..."    |

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

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