Jump to content
Sign in to follow this  
kerosene

Following a plane in a cutscene

Recommended Posts

I've got an intro where a convoy gets ambushed, and it shows the trucks heading down the road and then pans out to the ambushers at about the time they start attacking.

I want it to end with a plane flying over the area and spotting the burning vehicles.

This has been a problem for numerous reaons, i dont really mid if it views the planes from the ground up or looks down onto the ground from above the plane, but I only know the basics and I can only get a shot that follows the plane for a little while and then stops and watches the plane fly into the horizon.

I tried to use the chase cam script by Snyipr but it did'nt work very well along side the normal camera's, mostly cause i couldnt find a good way to trigger it and be sure the last camera had stopped.

Also im having trouble getting the plane to go where I want, but i might switch it to a chopper if it's to much of a pain to get it to fly exactly where I want it.

So, basically I need a good way to follow a plane and show the ground underneath it , and ideally a way to force the plane along a very strict route.

The planes a special ops piper, it dosent fly to fast and I reduced the speed to limited.

Share this post


Link to post
Share on other sites

This should work:

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

#ChaseCamRepeat

_cam camsettarget Plane1

_cam camsetrelpos [0,0,5]

_cam camsettarget target1

_cam camcommit 0

?(ChaseCam):goto "ChaseCamRepeat"

Plane1 is the name of your plane

target1 is a gamelogic object where you want the camera to target

This is a loop script. When you want the scene to end just set ChaseCam=false by a trigger ingame.

I suppose you might want to edit the camera offset, it's currently following the plane 5 meters above it.

What comes to the plane following a strict line I suggest you use a setpos and setdir just before the camera loop begins. ie put a gamelogic named "startpoint" to a point where you want to the plane to start when the camera loop begins, then put this before the camera loop script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Plane1 setpos [(getpos startpoint select 0), (getpos startpoint select 1), 50]

Plane1 setdir 0

now the plane flies to north 50 meters above the gamelogic when the camera loop begins

Hope this helps smile_o.gif

Share this post


Link to post
Share on other sites

Thanks, it looks a lot nicer now, and I learnt some new stuff too.

Share this post


Link to post
Share on other sites

Hiya King,

Will the camera stay in the same postion? or will it stay in its relative position to the plane?

I am doing something similar using the VehicleCam.sqs script but as soon as the plane turns around for a second pass over the target area i am now viewing the front of the plane and not the rear anymore.

Share this post


Link to post
Share on other sites

The camera will stay in the same position even if it turns (so you'll be facing the front all the time if you have the relpos set that way.)

You need to add a ~0.01 loop in there as that script is looping as fast as your CPU can handle..

Share this post


Link to post
Share on other sites
Hiya King,

Will the camera stay in the same postion? or will it stay in its relative position to the plane?

I am doing something similar using the VehicleCam.sqs script but as soon as the plane turns around for a second pass over the target area i am now viewing the front of the plane and not the rear anymore.

setrelpos sets the cams position relative to the targeted object so if you want the camera attached to the planes ass put _cam setrelpos [0,-5,0] or so.

Share this post


Link to post
Share on other sites
Hiya King,

Will the camera stay in the same postion? or will it stay in its relative position to the plane?

I am doing something similar using the VehicleCam.sqs script but as soon as the plane turns around for a second pass over the target area i am now viewing the front of the plane and not the rear anymore.

setrelpos sets the cams position relative to the targeted object so if you want the camera attached to the planes ass put _cam setrelpos [0,-5,0] or so.

No, it won't. At least not in my experience. setrelpos only does it once, so if your plane or whatever is moving, you'll have to loop it like this.

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

_cam = "camera" camcreate [0,0,0]

_cam cameraeffect ["external","back"]

_cam camsettarget myplane

_cam camsetrelpos [-5,4,0]

_cam camcommit 0

_counter = 0

#loop1

_counter = _counter +1

_cam camsetrelpos [-5,15,-4]

_cam camcommit 1

~0.5

?_counter != 25: goto "loop1"

_cam cameraeffect ["terminate", "back"]

camdestroy _cam

This way you'll have a camera that smoothly follows your vehicle.

Share this post


Link to post
Share on other sites

Thanks Artak, its a major pain in the arse when he turns that plane around and all you see is his smiling mug instead of the action.

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  

×