.isStackable

Archive of the older Feature Request Forum Posts
Locked
Bytehawk
Apprentice Poster
Posts: 56
Joined: Fri Feb 03, 2006 2:25 am

.isStackable

Post by Bytehawk »

Would be a nice little addition if one could find out, if an item is stackable by just checking this r/o member.
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm

Post by MuadDib »

Read tiles.cfg, find the graphic entry for the objtype, and read the UOFlags prop. Below is the flag byte for the item having stacking properties:

0x00000800 Generic/Stackable

Examples below of a tiles.cfg entry of stackable items:

Code: Select all

tile 0xf86
{
    Desc Mandrake Root%s%
    UoFlags 0x00000801
    Height 1
    Weight 0
    Stackable 1
    Movable 1
}

tile 0xf87
{
    Desc Eye%s% of Newt
    UoFlags 0x00000801
    Height 1
    Weight 1
    Stackable 1
    Movable 1
}

tile 0xf88
{
    Desc Nightshade
    UoFlags 0x00000801
    Layer 1
    Height 1
    Weight 0
    Stackable 1
    Movable 1
}

tile 0xf89
{
    Desc Obsidian
    UoFlags 0x00000801
    Height 1
    Weight 1
    Stackable 1
    Movable 1
}
Check the bit for stackable, to see if it is stackable or not, and there ya go :)
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

[01:37] <MuadDib> why do i feel like i messed up, telling someone to check the UOFlag bit for stackable, in tiles.cfg, to see if an item is stackable or not :/
Heh!!!

Okay two methods.
You've read in ::tiles

var tiles_cfg := ReadConfigFile("::tiles");

You get the elem of the tile you want info for, using the graphic number.

var tile_elem := tiles_cfg[object.graphic];

You can do two things.

return tile_elem.Stackable;
or
return ( 0x800 & tile_elem.UoFlags );
Bytehawk
Apprentice Poster
Posts: 56
Joined: Fri Feb 03, 2006 2:25 am

Post by Bytehawk »

*bites his tongue*
I was a bit overhasty on this. Please take my apologies.
I'm still working with 095 and was missing that possibilty there and thought I'd suggest it for a future release.

I won't suggest anything again before I looked deeper into 096/097, I swear. Sorry again :)
*crawls back into the coder dungeon*
Locked