SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   DW Mod Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=196)
-   -   Doctrine: AI-Sub / SAM (https://www.subsim.com/radioroom/showthread.php?t=136503)

Hawk66 05-09-08 05:38 AM

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.

GrayOwl 05-09-08 04:17 PM

Quote:

Originally Posted by Hawk66
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.

When the aircraft is found out, the doctrine SubAvoidAir orders AI Sub to be dive deep. On shallow water, if it will impossible to dive a AI Sub shoot SAM missile. Change the doctrine. In her there is a mistake - such variable as "FRIENDLY" no. Correctly - $= "FRIEND".

Hawk66 05-11-08 02:32 AM

[quote=GrayOwl]
Quote:

Originally Posted by Hawk66
Hi,

When the aircraft is found out, the doctrine SubAvoidAir orders AI Sub to be dive deep. On shallow water, if it will impossible to dive a AI Sub shoot SAM missile. Change the doctrine. In her there is a mistake - such variable as "FRIENDLY" no. Correctly - $= "FRIEND".

Thanks GrayOwl.
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.

GrayOwl 05-13-08 03:22 PM

[quote=Hawk66]
Quote:

Originally Posted by GrayOwl
Quote:

Originally Posted by Hawk66
Hi,

When the aircraft is found out, the doctrine SubAvoidAir orders AI Sub to be dive deep. On shallow water, if it will impossible to dive a AI Sub shoot SAM missile. Change the doctrine. In her there is a mistake - such variable as "FRIENDLY" no. Correctly - $= "FRIEND".

Thanks GrayOwl.
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.

:|\\

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 03:54 PM.

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.