OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Blanco on 03 Dec 2004, 05:39:47

Title: Flyby - Driveby camscript
Post by: Blanco on 03 Dec 2004, 05:39:47
Required
Basic knowledge of camscripting

What this script is :
This script creates a camera in front of a vehicle and follows it until it passes the camera. Once the vehicle moves away from the camera it starts to zoom in.
You don't need triggers, gamelogics,markers or whatever..., just the FB_DB.sqs and your own camscript.
It's a bit like the flyby-view in a flightsimulator.
It could save you a lot of time, because you don't have to place gamelogics along the vehicles route, this script creates them automatically, actually it creates two gamelogics, one for the vehicles position, the second one for the cameraposition.

Usage

You 'll have to run this in your camerascript  :
First create your camera :

Code: [Select]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]

Run the script via these parameters :

- camera id
- Vehicle to follow

Example

Code: [Select]
[_camera, truck] exec "FB_DB.sqs"
To exit the script :

Quote
flybycam = false
@flycamdone == 1


The first bolean is needed to exit the loops, the second variable is needed to prevent two camera's are running at the same time. (it also waits until the zooming has ended)

Known Issues :

- Random positions are nice but they have a downside, especially on groundlevel. Don't use the script in dense areas because you don't want a camera in a house so it's view is blocked. Also avoid hilly landscapes when you use it on LandVehicles.
- Not optimised for ships or troops.

Credits to Pablom123 for his mileagecalculator (I've use some parts from it)

Try the demo, no addons needed.
Suggestions are welcome.

-Blanco-

 
Title: Re:Flyby - Driveby camscript
Post by: .pablo. on 09 Dec 2004, 01:56:27
i'll have to put that self-placing gamelogic trick in my mileagecalculator

thanks for accrediting me  :)

as for the demo, it all worked perfectly, so i can't think of any way you could improve upon it  :P