So the other night i sat down and made the edits to servuo for imbuing. did the little dance and have it working for publish 54 using of course dreamseekers imbuing. from runuo. however on restart it asks to delete armor and i think clothing. this tells me somewhere along the way i have missed serialize or de serialize ... im not sure. if someone knows where to be looking im a bit lost. if replaced on a clean shard it should load fine with those files.
:confused: thanks

shoot i should mention that the zip file in there is the original files. for runuo. its the edit reference.
 

Attachments

  • imbue serv 54.zip
    276.1 KB · Views: 13
Last edited:
Only took a quick glance at the BaseArmor file. First let me add that when adding to Serialize/Deserialize you should always use new version number instead of editing existing versions. Don't expect to share distro scripts where you edited the base version numbers as other people's worlds won't load if you changed the order.

Increase this number 8 by one:
Code:
writer.Write((int)8); // version
Then if you wish to bypass Deserializing code you would do something like this:
Code:
switch ( version )
{
    case 9:
        // New Code
        goto case 5;
    case 8:
        // Old Code
        goto case 5;
This way when someone is loading a world of version 8 it will still load but be saved to the new version 9.



Now on to some of the problems I see. You are writing 'm_TimesImbued' twice here on line 4 and 14 below:
Code:
writer.Write((int)8); // version

#region SF Imbuing
writer.Write((int)m_TimesImbued); // Imbuing

writer.Write((bool)Physical_Modded);
writer.Write((bool)Fire_Modded);
writer.Write((bool)Cold_Modded);
writer.Write((bool)Poison_Modded);
writer.Write((bool)Energy_Modded);
#endregion

// Version 8
writer.Write((int)this.m_TimesImbued);
writer.Write((Mobile)this.m_BlessedBy);

Only gets read once here:
Code:
case 8:
    {
      #region SF Imbuing

        m_TimesImbued = reader.ReadInt();

        Physical_Modded = reader.ReadBool();
        Fire_Modded = reader.ReadBool();
        Cold_Modded = reader.ReadBool();
        Poison_Modded = reader.ReadBool();
        Energy_Modded = reader.ReadBool();
        goto case 5;
    }

You are also missing a read for the 'm_BlessedBy'
Code:
this.m_BlessedBy = reader.ReadMobile();
 
thanks for the info into that i found the second problem that i have then as well. its beacause both armor and cloth scripts have that issue thanks for taking the time
 
No problem. Still haven't had a chance to fully look it over but I took another quick glance at it. I see you also removed all the flags for AOS attributes from BaseArmor Deserialize. Not sure if that was intentional. If it was then use the bypass I showed above. If not then you can add a 'case 9:' for the new stuff still and tell it to 'goto case 8;' for those flags.
 
Ok just looked over the other distro files. I did notice a ton of minor things missing or changed that don't have anything to do with the imbuing system so I'm gonna chalk those up to you customizing these files for your own server.

BaseClothing is the same as above with the TimesImbued but you said you found that one. Still not sure why you removed to AOS flags from BaseArmor Deserialize that I mentioned above but I see you are still writing them with Serialize so maybe this was just a mistake removing it? BaseJewel didn't actually have any changes to it. Besides that all the other Distro files look fine.

If you didn't mean to remove the AOS flag then BaseArmor Deserialize should look something like this:
Code:
switch (version)
{
    case 9:
        {
            #region SF Imbuing
            Physical_Modded = reader.ReadBool();
            Fire_Modded = reader.ReadBool();
            Cold_Modded = reader.ReadBool();
            Poison_Modded = reader.ReadBool();
            Energy_Modded = reader.ReadBool();
            #endregion

            goto case 8;
        }
    case 8:
        {
            this.m_TimesImbued = reader.ReadInt();
            this.m_BlessedBy = reader.ReadMobile();

            SetFlag sflags = (SetFlag)reader.ReadEncodedInt();

            if (GetSaveFlag(sflags, SetFlag.Attributes))
                this.m_SetAttributes = new AosAttributes(this, reader);
            else
                this.m_SetAttributes = new AosAttributes(this);

            if (GetSaveFlag(sflags, SetFlag.ArmorAttributes))
                this.m_SetSelfRepair = (new AosArmorAttributes(this, reader)).SelfRepair;

            if (GetSaveFlag(sflags, SetFlag.SkillBonuses))
                this.m_SetSkillBonuses = new AosSkillBonuses(this, reader);
            else
                this.m_SetSkillBonuses = new AosSkillBonuses(this);

            if (GetSaveFlag(sflags, SetFlag.PhysicalBonus))
                this.m_SetPhysicalBonus = reader.ReadEncodedInt();

            if (GetSaveFlag(sflags, SetFlag.FireBonus))
                this.m_SetFireBonus = reader.ReadEncodedInt();

            if (GetSaveFlag(sflags, SetFlag.ColdBonus))
                this.m_SetColdBonus = reader.ReadEncodedInt();

            if (GetSaveFlag(sflags, SetFlag.PoisonBonus))
                this.m_SetPoisonBonus = reader.ReadEncodedInt();

            if (GetSaveFlag(sflags, SetFlag.EnergyBonus))
                this.m_SetEnergyBonus = reader.ReadEncodedInt();

            if (GetSaveFlag(sflags, SetFlag.Hue))
                this.m_SetHue = reader.ReadEncodedInt();

            if (GetSaveFlag(sflags, SetFlag.LastEquipped))
                this.m_LastEquipped = reader.ReadBool();

            if (GetSaveFlag(sflags, SetFlag.SetEquipped))
                this.m_SetEquipped = reader.ReadBool();

            if (GetSaveFlag(sflags, SetFlag.SetSelfRepair))
                this.m_SetSelfRepair = reader.ReadEncodedInt();

            goto case 5;
        }
// rest of the code...
Serialize should look something like this:
Code:
writer.Write((int)9); // version

#region SF Imbuing
writer.Write((bool)Physical_Modded);
writer.Write((bool)Fire_Modded);
writer.Write((bool)Cold_Modded);
writer.Write((bool)Poison_Modded);
writer.Write((bool)Energy_Modded);
#endregion

// Version 8
writer.Write((int)this.m_TimesImbued);
writer.Write((Mobile)this.m_BlessedBy);
// rest of the code...

BaseClothing should be done the same way. Leave TimesImbued where it is, add a new version and case to add the new Resist Mods lines.
 
May have just messed that up i am going to start over but thanks for the insite. Im going yo try again using your examples' again thanks for the lesson it brought light to alot. :)
 
No problem. I know serialization can be tricky if you don't fully understand it. It's one of those things that has to match up exactly or it will blow up in your face.

Just let me know if you run into anymore problems again with this and I'll point you in the right direction.
 
thanks yall seems my misadventures learning code leave something to be desired in some cases. lol. i do appreciate the help though. my shard in question is a fun way for my daughter and i to play now. i thought imbue would be fun for her as she just loves collecting crap. im going to give the install another whack see what i can f up this timeo_O... lol thanks again:D
 
thanks yall seems my misadventures learning code leave something to be desired in some cases. lol. i do appreciate the help though. my shard in question is a fun way for my daughter and i to play now. i thought imbue would be fun for her as she just loves collecting crap. im going to give the install another whack see what i can f up this timeo_O... lol thanks again:D

I've been working on the same thing. I managed to successfully merge Dreamseeker's Imbuing script with a clean ServUO Pub54 install. So far i've been testing it and can unravel items, imbue armor/weapon/jewelry/clothing. I'm going to release the scripts on here for those who have a clean ServUO install and just want to drag & drop the new files. I want to test it a bit more before I release it though -- I don't wanna miss anything. What I have not tested so far is to see if I can gain skill in imbuing as a player. Also, I went to the Artificer quest givers in Royal City and tried to do the quests but even when I would unravel an item the quest wouldn't register I had any of the mats in my inventory. Neither of the 3 quests would register me having Magical residue, relic fragments, or enchanted essence. All in all though, I think it's a working system.


Edit: I take it back. I am having the same issues as above, though I have went over the serialize/deserialize section of them many times and to me it appears correct according to how Kalamus instructed. I'm going over them several times and still not really seeing where I went wrong. Im going to attach the files that have changes to the serialization/deserialization -- if someone who knows what they're doing could just take a quick glance at that portion of the scripts that would be awesome :)

Edit 2: Fixed now. The problem was just under deserialize the new version was pointing to the wrong case. I tried fiddling with those so many times that I think I was just burnt out on it last night.
 
Last edited:
those are my scripts from a clean server they now work and save properly.
 

Attachments

  • BaseJewel.cs
    31.9 KB · Views: 5
  • BaseClothing.cs
    62.5 KB · Views: 6
  • BaseArmor.cs
    99.2 KB · Views: 7
  • BaseWeapon.cs
    133.1 KB · Views: 5
Awesome, thanks jase, honestly it was just having to change where the deserialize version told it to go for the next case. I was having my baseclothing/weapon point to the wrong case, they were only slightly off and it sent everything out of whack. Thanks!
 
Okay, I was going to post this on the custom releases thread but since I don't have privileges I'll just post it here. Only tested on a clean install of the newest ServUO. Credit goes to Dreamseeker for designing this script, jase griffin and Kalamus for helping me merge it to ServUO. If you have clean install should just be drag & drop. Any problems with it just post here I guess :)
 

Attachments

  • SFImbuingMerge.zip
    168.7 KB · Views: 12
Glad you guys got it working :).


Okay, I was going to post this on the custom releases thread but since I don't have privileges...
In order to post in custom releases you need to use the 'UO Archive' link at the top of the forums. Once you are on that page you then use the 'Add Resource' button on the top right.
 
i am not able to find where i can edit the max property's and max times an item can be imbued can someone help me out with the script to look in
 
It's in Scripts/Services/Runic Reforging, but I don't understand the system quite well enough to help you through it. I can tell you there's tons of literal values scattered throughout the place. And I might have to do a significant re-write if I can't get a handle on these loot generation issues we're having.
 
Back