SH5 has the basic code built in to allow subs to dive and fire torps through scripting.
SH3 does not and I don't recall anything like that for SH4 but I may have missed something in the SH4 area.
There was only one AI Diving Sub for SH3 that I know of.
There were problems in the development of it that were never followed through on due to time constrants.
And the only video of it is gone.