Chucl

Member
ServUO Version
Publish Unknown
Ultima Expansion
None
I get that error in console, this is the item:

C#:
public class Torn : Item
    {
       

        [Constructable]
        public Torn() :this(1)
        {
           
        }
       
        [Constructable]
        public Torn(int amount) : base( 0x05ED )
        {
            Name = "Screws";
            Amount = amount;
            ItemID = 0x05ED;
            Stackable = true;
        }

        public Torn( Serial serial ) : base( serial )
        {
        }

   
         public override void OnDoubleClick( Mobile m )
        {
           
        }
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }
}


07/01-10:45 Warning: 0x40000070: Amount changed for non-stackable item 'Torn'. (2)

this is the script where it adds 2 of those items into playerbackpack:


C#:
 Item objetoAñadir = new Torn(2);
                pack.DropItem(objetoAñadir);

how can i get rid of that error? thanks
 
Put stackable = true; at the top
Ah missed the second half of my sentence, I guess will get merged.


It has to be before the Amount gets set.

Amount = amount;
 
Just as a side note, in case you didn't consider it (otherwise ignore my message): be sure that the item is set as "Generic" in the tiledata, otherwise it won't properly stack for the Client.
 

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back