How can the ship bot fire a torpedo?

I don’t know how to make a ship bot do a torpedo attack.
Which trigger should I use?

AI ships should automatically fire their torps unless you force them not to have any. Usually they tent to use them at max range and dont care if its a tank or plane attacking them. There is a weapon type option in unitattacktarget but I could never get the ship AI to target specific targets. You could mess around with unitsetgunproperties with tiggergroup set to torpedos.

I tried it, but unfortunately it did not work.
Some AIs did fire torpedoes, but the direction of the torpedo tubes seemed to be fixed and fired in the exact opposite direction of the enemy. lol.
By the way, unitsetgunproperties is an undocumented trigger on the Wiki that I didn’t know existed, so if there is some place other than the Wiki where I could find out this information, I would appreciate it if you could let me know.

And just to be clear, the AI I am referring to is the AI unit included in the user mission, not the AI that spawns in place of the player in a custom battle.

It may be that naval AI just dont have many options in CDK. Also I am talking about AI units placed in user mission. I’ve tried getting naval units to target specific units, target “zones” with the missionUnitShootAtLine". UnitSetGunProperties is also new. It was included with this recent major update. You could use a combination of conditions with else actions. Maybe a until player/unit in area or unitwhenenemynear. With a elseaction that has the ship to hold fire. Then swap to fire at will when condition met. That way the ship aims at the unit with all its main guns and torps before firing the torps and whatever else.

1 Like