Page 1 of 1

Weight of chests (CSBwin)

Posted: Sun Jun 05, 2005 12:58 pm
by Zyx
In CSBwin sources, I found the following code in Mouse.cpp:

Code: Select all

case dbCHEST: 
    {
      totalWeight = 50; // weight of chest itself
      DB9 *pDB9 = GetRecordAddressDB9(item);
      RN objContents = pDB9->contents();
      while (objContents != RNeof)
      {
        totalWeight += GetObjectWeight(objContents);
        objContents = GetDBRecordLink(objContents);

      };
      break;
    };
It seems the weight is hard coded. Could it be possible to put it as a parameter in the dungeon.dat with CSBuild? (by default, 50, of course)

Posted: Sun Jun 05, 2005 4:55 pm
by Paul Stevens
Yes. We can do that.

I just formated my system hard drive and will be
spending a few days recovering all the software and
data. But I added a card to the pile.

Posted: Wed Jun 08, 2005 9:02 am
by beowuuf
Just out of interest are the size of slots and the chest hard-coded too?

Posted: Wed Jun 08, 2005 4:29 pm
by Paul Stevens
size of slots and the chest hard-coded
Not sure what you want to know.

The slots don't have a 'size'. What do you mean?
The number of slots is CERTAINLY hard-coded.

Parse error: 'size of slots hard-coded' and 'chest hard-coded'.
or 'size of slots hard-coded' and 'size of chest hard-coded'

If the latter then do you mean the size of the
slots (measured in what units) and size of chest (measured
in hat units?).

Posted: Wed Jun 08, 2005 4:43 pm
by Gambit37
I'm sorry, I just can't take this thread seriously. Weight of Chests? Size of chest hard-coded? It's really making my mind wander...

Does it show that it's been a while since I've had a girlfriend....?

Posted: Wed Jun 08, 2005 5:13 pm
by beowuuf
Funny, the chest question was making me think about the 'money' chest before I then saw Adamo's post. I would never dream of askign about the number of chest slots - for one thing, graphically and engine wise it owuld certainly be hard coded.

By size I meant the latter, parameter that allows certain items to go in certain places only. The pouch area cannot take large weapons, screamer slices, clothes etc , and the chest slots have a similar size limitation (they can take slices though). This parameter also applies to chests themselves, as you cannot put a chest in a chest in-game, nor put it in your quiver or pouch.

So, just like the giggler attack can be configured to go into more inventory areas than normal, I wondered if the chest can be re-configured to accept anything, or accept only small items. And similarly, if it's parameter could be changed so it could be placed in 'smaller' inventory slots including normal chests.
Personally I was thinking of a money/key box idea before

Posted: Wed Jun 08, 2005 5:43 pm
by Paul Stevens
I think the permitted locations of the items is
in the item descriptions in the 'graphics.dat'.
If anyone strongly disagrees, I can spend some time
determining the exact algorithm. I think it has
nothing to do with 'size'. For example, you cannot
put a Coin on your head, even though it is 'smaller'
that one of the Helmets.

We could probably write a 'generic' DSA that would
move a chest to your backpack. It could be activated
by a spell or pressurepad or whatever. Similarly
to move chests into chests, etc.

Posted: Wed Jun 08, 2005 7:08 pm
by Gambit37
Yes, that stuff's in the graphics.dat -- it's exposed by ADGE and CSBedit.

You were both wise to ignore my comment. It was very childish.

Posted: Wed Jun 08, 2005 7:11 pm
by beowuuf
But you make up for it with your knowledge now : )

Posted: Wed Jun 08, 2005 10:40 pm
by Zyx
Each item in the game has some bits set or cleared determining where they can go (chest, head, pouch, legs, etc).
I don't know if there are unused bits.

Posted: Thu Jun 09, 2005 1:46 am
by Paul Stevens
Hint: see Edit/Global.

CustomGraphicDemo2.zip demonstrates
a 2.5 Kg chest. Still quite a handful.

Posted: Thu Jun 09, 2005 10:18 am
by Zyx
Nice! Thank you!