Hammerhand

Member
I have a bit of a hair puller for an issue here. I've been trying to fix an OWLTR/Master Storage/Runics problem that doesnt seem to want to BE fixed.. I've decided to get rid of the Runics storage deed part of it & just allow the runics to be stored in the Tool Storage itself since they want to be there anyway. Now heres the problem. The default runics arent storing properly. The ones I created for Daat99 for the latest OWLTR show just fine, but they arent the ones that you get from completing large smith BODs or get off mobs. The pic shows what happens when they stored. The default runics only shows as Runic Hammer or Runic Sewingkit & cannot be extracted... they delete instead. The OWLTR ones show properly & can be extracted, but you dont get them ingame without Staff using [add runic. I want to just remove the OWLTR runics & use the default ones if at all possible. So, after twisting, pulling, hammering, yanking and tweaking all I've managed is to start pulling my hair out.. Any suggestions or help (especially help) would be greatly appreciated. Enclosed is the ToolStorage.cs

Runic Test.jpg
 

Attachments

  • ToolStorage.cs
    2.6 KB · Views: 4
Well, first thing I notice is that you say Runic Hammers delete when you extract them. Usually, that is because the script creating them does not properly remember their craft resource and call the correct constructor to generate the item. Runic Hammers do not have an empty or default constructor. They must be made with a Craft Resource parameter, and preferably with the remaining uses also.

Can you post the gump you are using that made the picture you show? It's not the default daat99 OWLTR gump, right?
 
That would be the MasterStorage gump. Here it is. It also stores the Ancient Smithy hammers almost correctly (doesnt show the skill mod), but deletes them as well on extraction, most likely due to the SkillMod in them. But that could be something for later.
 

Attachments

  • MasterStorageGumps.cs
    20.4 KB · Views: 2
This is not like any storage system I have used. I think there are pieces to the puzzle that I still do not have. Perhaps the script depends on much more than these 2 scripts. In any case, let's back up for a second.

1. What was the script originally intended to do? (was it for holding currency - that seems to be what I was looking at in the Gump.)

2. If so, where is the modified version that holds runics? I am not able to tell from the script you posted how it can even do that?

3. Was any part of it working as intended at any time? When did it break?
 
The item storage section of the MasterStorageGumps.cs starts on line 101 with the private void init & (I think) ends on line 249. The ToolStorage.cs is setup to hold all items with UsesRemaining coding. I'm uploading the entire MasterStorage system for you to look at. It originally had a RunicStorage deed with it, but with the runics going into the Tool storage due to the UsesRemaining, I'm just getting rid of it. The system never did store the default runics properly, just the added in ones I created for it. But with those not being part of the BOD rewards system or dropping on any mobs, the only way players would get them is from staff. It stores tools & all sorts of other items with the various deeds, but the runics unfortunately, never did work. This is from OWLTR 3.01 that daat99 & I released a few years back. He's been incommunicado for a while now with his work, so I'm having to seek help elsewhere. He just ran out of available time to work on it & made me lead dev last year. If the runics cant be stored, then they cant be stored. I've just been hoping they could be without a major rewrite. I've been adding in various fixes from the past few years & working on new BODs as well. Once its done, I'll be releasing it for both RunUO & ServUO.
 

Attachments

  • MasterStorage.rar
    32 KB · Views: 5
Line 357 in MasterStorageUtils.cs:

item = Activator.CreateInstance(type) as Item;

This will not work unless you are using a non-parameterized constructor. To create the item properly, you will need to call the constructor that will properly create the item. To do that, you will need to most likely have additional methods that first check to see what Type is being created. If the type is a "typeof(BaseRunic)" then you need to construct it as such, which means you will need to store the constructor parameters somewhere so you can recall them. You might want to use the Invoke method.
 
And this is why I tried to tell Daat99 that I didnt feel that I was up to the challenge of being lead dev. I know some C#, but not enough in my opinion. What you posted is basically confusing to me. I think I understand what needs to be done, but have little to no idea how to do it. Starting to look like making the runics I created for this version of OWLTR be called & created by the BOD system would be easier and I'm not even sure how to do that.

Am I correct in thinking that the type check would be something along the lines of ?
Code:
( typeof( RunicHammer ), CraftResource.DullCopper, "Dull Copper");
And then some sort of library to hold the parameters?
I'm just guessing here. And I've also been up for 24 hours trying to get my sleep schedule back on track after a temp shift change. My mind is getting a bit fuzzy & sluggish, but I'm still trying. I'm just woefully lacking in C# knowledge, but it hasnt kept me from trying.
 
Minimum, you would need to store:

Type
CraftResource

Optionally, but recommended, store Number of Uses remaining for each runic saved. You can reconstruct the runic without this, but it would be foolish as the number of uses would be lost.

Since each item should have a unique Serial number, you can store these variables in a Dictionary by Serial value, or in a Hashtable of Structs or something.
 
Technically, you might be able to store items in the same way Mobiles and Containers store items, using a generic List<Item>. I am not sure if that would be easier or more difficult. The more I think about this, the more I think that would be the simplest method.
 
OK. So, I dreamed about this. I really think a generic List is the way to go. I will look at this more later today. Meanwhile, have you looked at Fenn's Universal Storage Key system?
 
Yeah, I'm familiar with it. I just want to keep the Master Storage system like it is if at all possible. With the storage deeds, everything is in 1 backpack with no added item count or weight no matter how many items there are due to the virtual nature. The only time the player gets any added items or weight in their backpack is when they extract items from storage. I'm also looking at the older OWLTR's Runic House for ideas. It has the combine coding to combine the uses & runics both. It also works fine with OWLTR 3.01 with 1 minor adjustment. But again, I wanted to keep the storage system as is if possible & with the runics going into the ToolStorage anyway, I need to get that gump to show them properly.
 
I am not able to get that first gump to come up at all. I think it's because the context menu does not appear because there are no items added, but how do you add items before the gump comes up? Catch 22?

I have tried looting, I have tried dropping items in the backpack. When I refill from stock, it does not add anything from my pack except gold.
 
Just lifted this from OWLTR on runuo- hope this helps :)
You won't see the storage gump until you use a storage deed.
 
Guess I should have mentioned that, huh? The deeds create the storage itself, then just click on the MasterStorage pack, then Inventory. I really need to try sleeping more. My mind is about 1/2 mush.. or something similiarly gooey.. :confused:
 
I just tried something I should have tried a long time ago. I deleted my MasterStorage pack & created a new one, then added the Runic Storage to it only. The Default runics show as they should. So now it looks like the only thing that actually needs to be done is somehow block them from the Tool Storage. Oddly enough, it continues to work properly with the ToolStorage added afterwards, even after a save. But they still continue to show in Tool storage & not runic.
 
Can you give me what you are using now. The RAR file you posted before did not have any edits done. I am not sure if the RunicStorage is the only one I am missing.
 
OK. So evidently you have a new method called "GetCraftableType()" in BaseRunicTool. This is similar to what I was just thinking about, namely, making a separate Type for each Runic type, for example, IronRunicHammer, VeriteRunicHammer, etc. Is that what you ended up doing?
 
OK, here is what I came up with, which is probably similar to what you had:

In BaseRunicTool.cs, I added this method:

Code:
        public Type GetCraftableType()
        {
            switch (Resource)
            {
                case CraftResource.AshWood:
                    return this is RunicFletcherTool ? typeof (AshRunicFletcherTool) : typeof (AshRunicDovetailSaw);
                case CraftResource.Bloodwood:
                    return this is RunicFletcherTool ? typeof(BloodwoodRunicFletcherTool) : typeof(BloodwoodRunicDovetailSaw);
                case CraftResource.Frostwood:
                    return this is RunicFletcherTool ? typeof(FrostwoodRunicFletcherTool) : typeof(FrostwoodRunicDovetailSaw);
                case CraftResource.Heartwood:
                    return this is RunicFletcherTool ? typeof(HeartwoodRunicFletcherTool) : typeof(HeartwoodRunicDovetailSaw);
                case CraftResource.OakWood:
                    return this is RunicFletcherTool ? typeof(OakRunicFletcherTool) : typeof(OakRunicDovetailSaw);
                case CraftResource.RegularWood:
                    return this is RunicFletcherTool ? typeof(RegularRunicFletcherTool) : typeof(RegularRunicDovetailSaw);
                case CraftResource.YewWood:
                    return this is RunicFletcherTool ? typeof(YewRunicFletcherTool) : typeof(YewRunicDovetailSaw);
                case CraftResource.Agapite: return typeof (AgapiteRunicHammer);
                case CraftResource.Bronze: return typeof(BronzeRunicHammer);
                case CraftResource.Copper: return typeof(CopperRunicHammer);
                case CraftResource.DullCopper: return typeof(DullCopperRunicHammer);
                case CraftResource.Gold: return typeof(GoldRunicHammer);
                case CraftResource.Iron: return typeof(IronRunicHammer);
                case CraftResource.ShadowIron: return typeof(ShadowIronRunicHammer);
                case CraftResource.Valorite: return typeof(ValoriteRunicHammer);
                case CraftResource.Verite: return typeof(VeriteRunicHammer);
                case CraftResource.RegularLeather: return typeof (RegularRunicSewingKit);
                case CraftResource.BarbedLeather: return typeof(BarbedRunicSewingKit);
                case CraftResource.HornedLeather: return typeof(HornedRunicSewingKit);
                case CraftResource.SpinedLeather: return typeof(SpinedRunicSewingKit);
                case CraftResource.None:
                default:
                    return null;
            }
        }

And I created the types in the 4 files in the attached zip.
 

Attachments

  • New Types.zip
    2.2 KB · Views: 15
I had actually created runic files for OWLTR 3.01 to go with the default ones. They are in the New folder in a folder called Hammerhand (daat99 named it). And in the BaseRunicTool.cs we already have
Code:
		//daat99 OWTLR start - runic storage
		public virtual Type GetCraftableType()
		{
			return null;
		}
		//daat99 OWTLR end - runic storage
The blankness of it is because of the default runics in RunUO having runics for the DoveTailSaw, SmithyHammer, SewingKit, FletcherTool & TinkerTool. The Tink & Smithy both using ingots & DoveTailSaw & FletcherTool both using Woods created errors for "already named" in the cases. ie:
Code:
				case CraftResource.DullCopper:
					return typeof(DullCopperRunicHammer);
and
Code:
                case CraftResource.DullCopper:
                    return typeof(DullCopperRunicTinkerTools);
The same being for the DoveTailSaw & FletcherTool
All of the default runic files have the GetCraftableType in them as well for their type.
Enclosed are the runics files I created for OWLTR.
 

Attachments

  • Hammerhand.rar
    2.7 KB · Views: 8
If I change
Code:
		public override bool IsTypeStorable(Type typeToCheck, bool canBeEqual)
		{
			return false;
		}
in RunicStorage from false to true, the runics show in RunicStorage like they should, but so does everything else which they shouldnt.
*edit*
Ok.. partial success at last. I now have the RunicStorage showing the runics & NOT storing other tool types if no ToolStorage is present.... But.. runics are still showing in ToolStorage once its added. Most likely due to the IUsesRemaining, but using BaseTool wont help because BaseRunicTool inherits from BaseTool.
I simply removed the above public override bool & replaced it with the one coding chunk from ToolStorage.cs
Code:
        public override bool IsTypeStorable(Type typeToCheck)
        {
            //  Console.WriteLine("Tool type: {0}, result: {1}, runic type: {2}, 2nd check: {3}", typeToCheck, typeToCheck != typeof(BaseRunicTool), typeof(BaseRunicTool), typeToCheck.IsAssignableFrom(typeof(BaseRunicTool)));
            return isValid(typeToCheck) && base.IsTypeStorable(typeToCheck);
        }
        public override bool IsTypeStorable(Type typeToCheck, bool canBeEqual)
        {
            return isValid(typeToCheck) && base.IsTypeStorable(typeToCheck, canBeEqual);
        }
        //allow only IUsesRemaining items that aren't runic tools
        private bool isValid(Type typeToCheck)
        {
            return typeToCheck != typeof(BaseRunicTool);// && typeToCheck.GetInterface("IUsesRemaining") != null;
        }
So.... MUCH closer to what I'm wanting. :D Now the only thing left with this is keeping ToolStorage from showing the runics if possible. If not, I'm thinking it may be ok. Because with the RunicStorage now showing the runics as intended, 2/3 of the battle is won in my opinion. Then on to a couple other issues with storage.
 
Last edited:
Back to the bashing the forehead on the keyboard trying to solve the Runic/ToolStorage situation. But at least they show properly now. 1 hurdle down... 47 to go... roughly.. :D
 
To solve the problem of ToolStorage not showing Runics, you could just change the DefaultTypes. Instead of using IUsesRemaining, list each of the types like was done with all the other storage types. It's a bit messier, but it should do the trick.
 
Lots of slow typing later (I never really learned how to type & I make lots of mistakes) I got it working. Runics now only show in RunicStorage. Now on to the other issues (to be posted in new threads). :D Thankyou so much Lokai!
 
Oh they extract just fine. Once I got them to show properly, they extracted as well. What gets deleted upon extraction now is the Ancient Smithy Hammer, most likely due to the SkillMods (a whole new kettle of fish). It shows the name properly (AncientSmithyHammer) & the uses, but wont extract. It will "extract" 100 uses (with it set to withdraw 100) & says unable to extract, leaving you with 100 less uses. Extracting the full 600 uses gets you the unable to extract message & no tool in storage.
*Edit*
Correction... with the Runic/ToolStorage issue sorted out by using the various tool types instead of IUsesRemaining, the ASH doesnt store, so that is now a non issue. So that just leaves 2 issues (that I know of) concerning the storage system.
 
Last edited:
*sigh* Fix one thing & another breaks.... Now that the RunicStorage is working properly, the tool storage isnt storing Pickaxe's & Shovels (which is probably why daat99 settled on the IUsesRemaining in the 1st place). I've tried typeof(BaseHarvestTool), typeof(Pickaxe) & typeof(Shovel) and nada. Add 1 to the list of fixes I guess.. *grumble*
 
*Unbroken* I fixticated it! Pickaxes, Shovels, Prospectors Tools... even GargoylePickaxes store now.... the sturdy picks & shovels as well. (does a happy dance) *aHEM..... looks around... nobody saw that, right?* :D

Just 5 more known issues to go... *sigh*
 
i noticed that the runics are not named right if you go into the elementals and change the names to the correct ones that should fix problem
from
case 2: { if (b_Tinker == true) PackItem( new RunicTinkerTools( CraftResource.DullCopper, 5 ) );
to
case 2: { if (b_Tinker == true) PackItem( new DullCopperRunicTinkerTools( ) );
bad thing is that it will now give the set amount of uses that is listed in the runic tools script mine shows 50, but i just changed that since i want runics to be a valued item so i set it to 5
 
Last edited:
The runics are named properly. The reason you're seeing things like RunicHammer in your runic storage is because that runic storage is broken. The fix I posted earlier in this thread has them storing and showing properly in Runic Storage. And I have them no longer showing up in ToolStorage as well.
 
reading your previous post i didnt realize that there was so many problems with the storage. it seems like ever since i decided to create my own shard all i have done is fix bugs and i have only a few players letting me know when they find bugs
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back