Still working on this. I've made some convoluted code that tries to ensure that all CREs have only one of their scripts patched. Thanks to Miloch's tweaks code I've abused arrays to the max.
The biggest problem I have had is the following scenario:
1. Creature X has script A only
2. Creature Y has script F only
3. Creature Z has scripts A and F
4. So long as the setup looks at creatures X and Y first, creature Z will always have both its scripts modified
5. Then multiply this by lots of script triplets that do this
The only way I have been able to get around this is to make the setup re-iterate the entire sequence again but excluding F (as in the above example) -> then setup will create a new script for Y. Unfortunately, because there are so many triplets, it takes setup 7 iterations to settle to a satisfying outcome (which takes a lot of time), and if you exclude all the
BG2 only files (since this is only for
BG1), it takes setup 2 iterations (a lot better, but who knows what happens in a
BWP install...).
The other problem with this is that creatures with 5 scripts in their slots already and all their scripts are excluded cannot be modified. That sucks.
Hence, in the next version of
BGT Tweaks, this will only be a 'testing' component, because it could produce really awful results, and on some installations it might iterate forever!
Any suggestions of how to better tackle this problem would be appreciated.