Ranged attack and capture a city in 1 unit help

chibirobo1

Chieftain
Joined
Dec 23, 2010
Messages
30
im trying to mod a unit that can perform a ranged attack and then also capture a city like a tank can. what im trying to do is add more robotic units to the end of the game and i want one to be able to launch ranged attacks then if able to capture the city. thanks in advance
 
You can already do that, easily. The key is PROMOTION_ONLY_DEFENSIVE; this negative promotion disables the "melee" attack that all units would gain otherwise. The archery and artillery units have this promotion, and so can only bombard. But if you make a ranged unit that doesn't have that promotion, then it can do either. Note, though, that the default for those units (when you right-click an enemy) is to use the ranged attack instead of the melee, even if it's weaker, so you'd have to explicitly tell the unit to attack the normal way using the button on the left side of the screen.

I've done this in my mod; the endgame "Titan" units all have high Combat ratings, and most also have a bombardment attack. It works just fine to use both on the same unit.
 
Top Bottom