This is my first real post here, but figured you guys may be the best to ask since a server I'm helping run is still in it's early stages of content development.

So I had an idea that would reward miners a bit more, but the idea of mine has come to a halt when I tried placing in a chest with a different itemid.

So, while the default chest I was using is itemid 3651 (0xE43), I was wanting it to look more like a rock with a hue difference to help miners differentiate it from other rocks with the knowledge it will be holding additional resources for them to gather. The idea for this is the miners can use these 'chests' to get more resources, but as I have found out most if not all of the itemids that look like rocks will not work in the long run as containers? IDs such as 4970 (0x136A), 2278 (0x08E6), and so on will work as containers if set to spawn with those itemID values on an xmlspawner, but then when someone ported to me they couldn't open the 'chest' at all while on such ids despite the original item still being the wooden chest.

Basically, I spawned a wooden chest with a itemid that is a rock, and the chest stopped functioning as a chest.

Is there a way I can make a custom chest that has such a look that can be opened without issues like the above? I seen on UOFiddler that all of the IDs used for containers and such have the flag for containers checked, but the rocks in question not. Does this mean I will have to do a client side mod for this to work then for how I want it to be?
 
I just fiddled around a bit and ... it seems to be the case that you would have to change the mul file for it to actually work.

But you could also just create a different Gump (not sure if the drag and drop would be possible inside the gump) that gets opened when the container would usually do. A reference on how that could look I guess the univeral keys or tool houses or any other depot tool.
 
with the knowledge it will be holding additional resources for them to gather

So, could you just script a rock that would have a context menu or double-click option allowing them to "claim" resources from it? Like, they walk up to this rock that they can tell is different, and they are wielding a pickaxe, and they double-click the rock, and it says "You smash the rock and find some valuable resources." or whatever. Then it gives them the resources, the rock changes color, and the resource spawn rate determines how fast it will be replenished.
 
Or, when you target that rock with a pickaxe it would throw resources in your pack?
Take a look at HarvestTarget.cs, maybe you can get something like that:

Code:
else if ( m_System is Mining && targeted is HarvestRock )
	 ((HarvestRock)targeted).GatherResources( from );

And in your HarvestRock.cs, having a
Code:
public void GatherResources( Mobile from )
{
	put stuffs here...
}

So it runs the code in that function, where you could give the player resources, i suggest you to take a look at some stock scripts that hand in items to the player, the harvesting system would probably be a bit too complex to "decode" for that purpose.
If you want to test quickly if it works right, put in a
Code:
Console.WriteLine("mining...");
In the method, if it's not getting in the server console, then there's problems.
 
So, could you just script a rock that would have a context menu or double-click option allowing them to "claim" resources from it? Like, they walk up to this rock that they can tell is different, and they are wielding a pickaxe, and they double-click the rock, and it says "You smash the rock and find some valuable resources." or whatever. Then it gives them the resources, the rock changes color, and the resource spawn rate determines how fast it will be replenished.
There is a treasure pile that works like this (LootableTreasurePiles.cs). You double click it and sometimes there is gold and jewels to be collected. Seems like you could do the same with mining.
 
Before you read my responses below, let me just state that I'm not very good at scripting for ServUO. Basically, my best attempts are minor changes, adding a removal system to the property rune system someone ported here, and that's basically it. Mostly minor changes and using what I see before me to the best of my ability. Basically, give me a template and I can work with that is how I roll pretty much with anything scripting related. I don't want to just be handed things, as then I'm not learning but wouldn't mind pushes towards the right areas to look.

So, could you just script a rock that would have a context menu or double-click option allowing them to "claim" resources from it? Like, they walk up to this rock that they can tell is different, and they are wielding a pickaxe, and they double-click the rock, and it says "You smash the rock and find some valuable resources." or whatever. Then it gives them the resources, the rock changes color, and the resource spawn rate determines how fast it will be replenished.
Is this able to be done from the xml spawner stuff? If so, I'll have a look around, though I'm not too experienced.

Or, when you target that rock with a pickaxe it would throw resources in your pack?
Take a look at HarvestTarget.cs, maybe you can get something like that:

Code:
else if ( m_System is Mining && targeted is HarvestRock )
	 ((HarvestRock)targeted).GatherResources( from );

And in your HarvestRock.cs, having a
Code:
public void GatherResources( Mobile from )
{
	put stuffs here...
}

So it runs the code in that function, where you could give the player resources, i suggest you to take a look at some stock scripts that hand in items to the player, the harvesting system would probably be a bit too complex to "decode" for that purpose.
If you want to test quickly if it works right, put in a
Code:
Console.WriteLine("mining...");
In the method, if it's not getting in the server console, then there's problems.
That sounds almost like the system I was trying to create, but aside from visible rocks being there with a gurantee of telling the player what is there, isn't that just the same as normal mining? I don't exactly see how different it is from normal mining outside of just added visual location of resource spawns.


There is a treasure pile that works like this (LootableTreasurePiles.cs). You double click it and sometimes there is gold and jewels to be collected. Seems like you could do the same with mining.
I don't seem to have that file to look at. I have addons, but nothing with that name in my script folders or any folders within the base server files of servUO aside from pile addons that do nothing. From what you've stated, it sounds very close to what I basically was wanting, just it would require a certain amount of mining skill as well.
 
Most of my scripting is really just editing. I take an existing script and change properties, graphics etc. I am not sure how much work would be involved, but this one did sound kind of like what you wanted...it just looks like a treasure pile, and gives gold... both probably easy enough to edit :)

I am not sure where I got it. It is in my "addon" folder, with some decorative treasure piles. I have used it, though. It does work. It may not work exaclty like you want... but might get you going in the right direction?
 

Attachments

  • LootableTreasurePiles.cs
    11.8 KB · Views: 17
Most of my scripting is really just editing. I take an existing script and change properties, graphics etc. I am not sure how much work would be involved, but this one did sound kind of like what you wanted...it just looks like a treasure pile, and gives gold... both probably easy enough to edit :)

I am not sure where I got it. It is in my "addon" folder, with some decorative treasure piles. I have used it, though. It does work. It may not work exaclty like you want... but might get you going in the right direction?
Thanks, I'll take a look into it!
 
Most of my scripting is really just editing. I take an existing script and change properties, graphics etc. I am not sure how much work would be involved, but this one did sound kind of like what you wanted...it just looks like a treasure pile, and gives gold... both probably easy enough to edit :)

I am not sure where I got it. It is in my "addon" folder, with some decorative treasure piles. I have used it, though. It does work. It may not work exaclty like you want... but might get you going in the right direction?
I think those were David's from RunUO - he had some nice scripts :] (I have them also)
 
Back