| View previous topic :: View next topic |
| Author |
Message |
Amizaur
Joined: 22 Nov 2002 Posts: 549 Location: Poland
|
Posted: Sat Jun 11, 2005 6:00 am Post subject: Corrected MissileSam.txt doctrine |
|
|
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 |
|
 |
jsteed
Joined: 27 Mar 2002 Posts: 771
|
Posted: Sat Jun 11, 2005 11:57 am Post subject: |
|
|
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 |
|
 |
Amizaur
Joined: 22 Nov 2002 Posts: 549 Location: Poland
|
Posted: Sat Jun 11, 2005 1:51 pm Post subject: |
|
|
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 |
|
 |
LuftWolf
Joined: 09 May 2005 Posts: 1872 Location: Free New York
|
Posted: Tue Jun 14, 2005 12:17 pm Post subject: |
|
|
The subguru download has an A and a B version... what is the difference? :hmm:
Yeah, I did answer my own question...  |
|
| Back to top |
|
 |
Amizaur
Joined: 22 Nov 2002 Posts: 549 Location: Poland
|
Posted: Thu Jun 16, 2005 5:23 am Post subject: |
|
|
Look into them and compare . 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 |
|
 |
LuftWolf
Joined: 09 May 2005 Posts: 1872 Location: Free New York
|
Posted: Thu Jun 16, 2005 2:56 pm Post subject: |
|
|
\ :sunny:
Thanks Ami...!  |
|
| Back to top |
|
 |
|