OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: gadolinite on 24 May 2003, 06:24:41

Title: camera repulsion by vehicle
Post by: gadolinite on 24 May 2003, 06:24:41
I suddenly got good at scripting cutscenes.  But I have a question.

How would you get a camera to look into the windshield of a BRDM and have the camera maintain a distance of 3 or 4 meters behind? The BRDM is moving.
Title: Re:camera repulsion by vehicle
Post by: Knut Erik on 24 May 2003, 16:15:48
You'll need a script...

_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]
Stop = False
#Loop
_camera camSetTarget YourBRDM
_camera camSetRelPos [2,2,2] *NOTE 1
_camera camSetFov 0.7
_camera camCommit 0
?not Stop : goto "Loop" *NOTE 2

*Note1 : Experimate with this command to get the dezired effect
*Note2 : When the variable "Stop" is set to true, the script will stop. If it is false, the script will continiue.
Title: Re:camera repulsion by vehicle
Post by: gadolinite on 24 May 2003, 19:25:28
how would you make stop true after three seconds?
Title: Re:camera repulsion by vehicle
Post by: gadolinite on 24 May 2003, 20:20:58
 :-[ :-[Never mind, I figured it out :-[ :-[

for anyone with the same question or similar, here is how I did it.

 :-* :-*I set up another script called timer.sqs

_ctr = 6
#loop
_ctr = _ctr - 1
~3
?_ctr > 0 : loop
Stop = true

 8) 8) 8)This keeps the camera repelling for a few seconds.

Q: But How is the script activated?

A: -set up a switch trigger, condition x == 1
    -in the camera script, before the repulsion code, put x = 1,
    -the timer script will kick in when execution hits this line