PenUltima Online

It is currently Fri Sep 05, 2008 6:06 am

All times are UTC - 8 hours




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: .isStackable
PostPosted: Thu Aug 31, 2006 12:23 am 
Offline
User avatar

Joined: Fri Feb 03, 2006 2:25 am
Posts: 56
Location: Germany, Franconia
Would be a nice little addition if one could find out, if an item is stackable by just checking this r/o member.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 12:36 am 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
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 :)

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 12:50 am 
Offline
POL Developer
User avatar

Joined: Wed Jan 25, 2006 2:30 am
Posts: 405
Location: San Diego, California
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 );

_________________
-Austin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 5:42 am 
Offline
User avatar

Joined: Fri Feb 03, 2006 2:25 am
Posts: 56
Location: Germany, Franconia
*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*

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl