ObiOne

Member
Code:
 public override void AddNameProperty(ObjectPropertyList list)
        {
            string oreType;

            if (Hue == 0)
            {
                oreType = "";
            }
            else
            {
                switch (m_Resource)
                {
                    case CraftResource.DullCopper: oreType = "dull copper"; break; // dull copper
                    case CraftResource.ShadowIron: oreType = "shadow iron"; break; // shadow iron
                    case CraftResource.Copper: oreType = "copper"; break; // copper
                    case CraftResource.Bronze: oreType = "bronze"; break; // bronze                   
                    case CraftResource.Gold: oreType = "gold"; break; // golden
                    case CraftResource.Agapite: oreType = "agapite"; break; // agapite                   
                    case CraftResource.Verite: oreType = "verite"; break; // verite
                    case CraftResource.Valorite: oreType = "valorite"; break; // valorite
                    case CraftResource.Silver: oreType = "silver"; break; // silver
                    case CraftResource.Platinum: oreType = "platinum"; break; // platinum
                    case CraftResource.Mythril: oreType = "mythril"; break; // mythril
                    case CraftResource.Obsidian: oreType = "obsidian"; break; // obsidian
                    case CraftResource.Jade: oreType = "jade"; break; // jade
                    case CraftResource.Moonstone: oreType = "moonstone"; break; // moonstone
                    case CraftResource.Sunstone: oreType = "sunstone"; break; // sunstone
                    case CraftResource.Bloodstone: oreType = "bloodstone"; break; // bloodstone
                    case CraftResource.SpinedLeather: oreType = "spined"; break; // spined
                    case CraftResource.HornedLeather: oreType = "horned"; break; // horned
                    case CraftResource.BarbedLeather: oreType = "barbed"; break; // barbed
                    case CraftResource.DragonLeather: oreType = "dragon"; break; // dragon
                    case CraftResource.DaemonLeather: oreType = "daemon"; break; // daemon
                    case CraftResource.RedScales: oreType = "red"; break; // red
                    case CraftResource.YellowScales: oreType = "yellow"; break; // yellow
                    case CraftResource.BlackScales: oreType = "black"; break; // black
                    case CraftResource.GreenScales: oreType = "green"; break; // green
                    case CraftResource.WhiteScales: oreType = "white"; break; // white
                    case CraftResource.BlueScales: oreType = "blue"; break; // blue

                    case CraftResource.Pine: oreType = "pine"; break; // pine
                    case CraftResource.Cedar: oreType = "cedar"; break; // cedar
                    case CraftResource.Cherry: oreType = "cherry"; break; // cherry
                    case CraftResource.Mahogany: oreType = "mahogany"; break; // mahogany
                    case CraftResource.OakWood: oreType =   "oak"; break; // oak
                    case CraftResource.AshWood: oreType =   "ash"; break; // ash
                    case CraftResource.YewWood: oreType =   "yew"; break; // yew
                    case CraftResource.Heartwood: oreType = "heartwood"; break; // heartwood
                    case CraftResource.Bloodwood: oreType = "bloodwood"; break; // bloodwood
                    case CraftResource.Frostwood: oreType = "frostwood"; break; // frostwood
                     
                    default: oreType = ""; break;
                }

                //if ( oreType != 0 )
                list.Add(1053099, "{0}\t{1}", oreType, GetNameString()); // ~1_oretype~ ~2_armortype~
                /*else if ( Name == null )
                    list.Add( LabelNumber );
                else
                    list.Add( Name );*/
            }
 
Please, in the future if you have need of help be as descriptive as possible with your inquiry. As is I have no idea what you need help with except that you are using a non standard AddNameProperty method.

The oretypes are not set as strings, but as ints.

This is the standard method in servuo

Code:
		public override void AddNameProperty(ObjectPropertyList list)
		{
			int oreType;

			switch (m_Resource)
			{
				case CraftResource.DullCopper:
					oreType = 1053108;
					break; // dull copper
				case CraftResource.ShadowIron:
					oreType = 1053107;
					break; // shadow iron
				case CraftResource.Copper:
					oreType = 1053106;
					break; // copper
				case CraftResource.Bronze:
					oreType = 1053105;
					break; // bronze
				case CraftResource.Gold:
					oreType = 1053104;
					break; // golden
				case CraftResource.Agapite:
					oreType = 1053103;
					break; // agapite
				case CraftResource.Verite:
					oreType = 1053102;
					break; // verite
				case CraftResource.Valorite:
					oreType = 1053101;
					break; // valorite
				case CraftResource.SpinedLeather:
					oreType = 1061118;
					break; // spined
				case CraftResource.HornedLeather:
					oreType = 1061117;
					break; // horned
				case CraftResource.BarbedLeather:
					oreType = 1061116;
					break; // barbed
				case CraftResource.RedScales:
					oreType = 1060814;
					break; // red
				case CraftResource.YellowScales:
					oreType = 1060818;
					break; // yellow
				case CraftResource.BlackScales:
					oreType = 1060820;
					break; // black
				case CraftResource.GreenScales:
					oreType = 1060819;
					break; // green
				case CraftResource.WhiteScales:
					oreType = 1060821;
					break; // white
				case CraftResource.BlueScales:
					oreType = 1060815;
					break; // blue

					#region Mondain's Legacy
				case CraftResource.OakWood:
					oreType = 1072533;
					break; // oak
				case CraftResource.AshWood:
					oreType = 1072534;
					break; // ash
				case CraftResource.YewWood:
					oreType = 1072535;
					break; // yew
				case CraftResource.Heartwood:
					oreType = 1072536;
					break; // heartwood
				case CraftResource.Bloodwood:
					oreType = 1072538;
					break; // bloodwood
				case CraftResource.Frostwood:
					oreType = 1072539;
					break; // frostwood
					#endregion

				default:
					oreType = 0;
					break;
			}

			if (oreType != 0)
			{
				list.Add(1053099, "#{0}\t{1}", oreType, GetNameString()); // ~1_oretype~ ~2_armortype~
			}
			else if (Name == null)
			{
				list.Add(LabelNumber);
			}
			else
			{
				list.Add(Name);
			}

			/*
            * Want to move this to the engraving tool, let the non-harmful 
            * formatting show, and remove CLILOCs embedded: more like OSI
            * did with the books that had markup, etc.
            * 
            * This will have a negative effect on a few event things imgame 
            * as is.
            * 
            * If we cant find a more OSI-ish way to clean it up, we can 
            * easily put this back, and use it in the deserialize
            * method and engraving tool, to make it perm cleaned up.
            */

			if (!String.IsNullOrEmpty(m_EngravedText))
			{
				list.Add(1062613, m_EngravedText);
			}
			/* list.Add( 1062613, Utility.FixHtml( m_EngravedText ) ); */
		}
 
I figured the pic and the new ore would have gave an idea but ok.I added new ore using the string method as you can see well no names on the weapons for some reason. It was working now it is not.
 
I figured the pic and the new ore would have gave an idea but ok.I added new ore using the string method as you can see well no names on the weapons for some reason. It was working now it is not.
Not not string sorry getting drowsy
 
From what I can tell, from a quick glance as I am just about to sleep is that it is not formatted correctly, the int's are used as cliloc location values and are looked up in the client files, you cannot use the strings as they are not cliloc ID's.

I will give it a better look tomorrow if you have not figured it out.
 
ok yea sorry i was drowsy working 16 hours but yea i see what your saying but what i was trying to do was add new ore but it errors if i keep the int method not sure i guess how to fix it.
After a ton of research
Code:
public override void AddNameProperty(ObjectPropertyList list)
        {
            int oreType;
            string oreString = null;

            switch (m_Resource)
            {
                case CraftResource.DullCopper:
                    oreType = 1053108;
                    break; // dull copper
                case CraftResource.ShadowIron:
                    oreType = 1053107;
                    break; // shadow iron
                case CraftResource.Copper:
                    oreType = 1053106;
                    break; // copper
                case CraftResource.Bronze:
                    oreType = 1053105;
                    break; // bronze
                case CraftResource.Gold:
                    oreType = 1053104;
                    break; // golden
                case CraftResource.Agapite:
                    oreType = 1053103;
                    break; // agapite
                case CraftResource.Verite:
                    oreType = 1053102;
                    break; // verite
                case CraftResource.Valorite:
                    oreType = 1053101;
                    break; // valorite
                case CraftResource.Silver:
                    oreString = "silver";
                    goto default; // silver
                case CraftResource.Platinum:
                    oreString = "platinum";
                    goto default; // platinum
                case CraftResource.Mythril:
                    oreString = "mythril";
                    goto default; // mythril
                case CraftResource.Obsidian:
                    oreString = "obsidian";
                    goto default; // obsidian
                case CraftResource.Jade:
                    oreString = "jade";
                    goto default; // jade
                case CraftResource.Moonstone:
                    oreString = "moonstone";
                    goto default; // moonstone
                case CraftResource.Sunstone:
                    oreString = "sunstone";
                    goto default; // sunstone
                case CraftResource.Bloodstone:
                    oreString = "bloodstone";
                    goto default; // bloodstone
                case CraftResource.SpinedLeather:
                    oreType = 1061118;
                    break; // spined
                case CraftResource.HornedLeather:
                    oreType = 1061117;
                    break; // horned
                case CraftResource.BarbedLeather:
                    oreType = 1061116;
                    break; // barbed
                case CraftResource.DragonLeather:
                    oreString = "dragon";
                    goto default; // dragon
                case CraftResource.DaemonLeather:
                    oreString = "daemon";
                    goto default; // daemon
                case CraftResource.RedScales:
                    oreType = 1060814;
                    break; // red
                case CraftResource.YellowScales:
                    oreType = 1060818;
                    break; // yellow
                case CraftResource.BlackScales:
                    oreType = 1060820;
                    break; // black
                case CraftResource.GreenScales:
                    oreType = 1060819;
                    break; // green
                case CraftResource.WhiteScales:
                    oreType = 1060821;
                    break; // white
                case CraftResource.BlueScales:
                    oreType = 1060815;
                    break; // blue
                   
                case CraftResource.Pine:
                    oreString = "pine";
                    goto default; // pine
                case CraftResource.Cedar:
                    oreString = "cedar";
                    goto default; // cedar
                case CraftResource.Cherry:
                    oreString = "cherry";
                    goto default; // cherry
                case CraftResource.Mahogany:
                    oreString = "mahogany";
                    goto default; // mahogany
                case CraftResource.OakWood:
                    oreString = "oak";
                    goto default; // oak
                case CraftResource.AshWood:
                    oreString = "ash";
                    goto default; // ash
                case CraftResource.YewWood:
                    oreString = "yew";
                    goto default; // yew
                case CraftResource.Heartwood:
                    oreString = "heartwood";
                    goto default; // heartwood
                case CraftResource.Bloodwood:
                    oreString = "bloodwood";
                    goto default; // bloodwood
                case CraftResource.Frostwood:
                    oreString = "frostwood";
                    goto default; // frostwood

                default:
                    oreType = 0;
                    break;
            }

            if ( oreType != 0 )
                list.Add( 1053099, "{0}\t{1}", oreType, GetNameString() ); // ~1_oretype~ ~2_armortype~
            else if( oreString != null )
                list.Add( 1053099, "{0}\t{1}", oreString, GetNameString() ); // ~1_oretype~ ~2_armortype~
            else if ( Name == null )
                list.Add( LabelNumber );
            else
                list.Add( Name );
i found a fix for it.
 
Last edited:
Good work on finding the fix for your problem!

I'd like to hijack your thread if I may, with some information that might be helpful in this situation in the future;

TextDefinition! This is a little gem, it is meant for this purpose and represents both an int and string at the same time.

If you change this:
C#:
int oreType;

To this:
C#:
TextDefinition oreType;

It will allow you to do both:
C#:
oreType = 1053106; // copper
C#:
oreType = "silver";

... because TextDefinition supports implicit conversion to and from int or string.

Then when using it:
C#:
string oreString = oreType.ToString();

if( !String.IsNullOrWhiteSpace( oreString ) )
    list.Add( 1053099, "{0}\t{1}", oreString, GetNameString() ); // ~1_oretype~ ~2_armortype~

TextDefinition.ToString() will return either "#1053106" or "silver", based on the above examples.

Note, you can have both the Number and String properties of a TextDefinition set, but ToString() will prioritize returning the Number property before the String property.

---

IF you use Vita-Nex: Core 2.2.0.0+ you can use the ExtendedOPL to apply custom properties to your ObjectPropertyLists:

C#:
ExtendedOPL opl = new ExtendedOPL( list ); // Wrap the ObjectPropertyList

opl.Add( "silver {0}", GetNameString( ) );

opl.Add( "One" );
opl.Add( "Two" );
opl.Add( "Three" );
opl.Add( "Four" );
opl.Add( "Five" );

opl.Apply( ); // Apply the changes to the list

The benefits of using the ExtendedOPL with its stock settings, allows you to add up to 65 custom lines to the list - and automatically keeps track of which cliloc ids have been used, meaning you never have to worry about finding that ~1_nothing~ for your custom string :)
 
Ok I fixed this definately tested by 3 gm's to make sure..but when i fixed the regular weapons i had the crafting issue of the cliloc being next to the name of the weapon I split the wood up..If you add the wood type in string method and put it with the mondain's legacy int method using clilocs it will definately mess up the crafting part of the ingots not sure why if you look at this code you can see where i split them...i'm not a master scripter so this is the best i can do in explaining this..thank you Voxpire for the vita nex core it seems so cool but I have no common sense on it ...lol
Code:
public override void AddNameProperty( ObjectPropertyList list )
        {
            int oreType;
            string oreString = null;

            switch ( m_Resource )
            {
                case CraftResource.DullCopper:        oreType = 1053108; break; // dull copper
                case CraftResource.ShadowIron:        oreType = 1053107; break; // shadow iron
                case CraftResource.Copper:            oreType = 1053106; break; // copper
                case CraftResource.Bronze:            oreType = 1053105; break; // bronze
                case CraftResource.Silver:            oreString = "silver"; goto default; // silver
                case CraftResource.Platinum:        oreString = "platinum"; goto default; // platinum
                case CraftResource.Mythril:         oreString = "mythril"; goto default; // mythril
                case CraftResource.Obsidian:        oreString = "obsidian"; goto default; // obsidian
                case CraftResource.Jade:            oreString = "jade"; goto default; // jade
                case CraftResource.Moonstone:       oreString = "moonstone"; goto default; // moonstone
                case CraftResource.Sunstone:        oreString = "sunstone"; goto default; // sunstone
                case CraftResource.Bloodstone:      oreString = "bloodstone"; goto default; // bloodstone
                case CraftResource.Gold:            oreType = 1053104; break; // golden
                case CraftResource.Agapite:            oreType = 1053103; break; // agapite
                case CraftResource.Verite:            oreType = 1053102; break; // verite
                case CraftResource.Valorite:        oreType = 1053101; break; // valorite
                case CraftResource.SpinedLeather:    oreType = 1061118; break; // spined
                case CraftResource.HornedLeather:    oreType = 1061117; break; // horned
                case CraftResource.BarbedLeather:    oreType = 1061116; break; // barbed
                case CraftResource.DragonLeather:   oreString = "dragon"; goto default; // dragon
                case CraftResource.DaemonLeather:   oreString = "daemon"; goto default; // daemon
                case CraftResource.RedScales:        oreType = 1060814; break; // red
                case CraftResource.YellowScales:    oreType = 1060818; break; // yellow
                case CraftResource.BlackScales:        oreType = 1060820; break; // black
                case CraftResource.GreenScales:        oreType = 1060819; break; // green
                case CraftResource.WhiteScales:        oreType = 1060821; break; // white
                case CraftResource.BlueScales:        oreType = 1060815; break; // blue
                case CraftResource.Pine:            oreString = "pine"; goto default; // pine
                case CraftResource.Cedar:           oreString = "cedar"; goto default; // cedar
                case CraftResource.Cherry:          oreString = "cherry"; goto default; // cherry
                case CraftResource.Mahogany:        oreString = "mahogany"; goto default; // mahogany


                #region Mondain's Legacy
                case CraftResource.OakWood:   oreType = 1072533; break; // oak
                case CraftResource.AshWood:   oreType = 1072534; break; // ash
                case CraftResource.YewWood:   oreType = 1072535; break; // yew
                case CraftResource.Heartwood: oreType = 1072536; break; // heartwood
                case CraftResource.Bloodwood: oreType = 1072538; break; // bloodwood
                case CraftResource.Frostwood: oreType = 1072539; break; // frostwood
                #endregion Mondain's Legacy
                default: oreType = 0; break;
            }

            if ( oreType != 0 )
                list.Add( 1053099, "#{0}\t{1}", oreType, GetNameString() ); // ~1_oretype~ ~2_armortype~
            else if( oreString != null )
                list.Add( 1053099, "{0}\t{1}", oreString, GetNameString() ); // ~1_oretype~ ~2_armortype~
            else if ( Name == null )
                list.Add( LabelNumber );
            else
                list.Add( Name );
 
Last edited:
This has me stumped. The section starting with "if (oreType != 0)" looks correct, and must be the one triggered based on the number given, but the number should be interpreted as a cliloc value, so that is confusing.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back