How to keep purchasing units and end turn with units stacked on city?

Lonkut

..--""--..
Joined
Jul 13, 2004
Messages
862
Location
......
So I want to be able to purchase units from same city on same turn and also to be able to end the turn with multiple units garrisoned in the city?
Alternatively how to make it so that purchased units start with full movement points?
 
Hello. :)

Well, there are two ways:
a) You do not actually purchase the unit, you invoke Player:InitUnit. This function does not care about the 1upt rule. It's up to you to remove gold and such. There is one caveat, though: units created that way won't have a religion and you cannot change a unit's religion.

b) You purchase one unit, then move it (unit:SetXY), then purchase another one, etc. In the end you move them all back. The SetXY function also bypasses the 1upt rule. But it's buggy as hell, you will face units no longer on the city plot but still listed on this one and preventing you to purchase units, etc. So I rather advise you to take the first route. But if you need to use this solution, I suggest you to look at the code in IGE for religious units, in IGE_UnitsPanel.lua.
 
Back
Top Bottom