1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Imbuing Fail.

Discussion in 'Script Support' started by jase giffin, Feb 3, 2014.

  1. jase giffin
    Offline

    jase giffin Active Member

    Joined:
    Sep 14, 2013
    Messages:
    253
    Likes Received:
    72
    Publish Number:
    54
    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.
     

    Attached Files:

    #1 jase giffin, Feb 3, 2014
    Last edited: Feb 3, 2014
  2. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    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 (C#):
    1. writer.Write((int)8); // version
    Then if you wish to bypass Deserializing code you would do something like this:
    Code (C#):
    1. switch ( version )
    2. {
    3.     case 9:
    4.         // New Code
    5.         goto case 5;
    6.     case 8:
    7.         // Old Code
    8.         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 (C#):
    1. writer.Write((int)8); // version
    2.  
    3. #region SF Imbuing
    4. writer.Write((int)m_TimesImbued); // Imbuing
    5.  
    6. writer.Write((bool)Physical_Modded);
    7. writer.Write((bool)Fire_Modded);
    8. writer.Write((bool)Cold_Modded);
    9. writer.Write((bool)Poison_Modded);
    10. writer.Write((bool)Energy_Modded);
    11. #endregion
    12.  
    13. // Version 8
    14. writer.Write((int)this.m_TimesImbued);
    15. writer.Write((Mobile)this.m_BlessedBy);
    16.  
    Only gets read once here:
    Code (C#):
    1. case 8:
    2.     {
    3.       #region SF Imbuing
    4.  
    5.         m_TimesImbued = reader.ReadInt();
    6.  
    7.         Physical_Modded = reader.ReadBool();
    8.         Fire_Modded = reader.ReadBool();
    9.         Cold_Modded = reader.ReadBool();
    10.         Poison_Modded = reader.ReadBool();
    11.         Energy_Modded = reader.ReadBool();
    12.         goto case 5;
    13.     }
    You are also missing a read for the 'm_BlessedBy'
    Code (C#):
    1. this.m_BlessedBy = reader.ReadMobile();
     
    • Informative Informative x 1
  3. jase giffin
    Offline

    jase giffin Active Member

    Joined:
    Sep 14, 2013
    Messages:
    253
    Likes Received:
    72
    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
     
  4. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    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.
     
  5. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    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 (C#):
    1. switch (version)
    2. {
    3.     case 9:
    4.         {
    5.             #region SF Imbuing
    6.             Physical_Modded = reader.ReadBool();
    7.             Fire_Modded = reader.ReadBool();
    8.             Cold_Modded = reader.ReadBool();
    9.             Poison_Modded = reader.ReadBool();
    10.             Energy_Modded = reader.ReadBool();
    11.             #endregion
    12.  
    13.             goto case 8;
    14.         }
    15.     case 8:
    16.         {
    17.             this.m_TimesImbued = reader.ReadInt();
    18.             this.m_BlessedBy = reader.ReadMobile();
    19.  
    20.             SetFlag sflags = (SetFlag)reader.ReadEncodedInt();
    21.  
    22.             if (GetSaveFlag(sflags, SetFlag.Attributes))
    23.                 this.m_SetAttributes = new AosAttributes(this, reader);
    24.             else
    25.                 this.m_SetAttributes = new AosAttributes(this);
    26.  
    27.             if (GetSaveFlag(sflags, SetFlag.ArmorAttributes))
    28.                 this.m_SetSelfRepair = (new AosArmorAttributes(this, reader)).SelfRepair;
    29.  
    30.             if (GetSaveFlag(sflags, SetFlag.SkillBonuses))
    31.                 this.m_SetSkillBonuses = new AosSkillBonuses(this, reader);
    32.             else
    33.                 this.m_SetSkillBonuses = new AosSkillBonuses(this);
    34.  
    35.             if (GetSaveFlag(sflags, SetFlag.PhysicalBonus))
    36.                 this.m_SetPhysicalBonus = reader.ReadEncodedInt();
    37.  
    38.             if (GetSaveFlag(sflags, SetFlag.FireBonus))
    39.                 this.m_SetFireBonus = reader.ReadEncodedInt();
    40.  
    41.             if (GetSaveFlag(sflags, SetFlag.ColdBonus))
    42.                 this.m_SetColdBonus = reader.ReadEncodedInt();
    43.  
    44.             if (GetSaveFlag(sflags, SetFlag.PoisonBonus))
    45.                 this.m_SetPoisonBonus = reader.ReadEncodedInt();
    46.  
    47.             if (GetSaveFlag(sflags, SetFlag.EnergyBonus))
    48.                 this.m_SetEnergyBonus = reader.ReadEncodedInt();
    49.  
    50.             if (GetSaveFlag(sflags, SetFlag.Hue))
    51.                 this.m_SetHue = reader.ReadEncodedInt();
    52.  
    53.             if (GetSaveFlag(sflags, SetFlag.LastEquipped))
    54.                 this.m_LastEquipped = reader.ReadBool();
    55.  
    56.             if (GetSaveFlag(sflags, SetFlag.SetEquipped))
    57.                 this.m_SetEquipped = reader.ReadBool();
    58.  
    59.             if (GetSaveFlag(sflags, SetFlag.SetSelfRepair))
    60.                 this.m_SetSelfRepair = reader.ReadEncodedInt();
    61.  
    62.             goto case 5;
    63.         }
    64. // rest of the code...
    65.  
    Serialize should look something like this:
    Code (C#):
    1. writer.Write((int)9); // version
    2.  
    3. #region SF Imbuing
    4. writer.Write((bool)Physical_Modded);
    5. writer.Write((bool)Fire_Modded);
    6. writer.Write((bool)Cold_Modded);
    7. writer.Write((bool)Poison_Modded);
    8. writer.Write((bool)Energy_Modded);
    9. #endregion
    10.  
    11. // Version 8
    12. writer.Write((int)this.m_TimesImbued);
    13. writer.Write((Mobile)this.m_BlessedBy);
    14. // rest of the code...
    15.  
    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.
     
    • Two Thumbs Up Two Thumbs Up x 1
  6. jase giffin
    Offline

    jase giffin Active Member

    Joined:
    Sep 14, 2013
    Messages:
    253
    Likes Received:
    72
    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. :)
     
  7. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    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.
     
    • Agree Agree x 1
  8. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,430
    Likes Received:
    385
    Had a good laugh with this one and so true!! :)
     
    • Funny Funny x 1
  9. jase giffin
    Offline

    jase giffin Active Member

    Joined:
    Sep 14, 2013
    Messages:
    253
    Likes Received:
    72
    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
     
  10. Denjiki
    Offline

    Denjiki Active Member

    Joined:
    Feb 6, 2014
    Messages:
    173
    Likes Received:
    31
    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.
     
    #10 Denjiki, Feb 8, 2014
    Last edited: Feb 9, 2014
  11. jase giffin
    Offline

    jase giffin Active Member

    Joined:
    Sep 14, 2013
    Messages:
    253
    Likes Received:
    72
    those are my scripts from a clean server they now work and save properly.
     

    Attached Files:

  12. Denjiki
    Offline

    Denjiki Active Member

    Joined:
    Feb 6, 2014
    Messages:
    173
    Likes Received:
    31
    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!
     
  13. Denjiki
    Offline

    Denjiki Active Member

    Joined:
    Feb 6, 2014
    Messages:
    173
    Likes Received:
    31
    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 :)
     

    Attached Files:

  14. jase giffin
    Offline

    jase giffin Active Member

    Joined:
    Sep 14, 2013
    Messages:
    253
    Likes Received:
    72
    We can have this posted for you im sure.
     
  15. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Glad you guys got it working :).


    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.
     
    • Agree Agree x 1
  16. BIGCHIEF
    Offline

    BIGCHIEF New Member

    Joined:
    Jun 19, 2014
    Messages:
    8
    Likes Received:
    1
    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
     
  17. Norman Lancaster
    Offline

    Norman Lancaster Well-Known Member

    Joined:
    Dec 22, 2015
    Messages:
    1,091
    Likes Received:
    108
    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.
     
  18. BIGCHIEF
    Offline

    BIGCHIEF New Member

    Joined:
    Jun 19, 2014
    Messages:
    8
    Likes Received:
    1
    i cant seem to find that script in the server is there any other ideals anyone can through at me
     
  19. Norman Lancaster
    Offline

    Norman Lancaster Well-Known Member

    Joined:
    Dec 22, 2015
    Messages:
    1,091
    Likes Received:
    108
    It's a directory. I am of the opinion now that it is unsafe for production use and will require a re-write.
     
Similar Threads: Imbuing Fail
Forum Title Date
Archived Bug Reports Imbuing resist is different from OSI Jul 23, 2017
Archived Bug Reports Max total imbuing weight of double handed weapons should be 600 Jun 2, 2017
Archived Bug Reports Imbuing weight goes up for 100% elemental damage weapons Mar 5, 2017
Archived Bug Reports Imbuing bug after last patch Feb 10, 2017
Archived Bug Reports Imbuing wrong quest reward Feb 5, 2017
Archived Bug Reports Imbuing system counts Brittle as item property Feb 3, 2017
Script Support Imbuing max properties and weight Jan 31, 2017