I created this for a Gamemode I was making, I never really did finish it. You can see how I loaded the variables in.
function HeroAttack::LoadHeroes(%client)
{
%fo = new FileObject();
%FirstFile = FindFirstFile("./Heroes/*.sav");
%File = %FirstFile;
while(%File !$= "")
{
%fo.openforRead($HeroAttack.FilePath @ "/Heroes/" @ fileBase(%file) @ ".sav");
%i = 1;
while(!%fo.isEOF())
{
%fo.line[%i] = %fo.readline();
%i++;
}
%heroname = getword(%fo.line1,1);
$HeroAttack.Hero[%heroname] = true;
$HeroAttack.Hero[%heroname,"Occupied"] = false;
$HeroAttack.Hero[%heroname,"Description"] = getwords(%fo.line2,1, getwordcount(%fo.line2));
$HeroAttack.Hero[%heroname,"Job"] = getword(%fo.line3,1);
$HeroAttack.Hero[%heroname,"Attribute"] = getword(%fo.line4,1);
$HeroAttack.Hero[%heroname,"PlayerType"] = getword(%fo.line5,1);
$HeroAttack.Hero[%heroname,"Scale"] = getwords(%fo.line6,1,3);
$HeroAttack.Hero[%heroname,"MaxHealth"] = getword(%fo.line7,1);
$HeroAttack.Hero[%heroname,"MaxMana"] = getword(%fo.line8,1);
$HeroAttack.Hero[%heroname,"Attack"] = getword(%fo.line9,1);
$HeroAttack.Hero[%heroname,"Armor"] = getword(%fo.line10,1);
$HeroAttack.Hero[%heroname,"NormalAttack"] = getword(%fo.line11,1);
$HeroAttack.Hero[%heroname,"Skill1"] = getwords(%fo.line12,1, getwordcount(%fo.line12));
$HeroAttack.Hero[%heroname,"Skill1Description"] = getwords(%fo.line13,1, getwordcount(%fo.line13));
$HeroAttack.Hero[%heroname,"Skill2"] = getwords(%fo.line14,1, getwordcount(%fo.line14));
$HeroAttack.Hero[%heroname,"Skill2Description"] = getwords(%fo.line15,1, getwordcount(%fo.line15));
$HeroAttack.Hero[%heroname,"Skill3"] = getwords(%fo.line16,1, getwordcount(%fo.line16));
$HeroAttack.Hero[%heroname,"Skill3Description"] = getwords(%fo.line17,1, getwordcount(%fo.line17));
$HeroAttack.Hero[%heroname,"Skill4"] = getwords(%fo.line18,1, getwordcount(%fo.line18));
$HeroAttack.Hero[%heroname,"Skill4Description"] = getwords(%fo.line19,1, getwordcount(%fo.line19));
$HeroAttack.Hero[%heroname,"Skill5"] = getwords(%fo.line20,1, getwordcount(%fo.line20));
$HeroAttack.Hero[%heroname,"Skill5Description"] = getwords(%fo.line21,1, getwordcount(%fo.line21));
%fo.close();
%FileName[%FileCount++ - 1] = fileBase(%File);
%File = FindNextFile("./Heroes/*.sav");
}
%fo.delete();
}