ImaNewb

Member
I am using a modified crafting system based off of UO Origins server. When crafting, it only recognizes Iron as the resource. I have added a custom resource "coal" as well. I have hit a wall with this one. I have looked through BaseArmor.cs, BlackSmithMenu.cs, Ingots.cs, Ore.cs, BaseTool.cs, CraftSystem.cs, CraftItem.cs, ResourceInfo.cs and DefBlacksmithy.cs. I tried to change the resource type in DefBlacksmithy and it worked but only for that single resource. I know this is wrong but by changing the
C#:
 typeof( IronIngot )
to
C#:
 typeof( CoalIngot )
it worked. I was trying to substitute the resource in a way to to use multiple metals in that area of code but failed. I realize I am grasping at straws now. LOL please help. I have attached the files I have been working with below.

C#:
#region Platemail
            AddCraft( typeof( PlateArms ), 1011078, 1025136, 66.3, 116.3, typeof( CoalIngot ), 1044036, 18, 1044037 );
            AddCraft( typeof( PlateGloves ), 1011078, 1025140, 58.9, 108.9, typeof( IronIngot ), 1044036, 12, 1044037 );
            AddCraft( typeof( PlateGorget ), 1011078, 1025139, 56.4, 106.4, typeof( IronIngot ), 1044036, 10, 1044037 );
            AddCraft( typeof( PlateLegs ), 1011078, 1025137, 68.8, 118.8, typeof( IronIngot ), 1044036, 20, 1044037 );
            AddCraft( typeof( PlateChest ), 1011078, 1046431, 75.0, 125.0, typeof( IronIngot ), 1044036, 25, 1044037 );
            AddCraft( typeof( FemalePlateChest ), 1011078, 1046430, 44.1, 94.1, typeof( IronIngot ), 1044036, 20, 1044037 );
 

Attachments

  • ResourceInfo.cs
    25 KB · Views: 3
  • BlackSmithMenuNew.cs
    45.3 KB · Views: 6
  • Ingots.cs
    10.7 KB · Views: 2
  • Ore.cs
    26 KB · Views: 0
  • DefBlacksmithy.cs
    33.9 KB · Views: 5
  • CraftItem.cs
    45.3 KB · Views: 4
  • CraftItemCol.cs
    977 bytes · Views: 1
  • CraftSubRes.cs
    1.1 KB · Views: 4
  • CraftSubResCol.cs
    1.2 KB · Views: 1
  • CraftSystem.cs
    9.4 KB · Views: 2
It looks like you hit all the usually-missed spots but there's one place left to make an edit.

In DefBlacksmithy.cs, around line 703 you'll find:

Code:
            // Add every material you want the player to be able to choose from
            // This will override the overridable material
            AddSubRes( typeof( IronIngot ),            1044022, 00.0, 1044036, 1044267 );
            AddSubRes( typeof( DullCopperIngot ),    1044023, 65.0, 1044036, 1044268 );
            AddSubRes( typeof( ShadowIronIngot ),    1044024, 70.0, 1044036, 1044268 );
            AddSubRes( typeof( CopperIngot ),        1044025, 75.0, 1044036, 1044268 );
            AddSubRes( typeof( BronzeIngot ),        1044026, 80.0, 1044036, 1044268 );
            AddSubRes( typeof( GoldIngot ),            1044027, 85.0, 1044036, 1044268 );
            AddSubRes( typeof( AgapiteIngot ),        1044028, 90.0, 1044036, 1044268 );
            AddSubRes( typeof( VeriteIngot ),        1044029, 95.0, 1044036, 1044268 );
            AddSubRes( typeof( ValoriteIngot ),        1044030, 99.0, 1044036, 1044268 );

Add the coal here too, with this format:

Code:
AddSubRes( typeof( CoalIngot),        "Coal", 99.0, 1044036, 1044268 );

Be sure to edit the 99.0 to whatever skill level you want to be required for that resource.

I think that's all you're lacking for your blacksmithing to treat coal as another metal choice.
 
It looks like you hit all the usually-missed spots but there's one place left to make an edit.

In DefBlacksmithy.cs, around line 703 you'll find:

Code:
            // Add every material you want the player to be able to choose from
            // This will override the overridable material
            AddSubRes( typeof( IronIngot ),            1044022, 00.0, 1044036, 1044267 );
            AddSubRes( typeof( DullCopperIngot ),    1044023, 65.0, 1044036, 1044268 );
            AddSubRes( typeof( ShadowIronIngot ),    1044024, 70.0, 1044036, 1044268 );
            AddSubRes( typeof( CopperIngot ),        1044025, 75.0, 1044036, 1044268 );
            AddSubRes( typeof( BronzeIngot ),        1044026, 80.0, 1044036, 1044268 );
            AddSubRes( typeof( GoldIngot ),            1044027, 85.0, 1044036, 1044268 );
            AddSubRes( typeof( AgapiteIngot ),        1044028, 90.0, 1044036, 1044268 );
            AddSubRes( typeof( VeriteIngot ),        1044029, 95.0, 1044036, 1044268 );
            AddSubRes( typeof( ValoriteIngot ),        1044030, 99.0, 1044036, 1044268 );

Add the coal here too, with this format:

Code:
AddSubRes( typeof( CoalIngot),        "Coal", 99.0, 1044036, 1044268 );

Be sure to edit the 99.0 to whatever skill level you want to be required for that resource.

I think that's all you're lacking for your blacksmithing to treat coal as another metal choice.
Good catch, I realized that also after making this post. I went ahead and added it like this:
C#:
AddSubRes( typeof( CoalIngot ),                  0, 50.0, 1044036, 1044268 );

So my materials are good to go and I can add them ingame etc. The issue is attempting to smith with any resource other than iron says "you dont have the resources required to make the item". Even the standard metals were disabled in this craft system since it was written for a Pre T2A shard. I just can't figure out where the override is.
 
You won't be able to use any resource other than iron in a shard of that era then since it is specifically ignoring SubRes entries.

There's the quick-n-dirty approach though: make new versions of each item you want to be crafted out of coal -- CoalPlateArms, CoalPlateLegs, etc. You can copy the regular scripts and change their hue to match the coal ore hue, plus whatever attributes you want to alter since it's coal instead of iron. Then add the new items to DefBlacksmithy using your original "typeof( CoalIngot )"

Sure it's a lot of added items so you might want to trim the items craftable with coal ingots but it's the most direct way to make it work.
 
Is there no way to use one item type entry but have it recognize 2 materials? For instance something to the effect of:
C#:
#region Platemail
            AddCraft( typeof( PlateChest ), 1011078, 1046431, 75.0, 125.0, typeof( IronIngot, ShadowIronIngot ), 1044036, 25, 1044037 );
            #endregion
 
I'm trying to find where era-based crafting is set but nothing jumps out at me yet. Ideally you could turn it on and then just comment out the other resources except for iron and coal ingots. It gets tricky trying to juggle features from one era without enabling all of them. Doing it for ores might also turn on wood and leathers too and that's more work to undo, especially if it also turns on item properties that are outside the era you use. That's why my other method involves a lot of typing but guarantees success.

PyrO's way might work too. It would leave you with the same items whether crafted with iron or coal (same appearance) but could work.
 
you could try BaseIngot as a type
I tried using BaseIngot and it does work except the item is created with Resource type none. so no matter what ingot you use you always get a generic crafted item that isn't made of any resource. I was trying to work out a check for metal types for instance something using an if statement:

C#:
                if typeof( Ironingot )
                {
                    AddCraft( typeof( RingmailGloves ), 1011076, 1025099, 12.0, 62.0, typeof( IronIngot ), 1044036, 10, 1044037 );
                    AddCraft( typeof( RingmailLegs ), 1011076, 1025104, 19.4, 69.4, typeof( IronIngot ), 1044036, 16, 1044037 );
                    AddCraft( typeof( RingmailArms ), 1011076, 1025103, 16.9, 66.9, typeof( IronIngot ), 1044036, 14, 1044037 );
                    AddCraft( typeof( RingmailChest ), 1011076, 1025100, 21.9, 71.9, typeof( IronIngot ), 1044036, 18, 1044037 );
                }
               else if typeof( Coalingot )
                {
                    AddCraft( typeof( RingmailGloves ), 1011076, 1025099, 12.0, 62.0, typeof( CoalIngot ), 1044036, 10, 1044037 );
                    AddCraft( typeof( RingmailLegs ), 1011076, 1025104, 19.4, 69.4, typeof(  CoalIngot ), 1044036, 16, 1044037 );
                    AddCraft( typeof( RingmailArms ), 1011076, 1025103, 16.9, 66.9, typeof(  CoalIngot ), 1044036, 14, 1044037 );
                    AddCraft( typeof( RingmailChest ), 1011076, 1025100, 21.9, 71.9, typeof(  CoalIngot ), 1044036, 18, 1044037 );
                }

Obviously that code is wrong but basically saying if the resource is an Iron Ingot use this section, if the resource is a Coal Ingot use the next section and so on.

Edit: Falkor I was posting this before I saw your reply hahah
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back