... I was merely using Napoleon as a reference as to what my ultimate intention was, i.e. to have the feature that allowed the designer to swap multiple types of files such as the unit, terrain, rules or maybe even others as Prof. Garfield suggests like the game.txt file.
...
Perhaps a better example would have been my 'A House Divided' scenario where during winter time I exchanged my summer terrain and unit files for their winter counterparts. I also used the bat file to swap the rules files because I made changes not only to many unit but also terrain stats.
Got it. Well, my general point is the same: I think any change to terrain stats or unittype stats is now possible via Lua, with the exception of terrain, resource, and unittype
names. And terrain images could already be swapped out in 0.15.1 as you know.
To be clear, I'm not
opposed to the request of being able to read in more image or text files -- only pointing out that the Lua enhancements in 0.16, especially to terrain, are pretty significant and can probably handle most of the cases that previously made multiple versions of Rules.txt necessary.
Another couple of examples would be 'Second Front' by Captain Nemo or 'Operation Herbstnebel' by Darth Veda where they use the bat file to replace the rules, terrain and unit multiple times. In these cases they not only change the rules, unit and terrain bmp files themselves, but often replace units with other ones and therefore have to modify unit names and stats in the rules file (though I'm not certain if this last part would be a restriction with lua).
Is changing unit names plus images in these scenarios primarily done as a workaround for the limit on number of unit types? Thanks to TOTPP, we certainly have a lot more unit types available now than we did when those scenarios were originally created. But I could still imagine this being an issue, because no matter how many unit types are available, designers will always need "just a couple more".
It just seemed to me that this would make it so much easier from a development point if you could simply swap these files instead of having to potential code all the required changes within lua itself. Am I incorrect in this assumption?
Well, for the case of implementing "seasons", I consider it basically a tie. Instead of having "summer" and "winter" versions of Rules.txt, you just have "summer" and "winter"
functions in your events file that set the correct values appropriately. Then at every point in the event code where you think a new Rules.txt ought to be loaded, you just call the appropriate function instead. The function makes it really easy to review exactly what changes are implemented, as well, without doing a text file comparison. Actually I think the Lua functions may be a little more foolproof, too, because if you want to make a Rules update that applies to
all seasons, you just have to do it in one place (your single Rules.txt file) instead of updating
every Rules.txt file for each season. Seems like it could be easy for bugs to sneak in because Rules files get slightly out-of-sync in unintentional ways.
But changing individual values via Lua has some major advantages in other situations. Say that you have 7 "custom" units such as military commanders, one per tribe, and each tribe has a tech they can research which updates the stats of its own commander. But you don't know which tribes will learn their techs in which order. How many different Rules files would you need to maintain in order to cover all combinations of upgrades? Lots! (I think it's 2^7 or 128 files, hope I'm figuring that right.) But with Lua we can just set the stats for each of the 7 unittypes individually, based on whether or not the corresponding tech is known, using just a handful of lines of code.
As you may recall, at one point, I was asking if in a WWII scenario for example you could design a game where you could have a Western Powers nation (that represented, England, France and the United States) and one other power for Russia and then allow the human player to control both of them. Similarly, could you have an Italian-German power and a Japanese one both controlled by the human player.
This would allow you to control either the Allied or Axis powers as a bloc but still have different technological paths and treasuries to maintain for the powers within your bloc.
This certainly seems possible to me, and not really very difficult to set up.