Forum Index
SUBSIM Forum Search

The Web's #1 BBS for all submarine and naval simulations!
[ SUBSIM Review ] [ SUBSIM STORE ]
Current Forum | Archives 2002-2003 |

Corrected MissileSam.txt doctrine

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> DW Mod Workshop
View previous topic :: View next topic  
Author Message
Amizaur



Joined: 22 Nov 2002
Posts: 549
Location: Poland

PostPosted: Sat Jun 11, 2005 6:00 am    Post subject: Corrected MissileSam.txt doctrine Reply with quote

As I wrote in patch suggestions thread, there is a bug in MANPADs missile doctrine :-/. Can't believe I didn't notice it earlier... from the very first time the horizontally flying unguided MANPADs looked suspicious for me, but now I looked closer at the doctrine and tested it. And something is broken there indeed. There is an order to keep the launch pitch but it don't work. Fortunately solution was very simple, change only one line.

Fixed doctrine:

***

; $Header: MissileSam.txt Tue Aug 17 14:15:31 EDT 2004 mike $
; $Revision: 1 $
; $Copyrt1: Copyright (c) 2003, Sonalysts, Inc. All rights reserved. $
;

var PreenableCourse
var PreenablePitch
var RunToEnable
var Runout
var Homing
var initX
var initY
var run

; Missile Skim
IF INIT THEN {
Homing = 0

initX = OwnX
initY = OwnY

; Default to 5 yd enable
RunToEnable = 5

; Default to full range
Runout = -1

; Make sure missile starts out at the pitch we set, not the altitude we initialize it to
PreenablePitch = pitch

} ELSE {
SetSpd MaxSpd

run = xyrng ( OwnX - initX ) ( OwnY - initY )

IF NOT Homing THEN {
SetCrs PreenableCourse
SetPitch ( PreenablePitch - 1 )
} ENDIF

; Enable
IF ( RunToEnable != -1 ) THEN {
IF ( run >= RunToEnable ) THEN {
ENABLE
RunToEnable = -1
DEBUGOUT "Missile Enabled"
} ENDIF
} ENDIF

; Shutdown
IF ( Runout != -1 AND ( run >= Runout ) AND NOT Homing ) THEN {
DEBUGOUT "Missile failed to acquire"
Runout = -1
SHUTDOWN
} ENDIF

; Home
IF NEWTRACK THEN {
Homing = ( Homing + 1 )
DEBUGOUT "Missile Homing"
Runout = -1
SetTactic "terminal_home"
} ENDIF

IF LOSTTRACK THEN {
Homing = ( Homing - 1 )
} ENDIF
} ENDIF

****

The other version, I like it better because the trajectory is little ballistic as in real missiles probably:

***

; $Header: MissileSam.txt Tue Aug 17 14:15:31 EDT 2004 mike $
; $Revision: 1 $
; $Copyrt1: Copyright (c) 2003, Sonalysts, Inc. All rights reserved. $
;

var PreenableCourse
var PreenablePitch
var RunToEnable
var Runout
var Homing
var initX
var initY
var run

; Missile Skim
IF INIT THEN {
Homing = 0

initX = OwnX
initY = OwnY

; Default to 5 yd enable
RunToEnable = 5

; Default to full range
Runout = -1

} ELSE {

; Make sure missile starts out at the pitch we set, not the altitude we initialize it to
PreenablePitch = pitch
SetSpd MaxSpd

run = xyrng ( OwnX - initX ) ( OwnY - initY )

IF NOT Homing THEN {
SetCrs PreenableCourse
SetPitch ( PreenablePitch - 1 )

} ENDIF

; Enable
IF ( RunToEnable != -1 ) THEN {
IF ( run >= RunToEnable ) THEN {
ENABLE
RunToEnable = -1
DEBUGOUT "Missile Enabled"
} ENDIF
} ENDIF

; Shutdown
IF ( Runout != -1 AND ( run >= Runout ) AND NOT Homing ) THEN {
DEBUGOUT "Missile failed to acquire"
Runout = -1
SHUTDOWN
} ENDIF

; Home
IF NEWTRACK THEN {
Homing = ( Homing + 1 )
DEBUGOUT "Missile Homing"
Runout = -1
SetTactic "terminal_home"
} ENDIF

IF LOSTTRACK THEN {
Homing = ( Homing - 1 )
} ENDIF
} ENDIF

***

Replace it and shoot a missile from the sail, now it works like it should (and like intended).

Link to both versions in zip file: http://members.chello.pl/m.ostrowski7/Files/DW_MissileSam_doctrine_fix.zip


Last edited by Amizaur on Tue Jun 28, 2005 4:32 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
jsteed



Joined: 27 Mar 2002
Posts: 771

PostPosted: Sat Jun 11, 2005 11:57 am    Post subject: Reply with quote

There are a several 'Preenable' instructions that do not work when they are placed in the Init section. This bug also exists in SC.

cheers, jsteed
Back to top
View user's profile Send private message
Amizaur



Joined: 22 Nov 2002
Posts: 549
Location: Poland

PostPosted: Sat Jun 11, 2005 1:51 pm    Post subject: Reply with quote

Hm that would explain some things... but in this case, this don't seem like preenable instruction, it's simply a value stored in a custom variable and then an ordinary command Setpitch in doctrine main body - just like setalt setcrs or setspd...
The thing that don't work is probably when an SetSomething order is given with a variable name as an argument. It don't work at all then - after deleting this complete line nothing changed. I tried to use other custom variable, named it LaunchAngle for example, still didn't work. But same Setsomething command works normally when is used with numerical argument, or when some kind of math operation is added to variable name (variable - 1 for example).
[/url]
Back to top
View user's profile Send private message Send e-mail
LuftWolf



Joined: 09 May 2005
Posts: 1872
Location: Free New York

PostPosted: Tue Jun 14, 2005 12:17 pm    Post subject: Reply with quote

The subguru download has an A and a B version... what is the difference? :hmm:

Yeah, I did answer my own question... Joking
Back to top
View user's profile Send private message Visit poster's website AIM Address
Amizaur



Joined: 22 Nov 2002
Posts: 549
Location: Poland

PostPosted: Thu Jun 16, 2005 5:23 am    Post subject: Reply with quote

Look into them and compare Smile. Well in practice - almost none, slightly different trajectory of flight. Posted both versions in case that one of used solutions caused any trouble i didnt notice yet, then the other can be used.
Back to top
View user's profile Send private message Send e-mail
LuftWolf



Joined: 09 May 2005
Posts: 1872
Location: Free New York

PostPosted: Thu Jun 16, 2005 2:56 pm    Post subject: Reply with quote

Neutral\ :sunny:

Very Happy

Thanks Ami...! Rock
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> DW Mod Workshop All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group