Looniper2

Member
ServUO Version
Publish 57
Ultima Expansion
Endless Journey
I searched for this question and found several entries, but none appear to apply to the current state of the server.

BaseOre/BaseOres no longer exists.
Ores.cs doesn't contain an entry for weights.
(and the plusweight doesn't effect the actual weight value)


There doesn't appear to be an entry for ores in items.cs

And I can't edit them as tiles in fiddler because it just doesn't change them. I change the weight value, click save, and save tiles - the resulting saved mul file contains the original values.

.. I just want to reduce the scaling inefficiency of weights to the larger piles somewhat. It should be a straightforward task. Perhaps I am missing something obvious.
 
Some things you wrote are confusing...so I will try to break it down how I think you were doing.

The Item.cs tries to read the TILEDATA.MUL file and determine the WEIGHT value there. If so...then it sets the weight to that.

So did you edit TILEDATA.MUL for the ore graphics...to the weight you wanted?

If so...did you save the TILEDATA.MUL and place that file in the area where your server reads that file?
 
You can override the ore weight in the Ore.cs if you want to, but you'll have to also change the logic for how ore combining and smelting works as those heavily rely on the default weights.

public override double DefaultWeight => 1.0;

if you put this line of code inside Ore.cs, it will change the weight of all ore to whatever number you put in there. But if you don't change the ore combining and smelting parts of the script, it will not behave smoothly at all.

edit: changing the tiledata.mul file does work tho, I believe you just didn't properly save it. you can't set decimal places in there, and you need to click Save Changes after editing the weight to each different ID, and then Save Tiledata after all changes are done.
 
Last edited:
edit: changing the tiledata.mul file does work tho, I believe you just didn't properly save it. you can't set decimal places in there, and you need to click Save Changes after editing the weight to each different ID, and then Save Tiledata after all changes are done.
As I said, I was missing something obvious.
Precision values in an integer.

I suppose had I been trying to alter it more, it would have worked, but I was attempting to reduce the 12 by 20% (9.6) and the middles from 7 to 6.595 (15%). Floating points don't fit very well.

Your help is much appreciated!
So did you edit TILEDATA.MUL for the ore graphics...to the weight you wanted?

If so...did you save the TILEDATA.MUL and place that file in the area where your server reads that file?
I was altering the weight in Tile Data in fiddler, but it wasn't saving the changes.
As Azrok noted, I was trying to use a floating point value for the weight, which is an integer.
So Fiddler just ignored the changes. So no matter how many times I saved/copied over the mul, it didn't alter the weights.
 
As I said, I was missing something obvious.
Precision values in an integer.

I suppose had I been trying to alter it more, it would have worked, but I was attempting to reduce the 12 by 20% (9.6) and the middles from 7 to 6.595 (15%). Floating points don't fit very well.

Your help is much appreciated!

I was altering the weight in Tile Data in fiddler, but it wasn't saving the changes.
As Azrok noted, I was trying to use a floating point value for the weight, which is an integer.
So Fiddler just ignored the changes. So no matter how many times I saved/copied over the mul, it didn't alter the weights.
UOFiddler doesn't ignore anything :) you have two phase commit in tiledata Save Changes is per entry and Save Tiledata is generating new file in uofiddler's profile. You then need to copy this new file to your client/server files.

1740515480916.png
 
Last edited:
Yeah...that was where I was trying to go with them with my questions.

If they want a weight of 0.1 though...they should just override in the ore scripts.
 
UOFiddler doesn't ingore anything :) you have two phase commit in tiledata Save Changes is per entry and Save Tiledata is generating new file in uofiddler's profile. You then need to copy this new file to your client/server files.
Ignore may not be the correct term, but I don't know a better one.
If you attempt to apply a decimal value it just doesn't change the value.
But if you make the same change, using the same save options, with an integer, it does.
Demonstrating the Fiddler mismatch situation


As to overriding the weight... there's a bit to that.
I won't go into my health situation and why that has me running the server... but simply put, I want to dig in and make changes to the code, and to learn how to do more.
But the reality of my situation greatly limits my ability to grasp new concepts, or methods. So while I am familiar with coding (x86 assembler by profession for over a decade), I am not familiar with C or C sharp, beyond the logic structure and flow, and the syntax that I've learned incidentally over the years.

I can look at
if ((ore.ItemID == 0x19B9 && worth > 120000) || ((ore.ItemID == 0x19B8 || ore.ItemID == 0x19BA) && worth > 60000) || (ore.ItemID == 0x19B7 && worth > 30000))
and follow it without a problem.
I don't know what the itemID values represent, or what worth is a reference to, but I understand the flow and the comparators.

But I can't tell you step 1 I would take toward distinguishing the 3 different ore pile tiles and designating each their own weight, in the script.
I could add
DefaultWeight = 1;
But which ore would that apply to? Any of them? All of them?
If (ore.ItemID == 0x19B9)
Weight = 1;
ElseIf (ore.ItemID == 0x19B8)
Weight = 6;
Else
Weight = 10;

?
 
Last edited:
There are different ore piles, you can see them in the items tab in fiddler, which is what the ore.ID's are referring too!

1740593569682.png
 
To add onto Wilson's post...when you are in Fiddler, right click the graphic and select to view it in TILEDATA and you will jump straight there. Then you can edit the TILEDATA...save it...and place the newly created file in the appropriate directory where your current TILEDATA.MUL is located. Start the server and it should then read that file. But again...if you are going to go for a weight less than "1"...then you will need to just override the weight in the ore script.
 
Ignore may not be the correct term, but I don't know a better one.
If you attempt to apply a decimal value it just doesn't change the value.
But if you make the same change, using the same save options, with an integer, it does.
Demonstrating the Fiddler mismatch situation


As to overriding the weight... there's a bit to that.
I won't go into my health situation and why that has me running the server... but simply put, I want to dig in and make changes to the code, and to learn how to do more.
But the reality of my situation greatly limits my ability to grasp new concepts, or methods. So while I am familiar with coding (x86 assembler by profession for over a decade), I am not familiar with C or C sharp, beyond the logic structure and flow, and the syntax that I've learned incidentally over the years.

I can look at
if ((ore.ItemID == 0x19B9 && worth > 120000) || ((ore.ItemID == 0x19B8 || ore.ItemID == 0x19BA) && worth > 60000) || (ore.ItemID == 0x19B7 && worth > 30000))
and follow it without a problem.
I don't know what the itemID values represent, or what worth is a reference to, but I understand the flow and the comparators.

But I can't tell you step 1 I would take toward distinguishing the 3 different ore pile tiles and designating each their own weight, in the script.
I could add
DefaultWeight = 1;
But which ore would that apply to? Any of them? All of them?
If (ore.ItemID == 0x19B9)
Weight = 1;
ElseIf (ore.ItemID == 0x19B8)
Weight = 6;
Else
Weight = 10;

?
public override double DefaultWeight
{
get
{
switch (ItemID)
{
case 0x19B7: return 2.0; // Small Ore
case 0x19B8: return 6.595; // Medium Ore
case 0x19BA: return 6.595; // Medium Ore
case 0x19B9: return 9.6; // Big Ore
default: return 2.0; // Default case, should not happen
}
}
}

I did some research and this works. If you want to just override the values of ores in code, you can do it like this and get the 12% weight reduction you wanted.

Just put it right at the beginning of the BaseOre class in Ore.cs, right over the protected virtual CraftResource DefaultResource { get { return CraftResource.Iron; } } and it should work


chatGPT can be your friend if you're trying to figure out how to do something specific like this.
 

Active Shards

Donations

Total amount
$0.00
Goal
$500.00
Back