Newb question about clothing

sheivan

Citizen
Jul 17, 2019
33
1
8
What am I doing wrong here? Just trying to add a new piece of clothing


C#:
using System;
using Server;

namespace Server.Items
{
    public class newshirtlol : BaseClothing
    {
        
        [Constructable]
        public newshirtlol : (0x558F)
        
        {
            Name = "<BASEFONT COLOR=#2E9AFE>newshirtlol";
            Hue = 1910;
    
                   Weight = 2.0;
        }

      

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

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 1 );
        }
        
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

        }
    }
}
 

Falkor

Squire
Apr 11, 2018
433
171
43
wpshard.com
Shard Name
Whispering Pines
What error are you getting?

As far as I know you can't specify font information within an item's name...

I would look at other shirt scripts since they inherit Shirt and not baseclothing.

Here is shirt.cs edited for your needs:
Code:
using System;
using Server;

namespace Server.Items
{
    public class newshirtlol : Shirt
    {
        [Constructable]
        public newshirtlol()
        {
Name = "New shirt LOL";
Hue = 1910;
        }

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

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            reader.ReadInt();
        }
    }
}
Did you know if you type the word "shirt" enough times, it ceases to have meaning?! :D
 

sheivan

Citizen
Jul 17, 2019
33
1
8
lol thanks :)

Heres the error

+ Custom/newshirtlol.cs:
CS1519: Line 10: Invalid token ':' in class, struct, or interface member declaration
CS1031: Line 10: Type expected
CS8124: Line 10: Tuple must contain at least two elements.
CS1026: Line 10: ) expected
CS1519: Line 10: Invalid token '0x558F' in class, struct, or interface member declaration
CS1519: Line 13: Invalid token '=' in class, struct, or interface member declaration
CS1519: Line 14: Invalid token '=' in class, struct, or interface member declaration
CS1519: Line 16: Invalid token '=' in class, struct, or interface member declaration
CS1022: Line 40: Type or namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
 

GoldDraco13

Squire
Aug 1, 2014
492
315
63
48
Canada
mycy4.com
Donate
Donate money to this user
Falkor answer would not produce that error, but it would if you left your line like this

Code:
        public newshirtlol : (0x558F)
change to

Code:
public newshirtlol()
 

Djeryv

Squire
Oct 2, 2014
293
124
43
Moved On...
Shard Name
Ultima Odyssey
public class newshirtlol : Shirt

"Shirt" is already set in another script and that has an ItemID.
 

Falkor

Squire
Apr 11, 2018
433
171
43
wpshard.com
Shard Name
Whispering Pines
Code:
public newshirtlol()  : base (0x558F)
should take care of that. I forgot you were using a different shirt. You may have to change this line from Shirt to BaseShirt for that.

Code:
public class newshirtlol : BaseShirt