Here's a test text command that should print out the number of armor zones and a list of all of the zone names:
Code:
use uo;
use os;
use cfgfile;
program TestRead(character, textcmd)
var cfg_file := ReadConfigFile("::armrzone");
var cfg_keys := GetConfigStringKeys(cfg_file);
// Only prints out 1!
SendSysMessage(character, "Armor zones: " + cfg_keys.size());
var zones := "";
foreach zone in cfg_keys
zones := zones + " " + cfg_file[zone].Name;
endforeach
// Only prints out "Body"!
SendSysMessage(character, "Zones:" + zones);
endprogram
Only the first zone is loaded, and the rest are ignored. However, it works fine if I give the elements names. Why not simply load all of the elements with "" for their name instead of only loading the first one?
By the way, this took me a LONG time to figure out. I almost died.
Solution
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 354 Location: San Diego, California
Posted: Fri May 05, 2006 7:05 pm Post subject: Solution
Code:
ArmorZone Body
{
Name Body
Chance 44
Layer 13
Layer 20
Layer 22
Layer 5
Layer 17
}
Maybe if they didn't end all days with "y", eh? I think if you took beer out of the world, 80-90% of all open source projects would be finished in about a week.
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 354 Location: San Diego, California