Cfgfile.em suggestions
Posted: Mon Jan 29, 2007 4:10 pm
Not sure if these have been suggested already, and to be honest, I'm moving to another server platform anyway, but I had always found these lacking in POL before so thought I would suggest them for it's improvement.
A way to get all the properties in a given cfg element without necessarily knowing the names of those properties.
Ie, a : GetConfigPropertyNames(cfgelemref) which returns an array of the names of all the elements for that element reference.
A way to get the type of the config element.
Ie, a : GetConfigElemType(cfgElemRef) which returns a string, which is the type of the config element.
These are useful for when you want to do generic rebuildings of config files, which is something you might want to do for various reasons, though the one that comes to mind is when you are shifting art/items from one ID to another, and want to run a script which scans through various config files, and writes out new versions of them by changing the ID's for those items that are getting moved. Since you don't know the type(you could be reading a variety of cfg files with different types), and since there is no way to get the elem type via script that I know of, the GetConfigElemType would be useful in reconstructing the cfg file. Also, since you don't know what the property names are, GetConfigPropertyNames allows you to get all the property names for that given element, and then you can use those names to ask for the values and from there rebuild that element with the new IDs.
If there are ways to do this already, I would love to hear how. But if not, it might be useful to add in some future version of POL at some date.
A way to get all the properties in a given cfg element without necessarily knowing the names of those properties.
Ie, a : GetConfigPropertyNames(cfgelemref) which returns an array of the names of all the elements for that element reference.
A way to get the type of the config element.
Ie, a : GetConfigElemType(cfgElemRef) which returns a string, which is the type of the config element.
These are useful for when you want to do generic rebuildings of config files, which is something you might want to do for various reasons, though the one that comes to mind is when you are shifting art/items from one ID to another, and want to run a script which scans through various config files, and writes out new versions of them by changing the ID's for those items that are getting moved. Since you don't know the type(you could be reading a variety of cfg files with different types), and since there is no way to get the elem type via script that I know of, the GetConfigElemType would be useful in reconstructing the cfg file. Also, since you don't know what the property names are, GetConfigPropertyNames allows you to get all the property names for that given element, and then you can use those names to ask for the values and from there rebuild that element with the new IDs.
If there are ways to do this already, I would love to hear how. But if not, it might be useful to add in some future version of POL at some date.