Your declaration of
CreateArray wouldn't work since the declaration's first argument determines the number of values it can hold in one array entry (and functions don't allow for arguments after the closing parenthesis). The size of the
adt_array is dynamic and the initial size is the second argument. I wouldn't recommend using it for your particular use case.
You could do nested
adt_trie so you could just read keys out, but you'd still have to deal with
iterating through the KeyValues to put them into each trie.
Out of curiosity, why not just use the KeyValues directly? Since you know exactly what keys you're working with, you can
use forward slashes to read a value from a subkey.
Assuming transitional syntax:
Code:
KeyValues kv = new KeyValues("Locations");
kv.ImportFromString(keyvalue_data_from_post);
// Read tlocx from Surf section
int tlocX = kv.GetNum("Surf/tlocx");
(Also, assuming the configuration file uses your own schema, you can also use
kv.GetVector to read a float[3] instead of storing the individual (x, y, z) values.)
__________________