quite a while ago, but i was going through some old email and ran across
this post...

i did a similar thing, minus the columns. don't suppose it'd be too hard
to add those in. anyway... here's my code for a similar (yet i'm sure
very sloppy) version...

snip-------------------

i changed show_list_to_char prototype to: 
void show_list_to_char (OBJ_DATA * list, CHAR_DATA * ch, bool fShort,
                        bool fShowNothing, bool weapon, bool armor, bool
misc)

then i added this to show_list_to_char (just after the second for loop):

      if (weapon == TRUE && obj->item_type != ITEM_WEAPON)
              continue;
      else if (armor == TRUE && obj->item_type != ITEM_ARMOR)
              continue;
      else if (misc == TRUE && (obj->item_type == ITEM_WEAPON ||
obj->item_type == ITEM_ARMOR)) 
              continue;

then i changed do_inventory to:

void do_inventory (CHAR_DATA * ch, char *argument)
{
   char                buf[MAX_STRING_LENGTH];
   
   send_to_char ("{g= I N V E N T O R Y
============================\n\r", ch);
   sprintf (buf, " Items  : {W%d {gof {W%d {gmax\n\r", ch->carry_number,
can_carry_n (ch));
   send_to_char(buf, ch);
   sprintf (buf, " Weight : {W%ld {gof {W%d {gmax\n\r", get_carry_weight
(ch) / 10, can_carry_w (ch) / 10);
   send_to_char(buf, ch);
   send_to_char ("================================================\n\r",
ch);

   send_to_char ("-= {WW e a p o n s{g =-{x\n\r", ch);
   show_list_to_char2 (ch->carrying, ch, TRUE, TRUE, TRUE, FALSE,
FALSE);
   send_to_char ("{g-= {WA r m o r{g =-{x\n\r", ch);
   show_list_to_char2 (ch->carrying, ch, TRUE, TRUE, FALSE, TRUE,
FALSE);
   send_to_char ("{g-= {WM i s c{g =-{x\n\r", ch);
   show_list_to_char2 (ch->carrying, ch, TRUE, TRUE, FALSE, FALSE,
TRUE);
   send_to_char
("{g================================================{x\n\r", ch);
   
   return;
}
 
-----------end snip

not the prettiest thing in the world, but get's the job done.
hope this helps.

Dilate
gondormud.com port 7001


On Sat, 2003-05-03 at 15:23, Bobby Hicks wrote:
> Sweet!  I like it  :)   And no, Outlook didn't destroy your layout.
> 
> Probly what I'd do is create 4 or 5 OBJ_DATA vars. Then as you sort
> through the inventory checking the item_type, use a switch to determine
> "which" obj_data to store it in.
> 
> 
> To get the two columns thing, probly just use a counter and depending on
> whether it's 1, 2, or 3, will depend on which column it sticks it in.
> More like whether you tack on a "\n\r" or a "%s" to the buffer.
> 
> I like the idea and the concept. I'd love to see a working one in
> action.  :)
> 
> Goodluck on your inventory,
> Rheede
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vertigo
> Sent: Saturday, May 03, 2003 3:39 PM
> To: [email protected]
> Subject: Inventory idea...
> 
> I haven't written to the list in awhile, so alas, "ello" to all of you
> out there still around and the new faces that have popped up.
> 
> I'm working on something that's more of a visual thing than anything
> else.  I'm taking the base inventory display (which is quite ugly, mind
> you) and making it a little more useful.  
> 
> Here's what I'm going for: (I hope Outlook doesn't chop this up too bad)
> 
> .------Inventory of Vertigo -----------------,
> | Total Items : 56 of a 58 MAX LOAD          |
> | Weighing    : 184lb of a 200lb MAX Load    |
> | Encumberance: 6%                           |
> '--------------------------------------------'
> -= Weapons =-                          -= Potions =-
> ( 2) Sword of Vertigas                ( 34) Green Potions
> ( 3) Simple Battle Axe                (  3) Healing Elixers
> 
> 
> -= Armor =-
> ( 2) Suit of Grand Plate Armor
> ( 2) Bracers of Power
> 
> 
> -= Other, Misc =-
> Knit bag of carrying
> Buffalo water skin
> 
> ---
> 
> My basic logic is that I just check the item_type for the objects in
> inventory and then sort it into the varying lists.  Or is there more to
> it that is not popping into my head?  Another question is a simple way
> to get two columns like I have here but with different lists forming the
> output.  Has anyone done anything like this?
> 
> Any information would be appreciated.
> 
> Joe
> Vertigo
> Realm of Lanera
> 
> 
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
-- 
dilate <[EMAIL PROTECTED]>


Reply via email to