We have 3 custom leathers on the shard I play & staff on. I have them working fine with the BODs & with crafting except that they wouldn't show resource name when crafting armor. I decided to convert the resources to string in BaseArmor.cs & now I'm getting the fun CliLoc error for Exceptional pieces. I've made multiple attempts & the closest I've gotten is the armor showing Exceptional Leather Gorget (no resource showing). Seems like I'm destined to get either that or the CLiLoc error when it actually compiles. I know where the problem is (I think), I just havent been able to solve it. So I'm asking for help. The snippet shows the attempt that gives the exceptional leather gorget, but no resource.
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; // Gold
                    case CraftResource.Agapite: oreType = "Agapite"; break; // Agapite
                    case CraftResource.Verite: oreType = "Verite"; break; // Verite
                    case CraftResource.Valorite: oreType = "Valorite"; break; // valorite
                    case CraftResource.SpinedLeather: oreType = "Spined"; break; // Spined
                    case CraftResource.HornedLeather: oreType = "Horned"; break; // Horned
                    case CraftResource.BarbedLeather: oreType = "Barbed"; break; // Barbed
                    case CraftResource.PyreticLeather: oreType = "Pyretic"; break; // Spined
                    case CraftResource.GlacialLeather: oreType = "Glacial"; break; // Horned
                    case CraftResource.BaneLeather: oreType = "Bane"; break; // Barbed
                    case CraftResource.RedScales: oreType = "Red Scales"; break; // Red
                    case CraftResource.YellowScales: oreType = "Yellow Scales"; break; // Yellow
                    case CraftResource.BlackScales: oreType = "Black Scales"; break; // Black
                    case CraftResource.GreenScales: oreType = "Green Scales"; break; // Green
                    case CraftResource.WhiteScales: oreType = "White Scales"; break; // White
                    case CraftResource.BlueScales: oreType = "Blue Scales"; break; // Blue
                    case CraftResource.AshWood: oreType = "Ash Wood"; break;
                    case CraftResource.YewWood: oreType = "Yew Wood"; break;
                    case CraftResource.Heartwood: oreType = "Heartwood"; break;
                    case CraftResource.Bloodwood: oreType = "Bloodwood"; break;
                    case CraftResource.Frostwood: oreType = "Frostwood"; break;
                    default: oreType = ""; break;
                }
            }

            if (m_ReforgedPrefix != ReforgedPrefix.None || m_ReforgedSuffix != ReforgedSuffix.None)
            {
                if (m_ReforgedPrefix != ReforgedPrefix.None)
                {
                    int prefix = RunicReforging.GetPrefixName(m_ReforgedPrefix);

                    if (m_ReforgedSuffix == ReforgedSuffix.None)
                        list.Add(1151757, String.Format("#{0}\t{1}", prefix, GetNameString())); // ~1_PREFIX~ ~2_ITEM~
                    else
                        list.Add(1151756, String.Format("#{0}\t{1}\t#{2}", prefix, GetNameString(), RunicReforging.GetSuffixName(m_ReforgedSuffix))); // ~1_PREFIX~ ~2_ITEM~ of ~3_SUFFIX~
                }
                else if (m_ReforgedSuffix != ReforgedSuffix.None)
                {
                    if (m_ReforgedSuffix == ReforgedSuffix.Blackthorn)
                        list.Add(1154548, String.Format("{0}", GetNameString())); // ~1_TYPE~ bearing the crest of Blackthorn
                    else if (m_ReforgedSuffix == ReforgedSuffix.Minax)
                        list.Add(1154507, String.Format("{0}", GetNameString())); // ~1_ITEM~ bearing the crest of Minax
                    else
                        list.Add(1151758, String.Format("{0}\t#{1}", GetNameString(), RunicReforging.GetSuffixName(m_ReforgedSuffix))); // ~1_ITEM~ of ~2_SUFFIX~
                }
            }
            else if (this.m_Quality == ArmorQuality.Exceptional)
            {
                if (oreType == "" ) // << problem area
                    list.Add(1053100,"#{0}\t{1}", oreType, this.GetNameString()); // exceptional ~1_oretype~ ~2_armortype~
                else
                   list.Add(1050040, this.GetNameString()); // exceptional ~1_ITEMNAME~
            }
            else
            {
                if (oreType == "") // << problem area
                    list.Add(1053099, "#{0}\t{1}", oreType, this.GetNameString()); // ~1_oretype~ ~2_armortype~
                else if (this.Name == null)
                    list.Add(this.LabelNumber);
                else
                    list.Add(this.Name);
            }
        }
I've tried if (oreType != "") , if (oreType = ""), if (oreType !=0) & all either give the CliLoc error or wont compile with a "Cant use operands != with string and int" error. Any suggestions, help, go get stuffed, quit bothering me or general laughter because its something really simple?
 
Code:
list.Add(1053099, "#{0}\t{1}", oreType, this.GetNameString());

The problem is with that #. When you include an # in a cliloc format string, it tells the client to interpret the following characters as a cliloc ID (ex #3000000). It's a way to insert one cliloc into another's arguments.

Since you've converted to a string, you should just remove the # that's prefixed to oreType, as the client is trying to parse things like "#Iron" as a cliloc ID - thus the Megacliloc Error.
 
Awesome.. thankyou! The
if (oreType != "")
did the trick after removing the #. Now they are all crafting with Exceptional Pyretic Leather Gloves (or whatever type I craft) above the stats. :)
 
Back