MegaGlest Forum
Modding and game content creation => Maps, tilesets and scenarios => Topic started by: ZaRo on 29 October 2009, 12:56:58
-
Hello
Is is possible to force a specific unit to attack an other specific unit type and ignore all other unit types?
And any pointers in how to do it via lua would be appriciated :)
Best regards
ZaRo
-
at the start of the xml at startup or something create your units and make ONE of them a specific one you want:
createUnit('swordman', 0, 0)
swordmanUnit = lastCreatedUnit()
and somehow in the game you could:
createUnit('archer', 1, 1)
giveCommand(attack, swordmanUnit, 1)
something like that
though the player may be able to cancel the attack, in this case you would force attack using an ally unit not yours.
-
That won't work. That'll only attack the position, and will end up attacking anything they see on the way first.
As far as I know, there is no way yet...
-
actually you would use lastCreatedUnit but anyways omegas right, I have tried this and its really annoying you have to attack lone units or encampments that have no units walking on the path used to attack them