How to make the AI stop producing a unit
AiSet is supposed to "opposite to AiNeed, which always inserts a request, AiSet modifies the last request to the new number." However, when I modified the land attack AI script of Aleona's Tales 2.2.7 like this:
function() return AiSet(AiWorker(), 50) end,
function() return AiSleep(50) end,
function() return AiSet(AiWorker(), 1) end,
and put AiDump() in the AiLandAttack() function's while loop, the resulting console information said unit-peon(0/49) even after a couple hundred cycles. The problem is that in my opinion it should be training only one worker at that point. Also, I can't find any other methods to make the AI stop producing units.
How would I go about fixing this? I need such a functionality for Battle for Mandicor to make sure the AI player will produce workers until it has the resources to upgrade its town center to a town hall and at that exact moment halt production of workers and start the upgrade.