Solution (based on 1.9.7):
1) Edit "Beyond the Sword\Mods\Dune Wars\Assets\Python\DuneWars.py"
find function cannotTrain (looks as below):
def cannotTrain(self, pCity, iUnitType):
self.Initialize()
if iUnitType == self.iUSpwork:
pPlay = gc.getPlayer(pCity.getOwner())
if pPlay.getCivics(self.iCArrak) != self.iCSpind:
return true
and edit the function body to:
def cannotTrain(self, pCity, iUnitType):
self.Initialize()
if iUnitType == self.iUSpwork:
pPlay = gc.getPlayer(pCity.getOwner())
if pPlay.getCivics(self.iCArrak) != self.iCSpind:
return true
pPlayer = gc.getPlayer(pCity.getOwner())
iUnitPerCity = 2
iUnitPerPopulation = 0.25
iNumMilitaryUnits = pPlayer.getNumMilitaryUnits()
iPopulationUnitLimit = pPlayer.getNumCities() * iUnitPerCity + int(pPlayer.getTotalPopulation() * iUnitPerPopulation)
return iNumMilitaryUnits >= iPopulationUnitLimit
2) if you wish to see total units out of total allowed, edit
"Beyond the Sword\Mods\Dune Wars\Assets\Python\Screens\CvMainInterface.py"
I've just added it to the clock. Find "def updateTimeText( self ):"
In the function definition find the g_szTimeText = ""
Just add these lines right after it:
bShowGameTurn = false
pPlayer = gc.getActivePlayer()
iUnitPerCity = 2
iUnitPerPopulation = 0.25
iNumMilitaryUnits = pPlayer.getNumMilitaryUnits()
iPopulationUnitLimit = pPlayer.getNumCities() * iUnitPerCity + int(pPlayer.getTotalPopulation() * iUnitPerPopulation)
g_szTimeText += u"(%d" %( pPlayer.getNumMilitaryUnits() )
g_szTimeText += u"/%d) " %( iPopulationUnitLimit )
Note: limit in the case above is "Number of Cities" * 2 + TotalPopulation*0.25. I was considering early game when population is very low (so just number of cities *2) + late game, when population is 100+. Feel free to play with values as see fit.
Note: you may want to disable something in the updateTimeText, or it won't fit.
mind the "tabs" in the edited file - the indents are important in python
For some reason tabs in my post got cleared.
Note: I've been looking for something akin max unit per tile or global unit limit option for dune wars for some time. In the end decided to just see if i can edit it in myself (won't lie, got hints from other posts). Awesome mod, that I haven't played for a few years, but decided to play it again. Got used to 1 UPT in CivV, and, to tell the truth, I always hated stacks of doom in Civ4, but so much more after playing CivV.