Home   Help Search Login Register  

Author Topic: Shot group of AC-130 40mm fire  (Read 561 times)

0 Members and 1 Guest are viewing this topic.

armybikos

  • Guest
Shot group of AC-130 40mm fire
« on: 20 Jul 2003, 16:49:30 »
Here is one of my scripts for my simulated AC-130 strike using CPT Moore's C-130, only problem is the rounds have too big a shot group, it should be about 25m wide and mines is 100m wide and I cant figure out how to fix it. Also if you know how to make the burst radius on my 105mm howitzer bigger please let me know.........here is my script


_pos = _this select 0

; An invisible helipad is created to help us to "locate" the target
; =========================================================================
_traker = "HeliHEmpty" createvehicle _pos

; The pilot and the atack plane are created
; =========================================================================


_grp = group player
"SoldierWPilot" createunit [[(getpos _traker select 0), (getpos _traker select 1), (getpos _traker select 2)],_grp,"Strikepilot=this",0.5,"PRIVATE"]
_Strikeplane = "C130v1a" createvehicle [(getpos _traker select 0), (getpos _traker select 1) -2500, 1000]
_Strikeplane setpos [(getpos _traker select 0), (getpos _traker select 1) -2500, 120]
_Strikeplane setvelocity [0,120,0]

StrikePilot sidechat "On Station time Now"

StrikePilot moveindriver _strikeplane
StrikePilot Assignasdriver _strikeplane
_Strikeplane disableai "move"
Strikepilot disableai "move"
doStop Strikepilot

_Strikeplane flyinheight 130

~0.5

; At a given distace, the plane will simulate to fire the bomb
; ==========================================================================

@ _Strikeplane distance _traker <=290
Strikepilot sidechat "Starting Pylon Turn"

; The bomb/bombs are fired, _num is the amount of bombs fired
; ==========================================================================

_num = 10
_i = 0

#loop
_bomb = "grenade" createVehicle [(getPos _StrikePlane select 0)+((random 10)-5),(getPos _StrikePlane select 1)+((random 10)-3),(getPos _StrikePlane select 2)-1]
_bomb setDir (getDir _strikePlane)
_bomb setVelocity [(velocity _StrikePlane select 0)*0.3,(velocity _StrikePlane select 1)*0.3,(velocity _StrikePlane select 2)*0.3]
_i = _i + 1
[_bomb,killzone] exec "40.sqs"
~0.1
? _i < _num : goto "loop"

; Here we can call a script to simulate napalm or cluster bombs, or especial effect like shockdust
; ==========================================================================

; The plane climbs after dropping the bombs and fly away
; ==========================================================================
~4
_Strikeplane flyinheight 350
deletevehicle Strikepilot
; The spawned plane and the pilot are deleted
; ==========================================================================

~10
deleteVehicle _strikePlane
StrikePilot sidechat "In Orbit Above Target Area"
deletevehicle Strikepilot


; Final
; ==========================================================================
exit






armybikos

  • Guest
Re:Shot group of AC-130 40mm fire
« Reply #1 on: 20 Jul 2003, 16:50:17 »
forgot to give you my 40mm script


_Bomb = _this select 0


;
_agvCBUcount = 1
_i           = 0
_Angle       = 0
_zOffset     = 0
_SprdOffset  = 20^0.5
_InitVel     = 40
;=========================================================
;Watch Height
;=========================================================
#MonitorCBU

_CBUPosition=getPos _Bomb
_height=_CBUPosition select 2

? (_height<=35):goto "createBomblets"
~0.1
goto "MonitorCBU"
;=========================================================
;get Velocity and kickoff create bombs
;=========================================================
#CreateBomblets

;=========================================================
;=========================================================
;Get Actual Velocity
;=========================================================

_Bombvel=velocity _Bomb
_Velx=(_BombVel select 0); _Vely=(_BombVel select 1)
DeleteVehicle _bomb
~0.7

;=========================================================
;Calculate vector velocity
;=========================================================
;vf^2=vi^2+2ad
_Velz=sqrt ((_InitVel^2+2*9.8*_height))

_t = abs(_height / _Velz)

_c = sqrt (( ((agvCBUspread/2)^2) + (_height^2) ))

_v = _c/_t

;=========================================================
;Disperse Bomblets
;=========================================================

#DeployBomblet

?(_i > _agvCBUcount): Goto "Exit"

_Angle      = _Angle + (359.9/agvCBUcount)
_xOffset    = (Sin _Angle) * _SprdOffset
_yOffset    = (Cos _Angle) * _SprdOffset

_NewX  = ((_CBUPosition Select 0) + ((random 3)-2))
_NewY  = ((_CBUPosition Select 1) + ((random 3)-2))
_NewZ  = ((_CBUPosition Select 2) + _zOffset)

_Bomblet = "Grenade" createVehicle [_NewX, _NewY, _NewZ]

_RVelx = (Random _v); _RVely = (Random _v)

?(_Angle > 180 and _Angle < 360):_RVelx=(_RVelx * -1)
?(_Angle > 90 and _Angle < 270):_RVely=(_RVely * -1)

_Bomblet setVelocity [_Velx+((random 60)-20), _Vely+((random 25)-10), ((random 3)-1)]

_i  = _i + 1
_zOffset=_zOffset+.15

~.02

Goto "DeployBomblet"
;
;

#Exit
exit

Unnamed

  • Guest
Re:Shot group of AC-130 40mm fire
« Reply #2 on: 22 Jul 2003, 16:26:47 »
hmmm....Not exactly sure:

Code: [Select]
_Bomblet setVelocity [_Velx+((random 60)-20), _Vely+((random 25)-10), ((random 3)-1)]

But seen as you go to all that trouble to work out _Velz, you dont use it?