OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: LCD on 04 Jul 2007, 01:13:33
-
im tryin 2 create a cutscene were da camera follows a bullet da player just shot... using fired eventhandler and a nearestobject command... but it seems da nearestobject keeps on missing da bullet... od ny1 knows a workaround ???
LCD OUT
-
try with SQS instead of SQF, you may be surprised.
-
u mean sqf instead of sqs ??? cuz im usin sqs right now :confused:
nywayz im usin ur script mandoble... so mebe... ???
LCD OUT
-
How exactly you use the nearestObject?
In the script executed by the eventHandler or 'in' the eventHandler?
The bullet is way too fast to be succesfully detected in the executed script (extremely sensitive to FPS), it should be 'caught' in the eventHandler, as such:
this addEventHandler ["fired",{(nearestObject [_this select 0, _this select 4]) execVm "thescript.sqf"}]Now you just refer to the bullet in the script with _this
When cathing the bullet in the eventHandler it's muzzle velocity can be something like 500 000m/s and it still gets caught..
-
I noticed in my bullet cam script that it takes about 1/4 of a second to 1/2 of a second for the bullet to be detected before followed. I never overcome the problem. Format was a fast SQS loop (0.0025 I think).
-
That eventhandler thing should work, we tested it extensively during the developement of MCAR.
Of course we used it from config eventHandlers but it shouldn't matter, at least (IIRC) in OFP the mission set eventHandlers 'fired' before the configged ones..