PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
.isStackable

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    PenUltima Online Forum Index -> Feature Suggestions
Display posts from previous:   

Author Message
Bytehawk



Joined: 03 Feb 2006
Posts: 56
Location: Germany, Franconia

PostPosted: Thu Aug 31, 2006 4:23 am    Post subject: .isStackable Reply with quote

Would be a nice little addition if one could find out, if an item is stackable by just checking this r/o member.

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Thu Aug 31, 2006 4:36 am    Post subject: Reply with quote

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:

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 Smile

Author Message
Austin
POL Developer


Joined: 30 Jan 2006
Posts: 354
Location: San Diego, California

PostPosted: Thu Aug 31, 2006 4:50 am    Post subject: Reply with quote

Quote:

[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 );

Author Message
Bytehawk



Joined: 03 Feb 2006
Posts: 56
Location: Germany, Franconia

PostPosted: Thu Aug 31, 2006 9:42 am    Post subject: Reply with quote

*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 Smile
*crawls back into the coder dungeon*

Post new topic   This topic is locked: you cannot edit posts or make replies.    PenUltima Online Forum Index -> Feature Suggestions All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty