Home   Help Search Login Register  

Author Topic: The missile tail  (Read 1440 times)

0 Members and 1 Guest are viewing this topic.

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
The missile tail
« on: 05 Aug 2005, 07:56:26 »
Does anyone know how to set the smoke amount of a rocket or missile?
Need help!
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re:The missile tail
« Reply #1 on: 11 Aug 2005, 06:12:55 »
I've tried to use "drop" command but the get the missile "nearestobject" often return the first fired missile,so the second have no smoke!
Is that a OFP bug? "NearestObject"

Code: [Select]
_missile1 = NearestObject [_shooter, _ammoType]
_missile2 = NearestObject [_missile1, _ammoType]
_missile1 exec "\Bomb\TailSmoke.sqs"
_missile2 exec "\Bomb\TailSmoke.sqs"

TailSmoke.sqs:
Code: [Select]
_missile = _this
_yh1 = [.9, .9, .9, .9]
_yh2 = [.9, .9, .9, .8]
_yh3 = [.9, .9, .9, 0]
_Kanal = [_yh1, _yh2, _yh2, _yh3]
_Cveti = [[0, 0, 0],[0, 1, 0]]
_i=0
#Loop
?(not alive _missile): exit
_i=_i+1
{drop ["cl_basic", "", "Billboard", 1, 15, _x, [0, -2, 0], 1, 1.08, 0.85, 0.1, [3,5.0], _Kanal, [0], 0.1, 0.1, "","",_missile]} ForEach _Cveti
~.01
?_i<=100: goto "loop"
exit

See the code, after test the first missile have thick smoke while second have noun,what's the problem?
« Last Edit: 11 Aug 2005, 06:15:00 by Plane »
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline Nemesis6

  • Members
  • *
Re:The missile tail
« Reply #2 on: 13 Aug 2005, 02:25:57 »
Ok, it's a missile launched from an aircraft, right? Look at the attached file. That works, and I've even tried the thing you ask with it. It works. You'll have to remove a few things from the script, but that shouldn't be a problem. I would present a more cleaned up version to you, but I lost all my scripts I have assimilated through the past year or so some time ago.

Quote
; Script By Harkonin inspired by CoC

;
; From the fired event
;
_unit = _this select 0;
_weapon=_this select 1;
_muzzle=_this select 2;
_mode=_this select 3;
_ammo=_this select 4;
;
; The extra parameter, the weapon for which we want a backblast
;

_wepA = ["ZuniLauncher38","HellfireLauncherApach","ZuniLauncherOH","HellfireLauncherCobra","MaverickLauncher","Ch29TLauncher","Rocket57x64","HellfireLauncherHind","Rocket57x192","Rocket57x40Kamov","HellfireLauncherKamov","LaserGuidedBombLauncher"]
_wepB = ["MachineGun30","MachineGun30W","MachineGun30E","Cannon30","MachineGun30A10","MachineGun30A10Burst"]
?(_weapon in _wepB): goto "tracer"
?(!(_weapon in _wepA)) && (!(_weapon in _wepB)):exit

_sizeNum = + random 0.2
_size = 0.6


? (_weapon == "HellfireLauncherApach"): _delay = _delay / 2; _sizeNum = 0.7
? (_weapon == "HellfireLauncherCobra"): _delay = _delay / 2; _sizeNum = 0.7
? (_weapon == "MaverickLauncher"): _delay = _delay / 2; _sizeNum = 0.7
? (_weapon == "CH29TLauncher"): _delay = _delay / 2; _sizeNum = 0.7
? (_weapon == "HellfireLauncherHind"): _delay = _delay / 2; _sizeNum = 0.7
? (_weapon == "HellfireLauncherKamov"): _delay = _delay / 2; _sizeNum = 0.7

;
; Blast effect will originate from the position of the firing unit (e.g. the player)
;
_Rocket = _unit;

_proceed = 1;

;Flames:

_man=_this select 0
_object= nearestObject [_man,_ammo];
? (_ammo == "LaserGuidedBomb"): [_object] exec "\ICP_effects\bombard\vzriv.sqs"; exit
_pos=getpos _object
_delay = 0.02

_size = _size + _sizeNum

#Begin
_cx=getpos _object select 0
_cy=getpos _object select 1
_cz=getpos _object select 2
_pos=getpos _object
_bomb=drop ["cl_fire", "", "Billboard", 1,0.1, _pos, [(velocity _object select 0) / 2,(velocity _object select 1) / 2,(velocity _object select 2) / 2], 1, 0.004, 0.004, 0, [_size,(_size / 2)], [[1,1,1,1], [1,1,1,0.8], [1,1,1,0.6], [0,0,0,0]], [0,1,0,0], 0.5, 0.05, "", "", ""]


~random _delay
? _cz <0.01: exit
goto "Begin"
exit


#tracer

_Rocket = _unit;

_man=_this select 0
_object= nearestObject [_man,_ammo];
_tint = 1
_shape = "obrysove svetlo"
_pos=getpos _object
_delay = (random 0.01)

_r = 1
_g = 0.5
_b = 0

_size = 1.25

? _weapon == "MachineGun30": _shape = "koulesvetlo"; _r = 0.8; _g = 0.5; _b = 0.1
? _weapon == "MachineGun30W": _shape = "koulesvetlo"; _r = 0.8; _g = 0.5; _b = 0.1
? _weapon == "MachineGun30E": _shape = "koulesvetlo"; _r = 0.2; _g = 0.8; _b = 0.25
? _weapon == "Cannon30": _shape = "koulesvetlo"
? _weapon == "MachineGun30A10": _shape = "koulesvetlo"
? _weapon == "MachineGun30A10Burst": _shape = "koulesvetlo"

#Begin2
_cx=getpos _object select 0
_cy=getpos _object select 1
_cz=getpos _object select 2
_pos=getpos _object
_bomb=drop [_shape, "", "Billboard", 1,0.05, _pos, [(velocity _object select 0) / 2,(velocity _object select 1) / 2,(velocity _object select 2) / 2], 1, 0.004, 0.004, 0, [_size,(_size / 1.5)], [[_r,_g,_b,_tint],[_r,_g,_b,0]],
  • , 0, 0, "", "", ""]


~_delay
? _cz <0.01 || not alive _object: exit
goto "Begin2"

Use it as such - This addEventHandler ["Fired",{_this exec "MissileFlame.sqs"}]

Don't know if that's the correct []}[} stuff, but you should know what I'm talking about.
« Last Edit: 13 Aug 2005, 02:28:42 by Nemesis6 »
I am actually flying into a star... this is incredible!

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re:The missile tail
« Reply #3 on: 14 Aug 2005, 17:20:27 »
thanks,you gave me another example! :cheers:
But my problem is that if use this script on burst-fired rockets only one rocket will work! ???
It means if the burst rocket is fired,the "Fired" event will only active once!
So my question is how to get the other rocket when burst rocket is fired? ???
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Kyle Sarnik

  • Guest
Re:The missile tail
« Reply #4 on: 08 Sep 2005, 04:15:14 »
thanks,you gave me another example! :cheers:
But my problem is that if use this script on burst-fired rockets only one rocket will work! ???
It means if the burst rocket is fired,the "Fired" event will only active once!
So my question is how to get the other rocket when burst rocket is fired? ???

Yes I've had problems with this before as well. Unfortunatly we cannot use nearestobject, because if we try finding the nearest ammo type to the vehicle we will get only one of the rockets (most likely the second), if we try to find the nearest ammo type to the rocket that we did detect, it will return that same rocket (nearestobject doesn't seem to exclude the object). But so far I haven't been able to come up with any solution.