Doctrine: AI-Sub / SAM
Hi,
has anybody tried to alter the doctrine for SAM-equipped ( maybe with change of the DB) subs so that they can fire SAMs? Or does the NavalSimEngine prevent this? Thanks. |
Quote:
|
[quote=GrayOwl]
Quote:
I've started to change the doctrine. Actually, it seems possible...AI sub fires SAM but it never hits, but probably due to insufficient targeting. When I have one first working version I'll post it here. |
[quote=Hawk66]
Quote:
True So For SubAvoidAir: ; --------------------------------------------------------------- var Unknown var PreventingSnorkel var PreventingComms var LegTimer VAR TEMP var TC var MaxFiringRng var TypSub var ShotOK var SolFire var Dive var DepthAirAtk var MaxDpt func AvoidTgt { IF TIME > LegTimer AND ( TgtRng < 11112 ) THEN { DEBUGOUT "Sub Avoiding Air" LegTimer = ( 900 + RND 900 ) SetPersist LegTimer SetPriority 255 SetAlt MaxDpt If ( MaxDpt <= TerrainAlt ) Then { MaxDpt = TerrainAlt + 30 } Endif SteerEvasive LegTimer += TIME IF ( OwnSpd < LoiterSpd ) THEN { SetPersist LegTimer SetPriority 255 SetSpd LoiterSpd } ENDIF } ENDIF } IF Init THEN { TypSub = GetEntVar "TypSub" ; Subs With Portable SAM MaxFiringRng = ATTACKRNG MaxDpt = ( MinAlt * 3.28 ) DepthAirAtk = ( PeriDepth - 35 ) Unknown = true PreventingSnorkel = true PreventingComms = true TEMP = GetEntVar "TooBusyForComms" SetEntVar "TooBusyForComms" ( TEMP + 1 ) TEMP = GetEntVar "TooBusyToSnorkel" SetEntVar "TooBusyToSnorkel" ( TEMP + 1 ) } ELSE { IF TgtID $= "HOSTILE" THEN { IF Unknown THEN { TC = 1 Unknown = false } ENDIF } ELSE { IF TgtID $= "NEUTRAL" THEN { IF Unknown THEN { Unknown = false PreventingSnorkel = false PreventingComms = false TEMP = GetEntVar "TooBusyForComms" SetEntVar "TooBusyForComms" ( TEMP - 1 ) TEMP = GetEntVar "TooBusyToSnorkel" SetEntVar "TooBusyToSnorkel" ( TEMP - 1 ) AvoidTgt } ENDIF } ENDIF } ENDIF } ENDIF If TC And Not ShotOK Then { If TypSub == 8 Then { If TgtSilos < 0 Then { If ( ( OwnAlt >= DepthAirAtk ) AND ( TgtRng < ( MaxFiringRng + 3000 ) ) ) Then { SolFire = 1 SetPriority 255 FIREBEST } ENDIF } ENDIF } ENDIF IF Not SolFire Then { DEBUGOUT "Not Air Attack Conditions" Dive = 1 } ENDIF } ENDIF IF ( ( WeaponAway ) And ( Not ShotOk ) ) Or Dive Then { DEBUGOUT "Dive" AvoidTgt ShotOk = 1 Dive = 0 Setpersist ( 120 + ( RND 120 ) ) SetPriority 242 SetSpd OwnSpd IF ( OwnAlt > -2 ) Then { DEBUGOUT "Emergency Dive" SetPersist 120 SetPriority 255 SetAlt MaxDpt Setpersist ( 120 + ( RND 120 ) ) SetPriority 255 SetSpd MaxSpd } ENDIF } ENDIF ; ------------------------------------------------------------- :know: |
All times are GMT -5. The time now is 04:22 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.