Jump to content
Sign in to follow this  
p75

KyleSarnick bullet cam script requested

Recommended Posts

Does someone have the KyleSarnick Bulletcam script?

Share this post


Link to post
Share on other sites

My what what?

:confused:

I wasn't aware I made one... lol

I've written a lot of code here though so it is possible.

Share this post


Link to post
Share on other sites
My what what?

:confused:

I wasn't aware I made one... lol

I've written a lot of code here though so it is possible.

Hey mate,

See:

Can't find that script anywhere

Share this post


Link to post
Share on other sites
Could you mean this?

(Can't watch YouTube vid here at work)

Hey mate,

I think so, could you please inform me what I need to do to get it working in the editor? Sorry, but I'm new to the scene. Would greatly appreciate your and input!

Edit: Was too fast, found the info, Superb Thanks!!! Would this also work in Arma 2? If not, can you make it for Arma 2?

---------- Post added at 02:50 PM ---------- Previous post was at 02:44 PM ----------

How do I make it work for the sniper rifles?

Share this post


Link to post
Share on other sites

I haven't tried it, but if it worked in ArmA (presumably it did based on all the feedback in that thread ;)) then chances are it will work in ArmA2.

Btw, I really didn't know that many people used this code... quite a pleasant surprise. :D I hope they properly credited me...

How do I make it work for the sniper rifles?

Replace the contents of _list with bullets classnames for the sniper rifles, which you should be able to find on the Wiki. I'd give you a link but it's blocked here at my workplace (and I don't know them off-hand) so it's the best I can do.

Share this post


Link to post
Share on other sites
I haven't tried it, but if it worked in ArmA (presumably it did based on all the feedback in that thread ;)) then chances are it will work in ArmA2.

Btw, I really didn't know that many people used this code... quite a pleasant surprise. :D I hope they properly credited me...

Hi Mate, there are quite a few movies on youtube and yes they credit you :-).

How do I make it working for all sniper rifles? Kinda new to this. Appreciate your input.

Where can I find the classnames? Found something trying it out!

Edited by p75

Share this post


Link to post
Share on other sites

If you can't get the bullet classnames you could try replacing the following line:

if((_this select 4) in _list)then{

With this:

if((_this select 1) in _list)then{

And then populate _list with these classnames.

Share this post


Link to post
Share on other sites
If you can't get the bullet classnames you could try replacing the following line:

if((_this select 4) in _list)then{

With this:

if((_this select 1) in _list)then{

And then populate _list with these classnames.

Hey mate,

I made this:

_list = ["B_127x99_Ball_noTracer ", "B_762x51_noTracer "............

Running Ace, btw, but when I select the M24 under unit Ranger, Sniper (M24) nothing happens.

I will give your suggestion a go, thanks!

Share this post


Link to post
Share on other sites

Hehe, I'm confused now. Are you using it in ArmA or ArmA2? The classnames for those sniper rifles I gave you are for ArmA2. As for ACE mod, I assume you mean ArmA, and since you're using ACE the bullet classnames are probably different.

Share this post


Link to post
Share on other sites
Hehe, I'm confused now. Are you using it in ArmA or ArmA2? The classnames for those sniper rifles I gave you are for ArmA2. As for ACE mod, I assume you mean ArmA, and since you're using ACE the bullet classnames are probably different.

Sorry, mate, my bad. I'm using it for both. Now, I'm testing it on ARMA with Ace mod installed. Later I will test it on ARMA 2.

How should the addeventhandler line exactly look like?

unit addeventhandler ["fired",{_this execVM "cam.sqf"}]

What should I put for unit?

Share this post


Link to post
Share on other sites

You want to put the eventhandler in the init field of the unit who fires the shot (presumably the player), in which case you should use this in place of unit.

So in player's init field:

this addeventhandler ["fired",{_this execVM "cam.sqf"}]

Will also work on any unit you add it to. However if another one of these units fires you'll still see the bullet cam.

Share this post


Link to post
Share on other sites
You want to put the eventhandler in the init field of the unit who fires the shot (presumably the player), in which case you should use this in place of unit.

So in player's init field:

this addeventhandler ["fired",{_this execVM "cam.sqf"}]

Will also work on any unit you add it to. However if another one of these units fires you'll still see the bullet cam.

So,

I make a cam.sqf and place it in my custom mission with the following code:

=================================================

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

cam.sqf:

<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];

_list = ["B_127x99_Ball_noTracer","B_762x51_noTracer","R_M136_AT","M_Javelin_AT","M_Stinger_AA","R_PG7V _AT","R_PG7VR_AT","M_Strela_AA","R_Hydra_HE","R_57 mm_HE","R_80mm_HE","M_Sidewinder_AA","M_TOW_AT","M _AT5_AT","M_Hellfire_AT","M_Vikhr_AT"];

if((_this select 4) in _list)then{

setacctime 0.5;

_camera = "camera" camCreate [0,0,0];

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

while{alive _projectile && alive _camera}do{

_camera camSetTarget _projectile;

_camera camSetRelPos [0,-13,1.2];

_camera camCommit 0;

sleep 0.001;

};

if(alive _camera)then{sleep 1};

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

camdestroy _camera;

setacctime 1;

};

See bold part for ammo, hope they are the good ones?

And then in the init field:

====================================

this addeventhandler ["fired",{_this execVM "cam.sqf"}]

Correct???

Share this post


Link to post
Share on other sites

Lol, you've been vitcimized by the old forum quote/code tags. Those aren't actual code. Let me fix it for you (note I will also make a few changes based on feedback from the thread I initially posed it in).

This is what you place in cam.sqf:

_projectile = nearestobject [_this select 0,_this select 4];
_list = ["B_127x99_Ball_noTracer","B_762x51_noTracer"];
if((_this select 4) in _list)then{
setacctime 0.5;
_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.001;
};
if(alive _camera)then{sleep 1};
_camera cameraeffect ["terminate", "back"];
camdestroy _camera;
setacctime 1;
};

The file goes into your mission folder.

Then in the init field (which you had correct) you put:

this addeventhandler ["fired",{_this execVM "cam.sqf"}]

Share this post


Link to post
Share on other sites
Lol, you've been vitcimized by the old forum quote/code tags. Those aren't actual code. Let me fix it for you (note I will also make a few changes based on feedback from the thread I initially posed it in).

This is what you place in cam.sqf:

_projectile = nearestobject [_this select 0,_this select 4];
_list = ["B_127x99_Ball_noTracer","B_762x51_noTracer"];
if((_this select 4) in _list)then{
setacctime 0.5;
_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.001;
};
if(alive _camera)then{sleep 1};
_camera cameraeffect ["terminate", "back"];
camdestroy _camera;
setacctime 1;
};

The file goes into your mission folder.

Then in the init field (which you had correct) you put:

this addeventhandler ["fired",{_this execVM "cam.sqf"}]

Great mate!!!

This worked, I'll test it also in Arma 2. Superb work!!!

Could you explain the script abit?

I'll now test it for a hour or two and send you my updates if it needs any fixing. Superb work again!

Thanks bro, works in Arma 2 also, pm'd you.

Edited by p75

Share this post


Link to post
Share on other sites

I can´t make it work! I tried it all day...

I opened notepad and pasted all the code, and I saved it as "cam.sqf" (not "cam.sqf.txt"), and then, I put it in "C:\Program Files\Bohemia Interactive\ArmA 2\missions". Is this correct?

In the init field of the unit, I writed "this addeventhandler ["fired",{_this execVM "cam.sqf"}]"

Then, I created a mission with a M107 Sniper, and when I shoot, a message appears: "Script cam.sqf not found"...

Sorry for my bad english

Edited by L96ghilled

Share this post


Link to post
Share on other sites
I can´t make it work! I tried it all day...

I opened notepad and pasted all the code, and I saved it as "cam.sqf" (not "cam.sqf.txt"), and then, I put it in "C:\Program Files\Bohemia Interactive\ArmA 2\missions". Is this correct?

In the init field of the unit, I writed "this addeventhandler ["fired",{_this execVM "cam.sqf"}]"

Then, I created a mission with a M107 Sniper, and when I shoot, a message appears: "Script cam.sqf not found"...

Sorry for my bad english

Hi mate,

No, you need to put them in your documents folder, there is also a Arma folder.

Grtz

Share this post


Link to post
Share on other sites

In "My documents" there are 2 folders: ArmA 2, and ArmA 2 Other Profiles.

Do you mean "C:\Documents and Settings\User\My documents\ArmA 2 Other Profiles\User\missions\Bullet_cam_mission.utes"?

I think cam.sqf must go with other one named "mission.sqm"

Thanks!

Edited by L96ghilled

Share this post


Link to post
Share on other sites

:yay:It works!:yay:

"C:\Documents and Settings\User\My documents\ArmA 2 Other Profiles\User\missions\Bullet_cam_mission.utes

That's correct. But I needed a file called "Init.sqf" in the same folder, and write inside:

execVM "cam.sqf";

if(true) exitWith {};

Share this post


Link to post
Share on other sites

Hi,

Is it possible to adjust the code so it only gets called when a specific target is killed - like in an assassination mission when you only want to see the target die?

Share this post


Link to post
Share on other sites
Hi,

Is it possible to adjust the code so it only gets called when a specific target is killed - like in an assassination mission when you only want to see the target die?

No, because after the target dies, there is no bullet to follow....

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  

×