If editing XML in the data module is anything like editing XML in the UI module, NOPE!
The UI module is extremely buggy and constantly undoes my changes and even deletes layout files when I rename them. I suspect the XML editor in the data module has the same type of issues.
So I'm trying to copy all of the changed units from the official balance test mod into a separate map as separate, independent units and I've spent about 8 hours in total (over the course of two weeks) trying to debug various issues after copying just one unit, the infestor, and all of its associated abilities/effects/etc that were changed.
I've battled with UI glitches such as actor terms randomly being replaced by messages(!) when I edit them, as well as copy-n-paste bugs, like specific fields not being copied (e.g. button hotkeys), and other strange bugs, like the infestor's deep tunnel ability being replaced by the burrow/unburrow abilities after I had duplicated those (and being unable to fix it without reopening the map because I couldn't select the ability command for the Deep Tunnel button on the command card).
And now I've finally conquered all of those bugs and I've got two entirely independent, functional ingestors. Whew! I think it's safe to say that now that I've accomplished this, and learned some of the traps that the editor sets for you, copying the rest of the balance test changes should be relatively easy (which is not to say it won't be time-consuming - I'm going to have to double-check everything manually from now on). I deliberately chose to attempt to copy the infestor first because it seems like the most complicated unit, what with being able to morph, move while burrowed, cast spells and all, so I could gauge how viable my idea was and whether I could do it.
Now to get to my actual concern...
The last bug I had to fix had eluded me for quite some time and it was caused by one little, missing exclamation mark.
In the official Balance Test Mod v1.33, the infestor's actor has three event definitions that look like this:
The terms here all begin with a "!" which negates the normal result. If the validator returns true, the term returns false, and vice versa. This is pretty easy to understand and familiar to anyone who has learned a little bit of programing or boolean logic. However, the problem is that there's no apparent way to add this exclamation mark in the editor unless you edit with "View Raw Data" enabled.
Furthermore, if you edit a term like this in the GUI, such as changing the validator, it'll remove that exclamation mark. This tripped me up so hard because I had to replace all of the validators with new ones (e.g. IsInfestorBurrowedBalanceTest), and I even duplicated the "NotInfestor" and "NotInfestorBurrowed" validators, but I just blindly replaced all of the original validators with the equivalent ones and didn't notice the exclamation marks disappearing. So actually I needed to use the opposite validators, which I eventually did to fix the bugs I was seeing in-game.
TL;DR Blizzard apparently edits actor events in raw mode and uses exclamation marks to negate the results of terms, and that exclamation mark operator isn't supported in the GUI and gets silently erased if you make any edits.
If editing XML in the data module is anything like editing XML in the UI module, NOPE!
The UI module is extremely buggy and constantly undoes my changes and even deletes layout files when I rename them. I suspect the XML editor in the data module has the same type of issues.
So I'm trying to copy all of the changed units from the official balance test mod into a separate map as separate, independent units and I've spent about 8 hours in total (over the course of two weeks) trying to debug various issues after copying just one unit, the infestor, and all of its associated abilities/effects/etc that were changed.
I've battled with UI glitches such as actor terms randomly being replaced by messages(!) when I edit them, as well as copy-n-paste bugs, like specific fields not being copied (e.g. button hotkeys), and other strange bugs, like the infestor's deep tunnel ability being replaced by the burrow/unburrow abilities after I had duplicated those (and being unable to fix it without reopening the map because I couldn't select the ability command for the Deep Tunnel button on the command card).
And now I've finally conquered all of those bugs and I've got two entirely independent, functional ingestors. Whew! I think it's safe to say that now that I've accomplished this, and learned some of the traps that the editor sets for you, copying the rest of the balance test changes should be relatively easy (which is not to say it won't be time-consuming - I'm going to have to double-check everything manually from now on). I deliberately chose to attempt to copy the infestor first because it seems like the most complicated unit, what with being able to morph, move while burrowed, cast spells and all, so I could gauge how viable my idea was and whether I could do it.
Now to get to my actual concern...
The last bug I had to fix had eluded me for quite some time and it was caused by one little, missing exclamation mark.
In the official Balance Test Mod v1.33, the infestor's actor has three event definitions that look like this:
The terms here all begin with a "!" which negates the normal result. If the validator returns true, the term returns false, and vice versa. This is pretty easy to understand and familiar to anyone who has learned a little bit of programing or boolean logic. However, the problem is that there's no apparent way to add this exclamation mark in the editor unless you edit with "View Raw Data" enabled.
Furthermore, if you edit a term like this in the GUI, such as changing the validator, it'll remove that exclamation mark. This tripped me up so hard because I had to replace all of the validators with new ones (e.g. IsInfestorBurrowedBalanceTest), and I even duplicated the "NotInfestor" and "NotInfestorBurrowed" validators, but I just blindly replaced all of the original validators with the equivalent ones and didn't notice the exclamation marks disappearing. So actually I needed to use the opposite validators, which I eventually did to fix the bugs I was seeing in-game.
TL;DR Blizzard apparently edits actor events in raw mode and uses exclamation marks to negate the results of terms, and that exclamation mark operator isn't supported in the GUI and gets silently erased if you make any edits.