TC01
Deity
I'm making use of the CySelectionGroup.pushMoveToMission function(iX, iY). This function is triggered if the coordinates are within 2 plots of the unit that is in the selection group's movement range (I also prevent more then one unit from being in that group).
I have two questions.
If I trigger this function, does the movement instantly happen before going to the next line of code? I want to do some stuff to the unit after it moves. Can I just do it like this?
If I make movement using a pushMoveToMission function, will the unit attack a hostile unit on the destination plot? If not, how could I make it attack?
Also, I only want the unit to attack if it has greater then 50% odds of beating the unit on the plot. Is there a function that lets you calculate combat odds?
I have two questions.
If I trigger this function, does the movement instantly happen before going to the next line of code? I want to do some stuff to the unit after it moves. Can I just do it like this?
Code:
pAttackerGroup.PushMoveToMission(pTarget.getX(), pTarget.getY())
pAttacker.changeMoves(60)
pAttacker.setHasPromotion(gc.getInfoTypeForString('PROMOTION_CLOAK'), true)
pAttacker.setScriptData(-1)
If I make movement using a pushMoveToMission function, will the unit attack a hostile unit on the destination plot? If not, how could I make it attack?
Also, I only want the unit to attack if it has greater then 50% odds of beating the unit on the plot. Is there a function that lets you calculate combat odds?