My script is working
In fact it turned out even better than I originally planned and it can be used for way more than just placing tags in groups.
When the DLL is updated and requires updated XML file(s), all the modder has to do is:
- Run update_MOD.pl
This copies the schema files from the DLL into the mod
- Run tagUpdate.pl
This will update the XML files to fit the new schema files
That's it. The only thing, which can go wrong is tag renaming. If a tag is renamed, it will be viewed as obsolete and deleted. It will then insert a new empty tag in the new name. We might need a tag renaming script or we can just avoid renaming.
Optional tags containing 0, nothing or NONE will be removed. (I wonder if we have non-zero defaults in the DLL

)
Non-optional tags, which aren't present will be added with
Code:
<Tag>!!! MISSING !!!</Tag>
Another bonus is that since the tags are reordered according to the schema file, modders can add new tags whereever they want in the info class as long as it is at top level or top level of a group. Running tagUpdate.pl will then move the newly added tag to the correct location and taking great care of tag ordering when adding new ones is a thing of the past.
Issues:
The script setup is horrible. I want some autoconfiguring setup. I want to change it to something, which will not need to be updated.
Plan: give it all the schema files. It will then work on all XML files in the same locations as the schema files. No need to update just because we add a new XML file.
That just leaves one issue: how does it know which elements are groups, it should pay special attention to? Right now it lists all of them, but I want it to be automatic.
Question:
Let's use one of the existing group names as an example
Code:
CivicGroupGrowthImmigration
I have come up with the idea to rename it to
Code:
[B]SmartGroup[/B]CivicGrowthImmigration
The idea is that the script will trigger on all elements, which name starts with
SmartGroup. That will be self configuring (sort of) and fairly easy to understand.
The question is if I picked a good name. I'm not sure. Maybe it should be
TagGroup or something. It has to sound right and tell what it is all about and at the same time be generic enough to fit all XML files, not just civics. Any ideas?