jojoweb
Chimpa-Z
I will be patient for the Warlords version ^^.
Rhye said:this is not a good news for me.
I would need to integrate the SDK code into mine, while all I needed was support for disabling it after the discovery of a certain tech (or an era, the same as the "Starting Era" setting in the INI); an easy way to integrate the mod component into mine; and future support for warlords.
# Places the mercenary in the city specified by the objCity variable
def place(self, objCity):
# Return immediately if the mercenary is already in the game
if(self.objUnit != None):
return
# get the player instance
player = gc.getPlayer(self.iOwner)
# return nothing if the player is an invalid value
if(player == None):
player = gc.getPlayer(self.iBuilder)
if(player == None):
return
# return nothing if the player is dead
if(player.isAlive() == false):
return
unitType = gc.getInfoTypeForString(self.objUnitInfo.getType())
# Create the unit and place it in the game
[b]self.objUnit = player.initUnit(unitType, objCity.getX(), objCity.getY(), UnitAITypes.NO_UNITAI)[/b]
def getMercenaryStartingLocation(self, iPlayer):
' CyCity - the starting city for hired mercenaries'
player = gc.getPlayer(iPlayer)
objCity = None
if(g_strMercenaryStartingLocation == "Capital City"):
objCity = player.getCapitalCity()
elif(g_strMercenaryStartingLocation == "Civilization Edge"):
objCity = self.getCivilizationEdgeCity(iPlayer)
elif(g_strMercenaryStartingLocation == "Random"):
[b]objCity = player.getCity(gc.getGame().getMapRand().get(player.getNumCities(), "Random City"))[/b]
elif(len(g_strMercenaryStartingLocation) > 0):
objCity = self.getRandomCityWithBuildings(iPlayer)
else:
[b]objCity = player.getCity(gc.getGame().getMapRand().get(player.getNumCities(), "Random City"))[/b]
if(objCity == None):
[b]objCity = player.getCity(gc.getGame().getMapRand().get(player.getNumCities(), "Random City"))[/b]
return objCity
CyCity* CyPlayer::getCity(int iID)
{
return m_pPlayer ? new CyCity(m_pPlayer->getCity(iID)) : NULL;
}
# Returns the starting city for a player's mercenary
def getMercenaryStartingLocation(self, iPlayer):
' CyCity - the starting city for hired mercenaries'
player = gc.getPlayer(iPlayer)
objCity = None
if(g_strMercenaryStartingLocation == "Capital City"):
objCity = player.getCapitalCity()
elif(g_strMercenaryStartingLocation == "Civilization Edge"):
objCity = self.getCivilizationEdgeCity(iPlayer)
elif(g_strMercenaryStartingLocation == "Random"):
[b]pCityList = PyPlayer(iPlayer).getCityList()
objCity = pCityList[gc.getGame().getMapRand().get(len(pCityList), "Random City")].GetCy()[/b]
elif(len(g_strMercenaryStartingLocation) > 0):
objCity = self.getRandomCityWithBuildings(iPlayer)
else:
[b]pCityList = PyPlayer(iPlayer).getCityList()
objCity = pCityList[gc.getGame().getMapRand().get(len(pCityList), "Random City")].GetCy()[/b]
if(objCity == None):
[b]pCityList = PyPlayer(iPlayer).getCityList()
objCity = pCityList[gc.getGame().getMapRand().get(len(pCityList), "Random City")].GetCy()[/b]
return objCity
mrgenie said:Hi thelopez..i thought it to be impossible first too...so i took out all the merc things...and loaded the savegame...could play without OOS 240turns tested...then i again copied all the pythons with the merc enabled..and i got the OOS again...tried it several times...either it's the merc mod..or an interaction with the merc mod...but without the merc mod i can play several times through the game of which the longest last 240turns..including the merc is OOS within 30-40turnsi really have no idea..i looked over the code..i found some things where i raise a question mark..but i dont see the point why it should go OOS...i send my files to gerikes..maybe he can figure this one out..i hope
1278c1278
< Player 1, Unit ID: 270344, Archer (EDU)
---
> Player 1, Unit ID: 253960, Archer (EDU)
1280c1280
< Damage: 0Experiecne: 3Level: 2
---
> Damage: 0Experiecne: 3Level: 1
Ket said:DO-NOT run non warlords code in walords....