Full Version : Blacksmith buy menu
xmlspawner >>Scripting Support >>Blacksmith buy menu


<< Prev | Next >>

Grimhawk- 07-13-2006
I added in some custom woods lately and now the weapons on the buy menu are listed strange.

user posted image

This is what its doing. Any ideas on whats causing this would be apreciated.

ArteGordon- 07-14-2006
I would guess that when you added the custom woods, you modified the way the properties list for weapons and other items are put together and that is causing the problem.
I would take a look at the GetProperties calls in BaseWeapon.cs. Try putting it back to the original and see if that fixes it.

Grimhawk- 07-14-2006
I looked at other custom resource scripts and as far as I can tell I edited mine right. Below is the portion of the script that I think is causing it. Any ideas?

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.Mythril:     oreType = "Mythril"; break; // Mythril                    
                   case CraftResource.SpinedLeather: oreType = "Spined"; break; // spined
                   case CraftResource.HornedLeather: oreType = "Horned"; break; // horned
                   case CraftResource.BarbedLeather: oreType = "Barbed"; break; // barbed
                   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.RegularLog: oreType = "Ordinary Wood"; break;
                   case CraftResource.Oak: oreType = "Oak"; break;
                   case CraftResource.Ash: oreType = "Ash"; break;
                   case CraftResource.Yew: oreType = "Yew"; break;
                   case CraftResource.HeartWood: oreType = "HeartWood"; break;
                   case CraftResource.BloodWood: oreType = "BloodWood"; break;
                   case CraftResource.FrostWood: oreType = "FrostWood"; break;
                   default: oreType = ""; break;
               }

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

ArteGordon- 07-15-2006
did you try restoring it to the original to see if that fixed it just to make sure that it is a problem with the properties list?

Grimhawk- 07-15-2006
Yes I tried going back to original code and it won't compile since I'm converting int to string. Its got me puzzled since this seems to be the way the other custom resource systems use.

ArteGordon- 07-15-2006
did you add any override to the LabelNumber property when you added the customs?

Grimhawk- 07-15-2006
Got it fixed Arte seems while working on it half asleep I added an extra } at one spot and forgot one at another. Thanks for the help.