OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: mr reality on 26 Apr 2005, 18:21:28

Title: Camera scipt won't end
Post by: mr reality on 26 Apr 2005, 18:21:28
Can anyone tell me why my script won't end. Everything runs fine until it comes to the end of the script when it just stays in the black out screen  ???. The script is activated by a trigger at the start of my mission not in the intro part.

Quote
;===   "cutscene.sqs"

0 fadeSound 0

titlecut ["", "black in", 3]
_camera = "camera" camCreate [11257.57,10078.09,1.81]
_camera cameraEffect ["internal","back"]


_camera camSetTarget [-82003.51,41834.35,17145.70]
_camera camSetPos [11257.57,10078.09,1.81]
_camera camSetFOV 0.018
_camera camCommit 10
@camCommitted _camera

~4

titlecut ["", "black in", 3]
_camera = "camera" camCreate [11257.57,10078.09,1.81]
_camera cameraEffect ["internal","back"]


_camera camSetTarget boat
_camera camSetPos [11257.57,10078.09,1.81]
_camera camSetFOV 0.100
_camera camCommit 10
@camCommitted _camera

~4

_cam cameraEffect ["terminate","back"]
camDestroy _camera
titlecut ["", "Black Out", 3]

0 fadeSound 1

exit
Title: Re:Camera scipt won't end
Post by: RujiK on 26 Apr 2005, 18:23:27
easy. you put
Code: [Select]
_cam cameraEffect ["terminate","back"]
The name of your camara isnt _cam, its _camera, thus your deleting a camera that doesnt exzist.
Title: Re:Camera scipt won't end
Post by: mr reality on 26 Apr 2005, 18:30:32
I actually slapped my forehead about two minutes ago because i actually realised what i had done  :-[

Thanks for the super quick reply though buddy.   ;D
Title: Re:Camera scipt won't end
Post by: General Barron on 26 Apr 2005, 23:03:16
easy. you put
Code: [Select]
_cam cameraEffect ["terminate","back"]
The name of your camara isnt _cam, its _camera, thus your deleting a camera that doesnt exzist.

You'd be surprised how many times I've messed myself up doing exactly that.  :o For me, the problem is when I copy stuff from an old camera script that I wrote before I started using camera.sqs. The tutorial I based those scripts on used _cam instead of _camera. Now I always use _camera so no confusion happens.