Falc
Warlord
- Joined
- Oct 6, 2007
- Messages
- 292
Okay, further debugging.
Changed the loop that creates henchmen to
First run, I got lucky and got one pack leader result that didn't crash. Log contained this:
Second run, lucky again, one pack leader with crash. log
More than likely, the error is due to the -1 there, which should be the return value of gc.getInfoTypeForString(sHenchman). -1 certainly looks like an error value.
And follow up with some extra debugging to find what the values of lHenchmanList, sHenchman and iHenchman are, we find that:
So, conclusion, it crashes when it tries to create a Wolf Pack. Are these packs even in Orbis? I thought they were FF only.
Hmmm. Looking at the rest of the code, it seems I got bloody lucky when I randomly decided to plop down Wolf Lairs, since there's no packs that can come out of other lairs...
Changed the loop that creates henchmen to
Code:
for i in range (iHenchtotal):
v = [str(item) for item in [iHenchman, newUnit.getX(), newUnit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH]]
CvUtil.pyPrint(';'.join(v))
bPlayer.initUnit(iHenchman, newUnit.getX(), newUnit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
First run, I got lucky and got one pack leader result that didn't crash. Log contained this:
Code:
PY:105;21;16;NO_UNITAI;DIRECTION_SOUTH
Second run, lucky again, one pack leader with crash. log
Code:
PY:-1;27;16;NO_UNITAI;DIRECTION_SOUTH
More than likely, the error is due to the -1 there, which should be the return value of gc.getInfoTypeForString(sHenchman). -1 certainly looks like an error value.
And follow up with some extra debugging to find what the values of lHenchmanList, sHenchman and iHenchman are, we find that:
Code:
PY:['UNIT_WOLF', 'UNIT_WOLF_PACK']
PY:UNIT_WOLF_PACK
PY:-1
PY:['UNIT_WOLF', 'UNIT_WOLF_PACK']
PY:UNIT_WOLF
PY:105
So, conclusion, it crashes when it tries to create a Wolf Pack. Are these packs even in Orbis? I thought they were FF only.
Hmmm. Looking at the rest of the code, it seems I got bloody lucky when I randomly decided to plop down Wolf Lairs, since there's no packs that can come out of other lairs...