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

Serbo Level System lvl sys 3 update - work but problem with playermobile

Discussion in 'Script Support' started by Aryman30, Jan 14, 2014.

  1. Aryman30
    Offline

    Aryman30 Member

    Joined:
    Jan 2, 2014
    Messages:
    52
    Likes Received:
    1
    Publish Number:
    1
    Today i merge that system from my old runuo. But today when i try to load server i have problem with saves. Every time when i restart the server i see that info and i must delete all players :/

    There is link to orginal post : link

    Code (C#):
    1. Scripts : Compiling C # scripts ... done ( cached)
    2. Scripts : Skipping VB.NET Scripts ... done ( use- vb is enable)
    3. Scripts : Verifying ...
    4. Finished ( 3919 items, 994 mobiles , 11 customs ) (1.41 seconds)
    5. Regions : Loading ... done
    6. World : Loading ... An error was encountered while loading a saved object
    7. - Type: Server.Mobiles.PlayerMobile
    8. - Serial : 0x00000001
    9. Delete the object ? ( y / n)
    10. Delete all objects of That type ? ( y / n)
    11. After pressing return an exception will be thrown and the server will terminate .
    12.  
    13.  
    14. error:
    15. System.FormatException : Index ( with an initial value of zero ) must be
    16. Increase from zero or equal to zero and less than the size of the argument list.
    17.    in System.Text.StringBuilder.AppendFormat ( IFormatProvider provider , String for
    18. mat , Object [] args)
    19.    in System.String.Format ( IFormatProvider provider , String format , Object [] args
    20. )
    21.    in Server.World.Load () wh : \ ServUO -master \ Server \ World.cs : line 844
    22.    in Server.Core.Main (String [] args) in h : \ ServUO -master \ Server \ main.cs : line 59
    23. 0
    24. This exception is fatal , press return to exit
     
    #1 Aryman30, Jan 14, 2014
    Last edited: Jan 14, 2014
  2. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,420
    Likes Received:
    385
    You should post your playermobile script
     
  3. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Looks like you messed up the Serialize/Deserialize portion of the merge. Most likely using wrong version numbers. ServUO's playermobile has a higher version number than that script shows. As Milva said, you should post your playermobile script.
     
  4. Aryman30
    Offline

    Aryman30 Member

    Joined:
    Jan 2, 2014
    Messages:
    52
    Likes Received:
    1
    Ok there is my playermobile.cs script :)
     

    Attached Files:

  5. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    First thing I see is you commented out this in your Deserialize. Any players already saved before this change won't load because you are skipping data that's already stored in your saves.
    Code (C#):
    1. /*  m_LevelExp = reader.ReadLong();
    2.     m_Exp = reader.ReadLong();
    3.     m_Level = reader.ReadInt();
    4.     m_ExpTitle = reader.ReadString();
    5. */
    The next issue I see is that 'm_Level' and 'm_Exp' already exist as part of the Queens Loyalty System. The same variables you are trying to merge in from the Serbo Level System should be called something different so they will not conflict with what is already there.
     
  6. Aryman30
    Offline

    Aryman30 Member

    Joined:
    Jan 2, 2014
    Messages:
    52
    Likes Received:
    1
    But i delete any saves. When i create new character and login to the game and restart server problem are still that same. All of the queen royality system lines are comented out :/
     
  7. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    If you aren't loading previous saves then ignore what I said about those commented lines. Good practice though would be to leave them and create a new version number that reads only what you need and bypasses the older version numbers.

    Anyway, take a look at your Serialize method. It's missing info to write these lines for version 30 that you are trying to read in Deserialize.
    Code (C#):
    1. case 30:
    2.     {
    3.         m_DisplayRaceTitle = reader.ReadBool();
    4.  
    5.         m_RaceType = (Rasa)reader.ReadEncodedInt();
    6.  
    7.         m_KlasaType = (Klasa)reader.ReadEncodedInt();
    8.                
    9.         goto case 29;
    10.     }
     
  8. Aryman30
    Offline

    Aryman30 Member

    Joined:
    Jan 2, 2014
    Messages:
    52
    Likes Received:
    1
    i dont have idea why not work ... :/
    i make serialize for case 31 and still that same :/

    Greetings
     
    #8 Aryman30, Jan 14, 2014
    Last edited: Jan 14, 2014
  9. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    No worries. I'll break it down for you.

    Let's recap on what you currently have.

    Serialize:
    Code (C#):
    1. // ...
    2. writer.Write(31); // version old 28
    3.  
    4. //Level System
    5. writer.Write((int)m_Level);
    6. writer.Write((int)m_MaxLevel);
    7. writer.Write((int)m_Exp);
    8. writer.Write((int)m_ToLevel);
    9. writer.Write((int)m_kxp);
    10. writer.Write((int)m_SKPoints);
    11. writer.Write((int)m_StatPoints);
    12. //End Level System
    13.  
    14. // Version 29
    15. writer.Write(m_GauntletPoints);
    16.  
    17. #region Plant System
    18. writer.Write(m_SSNextSeed);
    19. writer.Write(m_SSSeedExpire);
    20. writer.Write(m_SSSeedLocation);
    21. writer.Write(m_SSSeedMap);
    22. // ...
    Deserialize:
    Code (C#):
    1. // ...
    2. int version = reader.ReadInt();
    3.  
    4. switch (version)
    5. {
    6.     //Level System
    7.     case 31:
    8.     {
    9.         m_Level = reader.ReadInt();
    10.         m_MaxLevel = reader.ReadInt();
    11.         m_Exp = reader.ReadInt();
    12.         m_ToLevel = reader.ReadInt();
    13.         m_kxp = reader.ReadInt();
    14.         m_SKPoints = reader.ReadInt();
    15.         m_StatPoints = reader.ReadInt();
    16.  
    17.         goto case 30;
    18.     }
    19.     //End Level System
    20.  
    21. case 30:
    22. {
    23.     m_DisplayRaceTitle = reader.ReadBool();
    24.     m_RaceType = (Rasa)reader.ReadEncodedInt();
    25.     m_KlasaType = (Klasa)reader.ReadEncodedInt();
    26.                    
    27.     goto case 29;
    28. }
    29. case 29:
    30. {
    31.     m_GauntletPoints = reader.ReadDouble();
    32.  
    33.     m_SSNextSeed = reader.ReadDateTime();
    34.     m_SSSeedExpire = reader.ReadDateTime();
    35.     m_SSSeedLocation = reader.ReadPoint3D();
    36.     m_SSSeedMap = reader.ReadMap();
    37. // ...
    Now everything you read and write must match up exactly or the server won't know how to handle the data.

    Look at this section of your writer:
    Code (C#):
    1. writer.Write((int)m_StatPoints);
    2. //End Level System
    3.  
    4. // Version 29
    5. writer.Write(m_GauntletPoints);
    Now look at this section of your reader:
    Code (C#):
    1.         m_StatPoints = reader.ReadInt();
    2.  
    3.         goto case 30;
    4.     }
    5.     //End Level System
    6.  
    7. case 30:
    8. {
    9.     m_DisplayRaceTitle = reader.ReadBool();
    10.     m_RaceType = (Rasa)reader.ReadEncodedInt();
    11.     m_KlasaType = (Klasa)reader.ReadEncodedInt();
    12.                    
    13.     goto case 29;
    14. }
    15. case 29:
    16. {
    17.     m_GauntletPoints = reader.ReadDouble();
    Your writer jumps from 'm_StatPoints' straight to 'm_GauntletPoints' where you reader has 'm_DisplayRaceTitle', 'm_RaceType', and 'm_KlasaType' between the two former. You are either missing those 3 lines in the writer or they need to be commented out on the reader. My guess is you are missing the writer lines.


    If you are still having problems figuring this out then the Serialize should look something like this:
    Code (C#):
    1. writer.Write(31); // version old 28
    2.  
    3. //Level System
    4. writer.Write((int)m_Level);
    5. writer.Write((int)m_MaxLevel);
    6. writer.Write((int)m_Exp);
    7. writer.Write((int)m_ToLevel);
    8. writer.Write((int)m_kxp);
    9. writer.Write((int)m_SKPoints);
    10. writer.Write((int)m_StatPoints);
    11. //End Level System
    12.  
    13. writer.Write((bool)m_DisplayRaceTitle);
    14. writer.WriteEncodedInt((int)m_RaceType);
    15. writer.WriteEncodedInt((int)m_KlasaType);
    16.  
    17. // Version 29
    18. writer.Write(m_GauntletPoints);
    19.  
    20. #region Plant System
    21. writer.Write(m_SSNextSeed);
    22. writer.Write(m_SSSeedExpire);
    23. writer.Write(m_SSSeedLocation);
    24. writer.Write(m_SSSeedMap);
     
    • Two Thumbs Up Two Thumbs Up x 1
  10. Aryman30
    Offline

    Aryman30 Member

    Joined:
    Jan 2, 2014
    Messages:
    52
    Likes Received:
    1
    still that same :p
     
  11. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Did you delete your saves like you did before? If not you would have to temporarily comment out the whole Case 30 section of your Deserialize to load them, resave, then uncomment those lines back.
     
  12. Aryman30
    Offline

    Aryman30 Member

    Joined:
    Jan 2, 2014
    Messages:
    52
    Likes Received:
    1
    i delete all of the saves, recompile server and up, restart and that same
     
  13. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Try posting your new playermobile.cs again.
     
  14. Aryman30
    Offline

    Aryman30 Member

    Joined:
    Jan 2, 2014
    Messages:
    52
    Likes Received:
    1
    Maybe i need to disable the queen royality on some other scripts ? ( if is somwhere i find it )
     

    Attached Files:

  15. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    You copied some of the same lines back into your Deserialize.
    Code (C#):
    1. case 29:
    2. {
    3.     m_GauntletPoints = reader.ReadDouble();
    4.  
    5.     m_SSNextSeed = reader.ReadDateTime();
    6.     m_SSSeedExpire = reader.ReadDateTime();
    7.     m_SSSeedLocation = reader.ReadPoint3D();
    8.     m_SSSeedMap = reader.ReadMap();
    9.  
    10.     m_SSNextSeed = reader.ReadDateTime();
    11.     m_SSSeedExpire = reader.ReadDateTime();
    12.     m_SSSeedLocation = reader.ReadPoint3D();
    13.     m_SSSeedMap = reader.ReadMap();
    You need to delete 4 of those lines:
    Code (C#):
    1. m_SSNextSeed = reader.ReadDateTime();
    2. m_SSSeedExpire = reader.ReadDateTime();
    3. m_SSSeedLocation = reader.ReadPoint3D();
    4. m_SSSeedMap = reader.ReadMap();
     
    • Two Thumbs Up Two Thumbs Up x 1
    • Winner Winner x 1
  16. Aryman30
    Offline

    Aryman30 Member

    Joined:
    Jan 2, 2014
    Messages:
    52
    Likes Received:
    1
    sucess !! now it work !
     
  17. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
Similar Threads: Serbo Level
Forum Title Date
Custom Releases Serbo Level System Apr 15, 2017
Archived Bug Reports Conflicting Virtue Level Formulas Aug 1, 2017
Archived Bug Reports Arcane Circle - Used to only be level 6 in Prism of Light but now also Britain bank Jul 14, 2017
ServUO Tutorials AccessLevel Tutorial [Deleted] Jun 17, 2017
Script Support AccessLevel override on a command. Jan 17, 2017
Archived Bug Reports Dungeon Shame - why cant players access level two? Dec 20, 2016
General Discussion Character Leveling Sep 11, 2016