First, great thanks to Hoz (and everyone) for this script. VERY cool.
Second, sorry for the thread-necromancy.
Anyway, I've been using it to familiarize myself with several things - getting arrays from configs and creating functions.
In working through this function/script, I am confused by something. This part doesn't seem to work quite properly when I run it.
_cfgTowns=(configFile >> "cfgWorlds" >> WorldName >> "Names");
...
_cfgPath = _cfgTowns select _i;
_typecity = getText (_cfgPath >> "type");
if ((_typecity == "NAMECITY") || (_typecity == "NAMEVILLAGE") || (_typecity == "NAMECITYCAPITAL")) then
{
_towns Set [_i,[getText (_cfgPath >> "name"),getArray (_cfgPath >> "position")]];
};
_ntowns = count _towns;
When run on Sarahni, the initial _ntowns array brings back ~250 entries. Some of which throw errors. I narrowed it down, for example, to element 13 (base 0, the 14th item in the config entry). That element is:
class Forest_SelvaDeCresta {
name = "Selva De Cresta";
position[] = {7475, 16815};
type = "VegetationFir";
radiusA = 100;
radiusB = 100;
Clearly, that isn't a "city" type.
The errors don't stop the script, but are annoying.
Any help would be greatly appreciated.