smeagolheart
Monarch
How's this look for AI to create the project?
It worked in my test mod but that was not a full blown game with a lot of things going on. Any possible issues you think?
This is from this thread: renaissance project
Code:
def AI_chooseProduction(self,argsList):
pCity = argsList[0]
## Renaissance Start ##
iOwner = pCity.getOwner( )
pPlayer = gc.getPlayer( pCity.getOwner( ) )
iProject = gc.getInfoTypeForString("PROJECT_RENAISSANCE")
iTech = gc.getInfoTypeForString('TECH_RENAISSANCE')
tTech = gc.getInfoTypeForString('TECH_THEOLOGY')
if ( gc.getTeam(pPlayer.getTeam()).isHasTech(iTech) == false ):
if ( gc.getTeam(pPlayer.getTeam()).isHasTech(tTech) == true ):
if pCity.canCreate( iProject, 0, 0 ):
gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_CREATE, iProject, -1, False, False, False, True )
return True
## Renaissance End ##
return False
It worked in my test mod but that was not a full blown game with a lot of things going on. Any possible issues you think?
This is from this thread: renaissance project