I'm sitting an exam on April the 28th, then my plan once/if I pass it is to finish placing the scenario historical starting units as soon as I can so I can start playing around with Lua on all the multiple ideas I have in mind.
So I sit the certification exam next week (whish me luck!), but I've been continuing with the design/planning phase on my study breaks and free time and wanted to share with you my latest news:
Firstly, I have decided I'll use Lua for an additional feature:
managing the AI-controlled tribe's moves and reactions to the human player's actions, enhancing the AI engine itself. I think it could work and would resolve what I was most unhappy with in my scenario: lack of realism in terms of amounts of units in action.
So far in my previous scenario version (v3 - MGE) I was "compensating" the AI flaws by granting the AI civ extra units "out of the blue" when UNITKILLED, etc, and forcing continuous MOVETO commands in the macro events file (inspired by the classic Captain Nemo's Red Front). I did all I could back in the day to challenge the human player, but that approach was giving extra unrealistic units...this, added to the continuous and constant monthly reinforcements received once the relevant technologies were researched, resulted into the scenario having completely ridiculous amounts of planes, vehicles, etc and also a really tedious way to move units from the ports to the frontlines which was disengaging for the human player. I already planned to limit the "foreign reinforcements" received via events (on tech researched) to keep historical numbers, as per the changelog:
- Due to increased ToT event size and the use of variables, reinforcements will arrive on different historical locations and on a random basis instead of every single turn, making each game experience unique.
- The above will also allow reinforcements arriving in numbers more historically suitable as these will never exceed actual historical figures.
So as an example, given IRL between 8 and 16 (5 + 11) Henschel Hs-123 dive bombers operated in Spain (depending on sources), that's what they will get, not a unit every turn plus "extra AI compensating units" as it used to happen, having the scenario full of these

. I hated having so many units back in the day and I really want to avoid this but MGE didn't allow me to stop reinforcements with the limited events space. In v4 I want limited/historical units so players think before "wasting" them, as supplies are limited!
Of course not all units will be limited this way. Both the human player and the AI will still be allowed to build endless amounts of infantry/militia units in all the cities (simulating drafting/recruitment), and also build some other specific units in particular cities as it historically happened (buildable artillery/airplanes/vehicles in historicalyl placed factories) thanks to Lua. This feature of Lua allowing buildable units in specific cities/areas has been successfully implemented in other scenarios and this is going to be hugely used in my v4 update (on a very granular basis, some units will only be buildable in a single city!).
...but then how am I going to have a challenging AI if I'm limiting their units to historical numbers? With Lua again, by instantly moving/redeploying AI units wherever they are needed and to effectively force attacks and counterattacks with their existing units. I think with Lua I can have a dynamic reaction to the player's movements. I can also simulate historical campaigns, having the entire Condor Legion redeploying to airfields close to the battlefields and launching effective offensives all together, as historically happened when they were redeployed from Sevilla (South) to the North to support the Basque campaigns in 1937, and then the Levante (East) campaign in 1938-1939. Lua would allow me to move entire sets of units (
civ.teleportUnit(unit, tile)) reacting to historical campaigns as well as in reaction to whatever achievements the human player can get. For example, ff the Nationalist human player manages to take X city, the Republican AI player will be able to relocate/redeploy units close to the frontline (in the closest cities to whatever X city was captured first) and manage a counterattack. Also with Lua I could ensure the proper defenses are set around...if tanks are seen in action in whatever front, ensure AT guns are redeployed there protecting key objectives, etc.
I can also force monthly recruitment/drafting of conscripts on relevant cities to ensure the AI tribe maintains a constant flow of manpower to replenish their unit pool, based on the city size. The bigger the city is (meaning greater population), the more infantry/militia units they will get on unit built.
Secondly and lastly, another feature I want to implement with Lua is the
bulk & on-demand unit upgrade feature: There will be "bulk upgrade events" on both sides, to simulate the Nationalist's April 1937 "
Unification Decree" (both Carlist and Falangist militia will be integrated into regular infantry troops), as well as the Republican October 1936 "Ejército Popular" (People's Army) creation on which the different militias reorganised into a more "professional army". In different phases, the variety of militia units I have in-game will get upgraded into a regular infantry unit. These two will be triggered by researching a specific tech, so will be optional for the human player, and forced via events to the AI player.
But apart from these "bulk unit upgrades" based on historical events, I also want the human player to be able to upgrade on-demand (on-key-pressed), from regular infantry units, to motorized units, at a cost. Motorized units will have the same combat strenght as regular infantry units, but enhanced movement points and one additional attack per turn. The AI will get randomized infantry unit upgrades of this kind. For this I have two motorised infantry and motorised militia units for both sides already in-game. Also Nationalist Panzer I tanks will be able to be upgraded on-demand with the 20mm Breda Italian gun at a cost (and if the relevant technologies are researched first). The AI player will get historical upgrades of this kind. Probably I'll get even more upgrades, I'll think more about it. Again, as I always say, the possibilities of Lua seem endless to achieve a historical accurate but also challenging and fun scenario.
Will update next week after my exam...
Pablo