Jump to content
Sign in to follow this  
Omnicide_Perez

Camera script not entering camera loop with Attachto command in it.

Recommended Posts

Hello,

I have been having a problem with this camera script for the last few days. I have been looking over the forums for a fix, but could not find one. Also, I have been poring over the AMS Cam scripting Tutorials for Arma and Arma2, But It doesn’t seem to cover the “attachto†command while camera scripting. Furthermore, I am by no means a scripter. My current skill level is limited to finding what I need and then Copy/Paste in to my missions or reading tutorials to get what I need done.

My problem is this….

From the first camera shot (“1st cam posâ€) the script will not move on to enter the second camera shot (“2nd HMMWV low angleâ€) loop which has the “attachto†command in.

However, If I delete the “1st cam pos†camera shot completely, thus, meaning the camera script has only one camera shot in it, the “2nd HMMWV low angle†then the script will enter the loop and work as intended.

So my question is this…

How do I get my camera script to move on from previous camera

shots and then enter my “2nd HMMWV low angle†loop shot?

Any help will be appreciated. Ty.

Here is my camera script...

titlecut [" ","black in",6]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]

;=== 15:43:18 1st cam pos
_camera camPrepareTarget [84614.73,70470.46,467.27]
_camera camPreparePos [8010.28,6191.70,15.95]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera

~12

#loop
;=== 2nd HMMWV low angle
_camera attachTo [c2, [-1.4,1.2,-1]];
_camera camPrepareFOV 0.700
_camera camCommit 0
@camCommitted _camera
? cp1_drvr distance chkpnt <=5: goto "next scene 01"
goto "loop"


#next scene 01
titlecut ["","black out",6]
~6
Player cameraeffect ["terminate","back"]
camdestroy _camera
end1=true;
exit;

As you can see I have keep this script short and to the point in hopes of cutting out any confusion.

The effect I am going for here with the “attachto†command is very similar to that of dashcam’s on police cars.

Share this post


Link to post
Share on other sites

I really had to contemplate this one. The problem, which is easy to fix, is that once the camera has a position and target set, the attachTo command will not override it. You have to clear it out. Just add these 2 lines right above #loop:

_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]
#loop

Ok so I put #loop in there, just to make obvious ;)

Share this post


Link to post
Share on other sites

TY AZCoder that did the trick. It works perfectly now. And, thank you again for making it "obvious" ,because every little bit helps noobs like me. :)

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  

×