I have to ask you guys for some help.
I'm trying to spawn a cube for just one time.
i work in the function
def doPirateSpawning(self): in the python script
when i use this code:
iBorgCube = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_B_BORG_CUBE')
pPlayer.initUnit(iBorgCube, 1, 1, UnitAITypes.UNITAI_ATTACK, DirectionTypes.NO_DIRECTION)
it works fine, but spawns a cube every turn ( as expected...)
however when i use this code:
iBorgCube = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_B_BORG_CUBE')
if (iCubeEventOne < 1):
pPlayer.initUnit(iBorgCube, 1, 1, UnitAITypes.UNITAI_ATTACK, DirectionTypes.NO_DIRECTION)
pPlayer.initUnit(iBorgCube, 10, 1, UnitAITypes.UNITAI_ATTACK, DirectionTypes.NO_DIRECTION)
pPlayer.initUnit(iBorgCube, 1, 10, UnitAITypes.UNITAI_ATTACK, DirectionTypes.NO_DIRECTION)
pPlayer.initUnit(iBorgCube, 10, 10, UnitAITypes.UNITAI_ATTACK, DirectionTypes.NO_DIRECTION)
iCubeEventOne = 1
it doesn't work at all. no spawns.
i mention that i did initialized the iCubeEventOne variable to 0 at the beginining of the file.
Any tips?