OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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?? :-\
-
Well, the only one here under this weapons and ammo list is this
HellfireLauncherM2A2
So I guess that's it.
-
No. I've allready tried it :-\
_Rocket = NearestObject [Tank3,"HellFireLauncherM2A2"]
Thanks for taking your time to help me though :thumbsup:
-
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:
this addEventHandler ["fired", { hint format ["You fired a shot of %1",_this select 4] }]
Then, jump in and fire away ;D
-
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?
-
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*