Home   Help Search Login Register  

Author Topic: Bomb Cam..  (Read 2641 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Bomb Cam..
« on: 10 Apr 2007, 17:28:45 »
Hi,

When I get the aircraft to drop a bomb, how would I go about creating a camera to target it? I could do the camera business ok, just need a variable of what to target.

This is what I have so far

init.sqs
Quote
_unit = plane1
_unit addeventhandler ["FIRED",{_this exec "cam.sqs"}]
exit

cam.sqs
Quote
hint format ["%1\n%2\n%3\n%4",(_this select 0),(_this select 1),(_this select 2),(_this select 3)]

_cam = "camera" camcreate getpos (_this select 3)
_cam cameraeffect ["internal", "back"]
_i = 0

#loop
_cam camPrepareTarget (_this select 0)
_cam camPrepareRelPos [5,5,2]
_cam camPrepareFOV 1.1
_cam camCommitPrepared 0
~0.01
_i = _i + 1
?_i > 300 : goto "end"
goto "loop"

#end
_cam cameraeffect ["terminate", "back"]
camdestroy _cam

exit

The hint displays 4 lines, the top line is the vehicle, and the bottom 3 is the same.

The cam.sqs I have there targets the plane ok, but if I change the (_this select 0) to any of the others (that I have used in my hint box), I get an error.



Does anyone know how I can get it so the camera targets the bomb thats dropped?

Thanks in advance.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Bomb Cam..
« Reply #1 on: 10 Apr 2007, 17:53:43 »
The info returned from the event handler may give the type of ammo, but does not return the object that is the ammo. In your script try using the (getPos _this select 0)  nearestObject (_this select 4) command to hook the bomb itself to a variable name. Then use that variable in your camera commands.
urp!

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Bomb Cam..
« Reply #2 on: 10 Apr 2007, 18:12:06 »
Thanks a lot peanut!  :good:

Quote
_bomb = nearestObject [_this select 0, _this select 4]

Targeting  _bomb worked.

Once again thanks for your help  :yes:

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Bomb Cam..
« Reply #3 on: 10 Apr 2007, 23:10:22 »
Jason, do you have a demo of that script? I'd like to see it in action.  ;)

TCM

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Bomb Cam..
« Reply #4 on: 11 Apr 2007, 18:20:26 »
Yeh sure.
I've attached it below. Change the plane unit to anything you want, and play around with the script to get a different position etc with the bomb. Also once the scripts start the bomb is dropped in slow motion, when it blows up it returns to normal and camera ends.

http://www.youtube.com/watch?v=8YtMzAnKONI

A little video I made to improve my Sony Vegas skills. The script has a few seconds of fame in that.

Offline Cheetah

  • Former Staff
  • ****
Re: Bomb Cam..
« Reply #5 on: 13 Apr 2007, 15:51:03 »
I suggest that you prepare the bomb cam script for the resource beta testing part of the forum. There might be others interested in the script and you will get more feedback on it there.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline D_P_

  • Members
  • *
  • YAY! I'm a lama again! ...oh wait.
    • ArmaAddons
Re: Bomb Cam..
« Reply #6 on: 16 Apr 2007, 00:57:36 »
That script rocks!�  :good:

I have one question about it....

Is it possible to have the camera slowly zoom out after impact and destruction so that you can view the bodies and debris flying everywhere?
I also want to use this script for an AA spec...  but the the stinger hits the heli...  I want the cam to focus on the heli as it spirals down to it's death!
Any ideas?!

Thanks in advance.
just setpos & forgetpos!

Offline Cheetah

  • Former Staff
  • ****
Re: Bomb Cam..
« Reply #7 on: 16 Apr 2007, 17:00:32 »
A camera focus is easy, just do something like:

_camera camPrepareTarget helicopter;

and look it as long as you want.

Probably good to read: topic 1, topic 2.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Monkels

  • Members
  • *
Re: Bomb Cam..
« Reply #8 on: 19 Apr 2007, 23:24:53 »
How would i go about getting an AI to drop a bomb so veiw it droping from the ground?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Bomb Cam..
« Reply #9 on: 19 Apr 2007, 23:57:21 »
Quite easy,
bomb = "Bo_GBU12_LGB" createVehicle [getPos player select 0, getPos player select 1, 100]

And dont forget to look up  :D

Offline Monkels

  • Members
  • *
Re: Bomb Cam..
« Reply #10 on: 20 Apr 2007, 00:29:24 »
Wouldn't that make them drop straight down? Would it not be possible to give them momentum?

guess i could just fly the harrier over the target and  tweak that snippet to drop bombs over the targets, might look a bit crap but should work


with my method ive just found,  Using triggers telling the plane to drop the bombs manually

eg

Code: [Select]
plane1 fire 'BombLauncher';
The bombs seem to drop quite randomly,  but looks quite good

cheers for that :)

Offline Cheetah

  • Former Staff
  • ****
Re: Bomb Cam..
« Reply #11 on: 20 Apr 2007, 23:30:23 »
Or you could check the velocity of the plane and use setVelocity to give the same speed to the bomb. I suggest yours though as long as it works fine.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!