Jump to content
Sign in to follow this  
hypno toad

Bullet cam (please dumb it down for me)

Recommended Posts

As I said, I am a total noob at scripting, all I know is that the script goes in the initialization.

So could somebody dig up a bullet camera script, and then tell me what names (in the script) I have to change to make it work?

I would really appreciate any help, I am flying blind.

Share this post


Link to post
Share on other sites

<span style='color:darkred'>Thanks to JasonO for his tweaking/remaking this script and thanks KyleSarnik for the original bullet cam script </span>

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_projectile = nearestobject [_this select 0,_this select 4];

setacctime 0.35;

_camera = "camera" camCreate (getpos _projectile);

_camera cameraeffect ["internal", "back"];

while{alive _projectile && alive _camera}do

{

_camera camSetTarget _projectile;

_camera camSetRelPos [0,-13,1.2];

_camera camCommit 0;

sleep 0.0001;

};

if(alive _camera)then{sleep 1};

_camera cameraeffect ["terminate", "back"];

camdestroy _camera;

setacctime .99;

exit

I dunno if this helps, but this is a basic bullet cam that captures every projectile fired from the unit you run the event handler on.

Create a text file in the mission you are working on. Save the above script as bulletcam.sqf

In the unit's INIT line, put this in:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addeventhandler [""fired"",{_this execVM ""bulletcam.sqf""}];

I still haven't had time to try out the ammo specific bullet cams...like only running the bulletcam script on certain projectiles you fire e.g: don't run bullet cam on the M4 rifle of the AT soldier, but run the script on the anti-tank projectile.

This one has been tweaked so that you are far enough away from the bullet on impact there is a few seconds before the projectile hits when you can see the target get taken out.

Hope that helps  smile_o.gif

Share this post


Link to post
Share on other sites

He made a typo

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addeventhandler [""fired"",{_this execVM ""bulletcam.sqf""}]";

heres the fix

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addeventhandler [""fired"",{_this execVM ""bulletcam.sqf""}];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×