Tired to see Scipio staying in Rome to train legions for thousands of years, I tried to build a system where the great generals would have a small chance to generate a great instructor (a copy of a great general who can only attach to cities) when they won battles.
So I splited the great general in two units, and created a new promotion that should be granted when a general join a unit like the warlord one.
Then I copied the Platytiping code of the "heroic" promotion to give to the promotion hability a small chance to be active. It should be 2%
if pWinner.isHasPromotion(gc.getInfoTypeForString("PROMOTION_MILITARY_TRADITION"):
if CyGame().getSorenRandNum(50) == 0:
(I don't know why but the message appears with a space between the R and the O where there was none appearing when I wrote it)
I don't have a lot of experience in python so is this line also mean 2% of chances for the promotion to trigger?
if CyGame().getSorenRandNum(100) <= 2:
The tricky part comes next i compared examples to make the great instructor appears, but there is a mistake and I can't see where.
pPlayer.initUnit(gc.getInfoTypeForString( 'UNIT_GREAT_INSTRUCTOR' ), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
So I got this:
if pWinner.isHasPromotion(gc.getInfoTypeForString("PROMOTION_MILITARY_TRADITION")):
if CyGame().getSorenRandNum(50) == 0:
pPlayer.initUnit(gc.getInfoTypeForString( 'UNIT_GREAT_INSTRUCTOR' ), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
And despites my numerous trying it still don't work and make the interface disappear.
Subsidiary question, how should I do to make the instructor to appear in the capital city?
Thanks in advance
So I splited the great general in two units, and created a new promotion that should be granted when a general join a unit like the warlord one.
Then I copied the Platytiping code of the "heroic" promotion to give to the promotion hability a small chance to be active. It should be 2%
if pWinner.isHasPromotion(gc.getInfoTypeForString("PROMOTION_MILITARY_TRADITION"):
if CyGame().getSorenRandNum(50) == 0:
(I don't know why but the message appears with a space between the R and the O where there was none appearing when I wrote it)
I don't have a lot of experience in python so is this line also mean 2% of chances for the promotion to trigger?
if CyGame().getSorenRandNum(100) <= 2:
The tricky part comes next i compared examples to make the great instructor appears, but there is a mistake and I can't see where.
pPlayer.initUnit(gc.getInfoTypeForString( 'UNIT_GREAT_INSTRUCTOR' ), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
So I got this:
if pWinner.isHasPromotion(gc.getInfoTypeForString("PROMOTION_MILITARY_TRADITION")):
if CyGame().getSorenRandNum(50) == 0:
pPlayer.initUnit(gc.getInfoTypeForString( 'UNIT_GREAT_INSTRUCTOR' ), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
And despites my numerous trying it still don't work and make the interface disappear.
Subsidiary question, how should I do to make the instructor to appear in the capital city?
Thanks in advance