OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Knut Erik on 30 Jun 2003, 23:41:28

Title: Name of the M2A2 Rocket...
Post by: Knut Erik on 30 Jun 2003, 23:41:28
Okay. I need some major help here..
I want the camera to follow the M2A2 TOW rocket.

_Rocket = NearestObject [Tank3," ??? "]

I need to know what the name of the M2A2 rocket is in order to make the camera follow it.

Does anyone have a clue??  :-\
Title: Re:Name of the M2A2 Rocket...
Post by: Wolf on 30 Jun 2003, 23:54:26
Well, the only one here under this weapons and ammo list is this

HellfireLauncherM2A2

So I guess that's it.
Title: Re:Name of the M2A2 Rocket...
Post by: Knut Erik on 01 Jul 2003, 00:09:44
No. I've allready tried it  :-\

_Rocket = NearestObject [Tank3,"HellFireLauncherM2A2"]

Thanks for taking your time to help me though  :thumbsup:
Title: Re:Name of the M2A2 Rocket...
Post by: Killswitch on 01 Jul 2003, 17:59:53
The name of the "rocket" is "AT3".

Hint: add a "fired" event handler to any vehicle for wich you wish to find out the ammo names of. Try this one in a Bradley's init field:

Code: [Select]
this addEventHandler ["fired", { hint format ["You fired a shot of %1",_this select 4] }]
Then, jump in and fire away  ;D
Title: Re:Name of the M2A2 Rocket...
Post by: Knut Erik on 01 Jul 2003, 21:58:16
Strange.... Why isn't this working???

Tank3 fire "HellfireLauncherM2A2"
_Rocket = NearestObject [Tank3,"AT3"]
_camera camSetTarget _Rocket
_camera camSetRelPos [0,10,1]
_camera camSetFOV 0.700
_camera camCommit 0


It should work, right?
Title: Re:Name of the M2A2 Rocket...
Post by: Knut Erik on 02 Jul 2003, 00:02:35
Guys, guys..

I've got it to work!! You'll only have to add a tiny delay.

Tank3 fire "HellfireLauncherM2A2"
~0.01
_Rocket = NearestObject [Tank3,"AT3"]
_camera camSetTarget _Rocket
_camera camSetRelPos [0,10,1]
_camera camSetFOV 0.700
_camera camCommit 0


Now it works like a charm.
Thanks a lot for that tip Killswitch.
VERY usefull indeed  ;)

*Topic solved n' locked*