ServUO Version
Publish Unknown
Ultima Expansion
None
public override int LabelNumber => 1126041; // raw serpent steak

Is there a way to give an item a string name without assigning it a message number?
Or how to I add/edit Label Numbers? What file are they in?
 
To change a LabelNumber to use a custom name you would need to edit Cliloc.enu and change an existing cliloc to use your new name. You would then need to distribute the Cliloc.enu to all of your players.

To give it a custom string name just add Name = "Your Custom Name Here"; to the constructable. So something like this:

Custom Name in Constructable:
        [Constructable]
        public TheItem() : base()
        {
            Hue = 1157;
            ItemID = 3921;
            Name = "Bloodied Dagger";
        }
This will not change the Context Menu name however on Control+Shift, but that isn't a big deal really.
 
Last edited:
Thanks, used the second method and got it to work.
Just starting out on this coding stuff and way to early to tell everyone else to update their files.
I'm still not sure what the ItemID does yet. Is that the same as the base number?
 
Thanks, used the second method and got it to work.
Just starting out on this coding stuff and way to early to tell everyone else to update their files.
I'm still not sure what the ItemID does yet. Is that the same as the base number?
Yes. It was just an example. You can pretty much change and define any property in the constructable which is when the mobile/item is created.

**Edit**
In that particular code snippet the ItemID = 3921; is changing it to look like a dagger.

**Edit 2**
Apparently I forgot to put the ; at the end to make it Name = "Bloodied Dagger"; I update the code snippet so it doesn't confuse anyone.
 
Last edited:
Yes. It was just an example. You can pretty much change and define any property in the constructable which is when the mobile/item is created.

**Edit**
In that particular code snippet the ItemID = 3921; is changing it to look like a dagger.

**Edit 2**
Apparently I forgot to put the ; at the end to make it Name = "Bloodied Dagger"; I update the code snippet so it doesn't confuse anyone.
It is working.
I just changed the ItemID to the Base number so it looks more like ItemID = 0x1E1F.

Basically I copied one of the cookable food classes and named it RawHumanMeat for now.
And got the LeftArm etc once carved up to do this: new RawHuman().MoveToWorld(Location, Map);
So now I have raw human meat to loot.
The next two things I'd like to add is.
1. Once you either skin someone's body or carve them up to add the players name to the item/meat.
Being that my character is named Butcher - the name would say something like Raw Human Meat of Butcher.
2. The next problem after that is how to cook it and keep the players name attached to it.
 
It is working.
I just changed the ItemID to the Base number so it looks more like ItemID = 0x1E1F.

Basically I copied one of the cookable food classes and named it RawHumanMeat for now.
And got the LeftArm etc once carved up to do this: new RawHuman().MoveToWorld(Location, Map);
So now I have raw human meat to loot.
The next two things I'd like to add is.
1. Once you either skin someone's body or carve them up to add the players name to the item/meat.
Being that my character is named Butcher - the name would say something like Raw Human Meat of Butcher.
2. The next problem after that is how to cook it and keep the players name attached to it.
You can actually just remove that ItemID = xxxx; portion, especially if you're just setting it to its base. The base IS the ItemID. Adding the ItemID = xxxx; just overrides it. Usually you don't need to override the ItemID for anything, but on rare occasions you could. I placed it in there as an example of what a generic constructable might look like.

For the other stuff there are several ways to do this.

1. If RawHuman() creates all the body parts and places them in the same location, in the RawHuman file add a property to it so that you could call the mobile/corpse name. Something like
RawHuman(Corpse corpsename)
Then where you move the parts to world it would be:

new RawHuman(this).Move To World etc.

Then in RawHuman.cs or whatever, where you create the various body parts or even in their constructable you'd make it call the Corpse corpsename and add it to your name. So it'd look something like this:

Name = "Left Arm of " + corpsename.ToString();

The ToString part may not be necessary, but good to know just in case. You may need to remove part of the corpsename if it is showing the new name as "Left Arm of the remains of Butcher" however I am at work and my break is almost up, so I don't have time to show you how to do that. I will when I get home tonight though.

You'd do the same thing essentially for the cooked meat.

**Edit**
Take a look at Corpse.cs and Head.cs to see how it handles adding the player's name to the head when the corpse is carved. Not sure why I didn't think of it before, I could've saved myself a lot of typing. :oops: o_O:p
 
Last edited:
You can actually just remove that ItemID = xxxx; portion, especially if you're just setting it to its base. The base IS the ItemID. Adding the ItemID = xxxx; just overrides it. Usually you don't need to override the ItemID for anything, but on rare occasions you could. I placed it in there as an example of what a generic constructable might look like.

For the other stuff there are several ways to do this.

1. If RawHuman() creates all the body parts and places them in the same location, in the RawHuman file add a property to it so that you could call the mobile/corpse name. Something like
RawHuman(Corpse corpsename)
Then where you move the parts to world it would be:

new RawHuman(this).Move To World etc.

Then in RawHuman.cs or whatever, where you create the various body parts or even in their constructable you'd make it call the Corpse corpsename and add it to your name. So it'd look something like this:

Name = "Left Arm of " + corpsename.ToString();

The ToString part may not be necessary, but good to know just in case. You may need to remove part of the corpsename if it is showing the new name as "Left Arm of the remains of Butcher" however I am at work and my break is almost up, so I don't have time to show you how to do that. I will when I get home tonight though.

You'd do the same thing essentially for the cooked meat.

**Edit**
Take a look at Corpse.cs and Head.cs to see how it handles adding the player's name to the head when the corpse is carved. Not sure why I didn't think of it before, I could've saved myself a lot of typing. :oops: o_O:p
Thanks I'll take a look as soon as I can. Have to work this week.
 
Back