I was wondering if you could elaborate more on this particular post with regards uploading rules.txt file.
In my project, we are using the following code to switch the terrain.bmp graphic files when it’s November and April to reflect the changing seasons. But to our knowledge, we didn’t believe or know if it was possible to do the same with the rules text file as well.
I didn't mean to literally switch the rules files. The TOTPP Lua function reference https://forums.civfanatics.com/threads/totpp-lua-function-reference.557527/ has some places where you can change game fundamentals, most notably the unittype object. So, setting civ.getUnitType(0).defense = 5 is like loading a new rules.txt where the 0th unit type has 5 defense points instead of what it had before. So, we can achieve the same kinds of things that we could achieve by loading a new rules.txt file at an opportune time. So, we can increase the defense of, say, 88s against tanks, since that could be achieved by loading a new rules.txt when a tank activates (and a different one when any other unit activates), but we can't increase the defensive power of an 88 if it is on a particular terrain, since we have no way of knowing which particular 88 will be attacked, and the rules.txt doesn't have a means of customizing defensiveness of individual units based on terrain (only all units at once).
Everything that I've said, however, requires that there be a TOTPP Lua function that can make the change you want it to, and, unfortunately, TheNamelessOne didn't provide the functionality to change the terrain characteristics on the fly (maybe if you ask nicely and have a specific use case the next time he shows up, you might get it). You could get around this by changing the map terrain (i.e. having 'cold', 'cool', 'warm', and 'hot' terrain types that shift north and south depending on the season), but that would limit the total number of terrain types you have to work with. That could be some amount of work to store a map's worth of terrain types in a table, but there might be a way of writing lua code to generate that for you.