ServUO Version
Publish 57
Ultima Expansion
Endless Journey
So I just encountered an issue with FS ATS, the Bioengineering Bool for my Player Mobile is not saving so on reload all players who have learned the book have to relearn it. I checked and the Ser/Des seem to be in order but it's just not saving, no errors or anything.. would someone better than me mind taking a look at it for me..


And once again I was able to solve this.. I ended up using a new player flag for Bioenginer,
C#:
Bioenginer = 0x008000001,
and replacing the old bool:
C#:
        public bool Bioenginer
        {
            get { return m_Bioenginer; }
            set { m_Bioenginer = value; }
        }
with the following:
C#:
        public bool Bioenginer
        {
            get { return GetFlag(PlayerFlag.Bioenginer); }
            set { SetFlag(PlayerFlag.Bioenginer, value); }
        }
 

Attachments

  • PlayerMobile.cs
    193.9 KB · Views: 1
Last edited:
And once again I was able to solve this.. I ended up using a new player flag for Bioenginer,
C#:
Bioenginer = 0x008000001,

The number you used for your flag isn't proper and may cause issues.
Flags follow a progression by the power of 2, and are represented in hex generally so that they line up 1, 2, 4, 8 repeated so you don't have to do math to add to them. (0x80000000 = 2147483648)

the progression is like this:
0x00000000,
0x00000001,
0x00000002,
0x00000004,
0x00000008,
0x00000010,
0x00000020,
0x00000040,
0x00000080,
0x00000100,
0x00000200,
0x00000400,
0x00000800,
ect...... moving left one digit each time after reaching 8
0x10000000,
0x20000000,
0x40000000,
0x80000000,
 
Ahh I see, good to know! I will correct that then.
So the next in line looks like it would be 10, would that then be:
1x00000000 ?
 
Last edited:
the 0x lets it know the number is hex and wouldn't work

if your player flags are from after they were changed from int to ulong
can tell by the first line of the player flags
public enum PlayerFlag : ulong

then you could continue on the progression by adding another 0 and continuing the pattern
0x80000000,
0x100000000,
0x200000000,
0x400000000,
0x800000000,

the max for a ulong in this case would be:
0x800000000000000
 
Ahhhh see this is why I ask haha, would have definitely broken something. :)
the 0x lets it know the number is hex and wouldn't work

if your player flags are from after they were changed from int to ulong
can tell by the first line of the player flags
public enum PlayerFlag : ulong

then you could continue on the progression by adding another 0 and continuing the pattern
0x80000000,
0x100000000,
0x200000000,
0x400000000,
0x800000000,

the max for a ulong in this case would be:
0x800000000000000
Nope no ulong on mine..
 
Last edited:
Back