[Database]Load Skills

11/17/2010 18:30 Syst3m_W1z4rd#1
Well I got some problems loading skills in 5165 with my ini system, if anybody could point me in the right direction?

The save works fine, it saves the skills like this (Im using hybrids ini writer/reader).
But loading nah :S

<Example for fastblade and scentsword>
Code:
[Skill]
Count=0
[0]
ID=1046
Level=4
Exp=0
[1]
ID=1045
Level=4
Exp=0
And my loadcode:
Code:
        public static void LoadSkill(Game.Character C)
        {
            MyIni SkillReader = new MyIni(@"C:\OldCODB\Database\Skills\" + C.Name + ".ini");
            byte count = SkillReader .ReadByte("Skill", "Count", 0);
            for (int i = 0; i < count; i++)
            {
                ushort id = SkillReader .ReadUInt16(i.ToString(), "ID", 0);
                byte level = SkillReader .ReadByte(i.ToString(), "Level", 0);
                uint exp = SkillReader .ReadUInt32(i.ToString(), "Exp", 0);
                C.RWSkill(new Game.Skill() { ID = id, Lvl = level, Exp = exp });
            }
        }
Any help?
11/17/2010 19:33 Basser#2
'Count=0'?
11/17/2010 19:34 Syst3m_W1z4rd#3
It dosn't even call the for loop o.O

and the 0 is default.
is set to 2 for this.

Here is how I call it:
Code:
IDatabase.LoadSkill(GC.MyChar);

Okay nevermind smythe, is fixed :)<3
11/17/2010 20:34 Basser#4
Quote:
Originally Posted by 1337 H4X0R View Post
It dosn't even call the for loop o.O

and the 0 is default.
is set to 2 for this.

Here is how I call it:
Code:
IDatabase.LoadSkill(GC.MyChar);

Okay nevermind smythe, is fixed :)<3
Did my solution work?
Pretty sure the '0' should have been a '2' or '1'.
11/17/2010 21:11 Syst3m_W1z4rd#5
nah it wasnt that.
I changed it from readstring to readuint etc. and worked.