trini scourge 1 Posted June 25, 2007 Hi folks, i'm trying to fix the camera to the wing or nose of an aircraft, but the camera is fixed and doesn't move along with the aircraft. Can anyone help me out? tr1n. Share this post Link to post Share on other sites
InqWiper 0 Posted June 25, 2007 Create a script that loops cam camsetrelpos [x,y,z] cam camcommit 0 I suggest using 2 cameras for what you are trying to do (I assume you dont want the center of the plane to be in the center of the screen). One that the view is from and the other to be targeted by the first camera. Both cameras need a loop for updated position ofcourse. Share this post Link to post Share on other sites
stuntboy 0 Posted June 25, 2007 Hi Trini I am no scripting guru by any means, but you aren't getting much help here so I will suggest trying this code in your camera.sqs when you want the vehicle to be followed: #loop1 ;set yourvehiclename to the vehicle name you want to follow _camera camsettarget yourvehiclename ;increase the last 2 numbers for bigger vehicles _camera camsetrelpos [0,-10,3] _camera camcommit 0 @camcommitted _camera ~0.01 ;to deactivate the script, have a trigger that has triggeractname in the on activation field ?triggeractname : goto "loop1" Maybe the last line of code will need to be ?triggeractname == 1 : goto loop1.... not sure. haven't got time to check if it works at the mo. If this doesn't work maybe try looking into how bullet cams work and adjust to make work for a vehicle. Stuntboy Share this post Link to post Share on other sites
trini scourge 1 Posted June 25, 2007 Thx for the help guys Stuntboy i'm at work right now so cant test it out, but i will as soon as i get home. Thx again! tr1n. Share this post Link to post Share on other sites
warpuppy 0 Posted June 27, 2007 Hi there @ Stuntboy Could you please explain in a little more in detail, i have been trying to do this for the last three days and all i get is an error and the camera doesnot follow the vehicle The help would be much appreciated Share this post Link to post Share on other sites
Cloughy 0 Posted June 27, 2007 Search for a VehicleCam script here or at ofpec, i have one that i use. It was from the old OFP days, i think i got it from another mission. I certainly didnt make it. Cheers GC Share this post Link to post Share on other sites
InqWiper 0 Posted June 27, 2007 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">cam1="camera" camcreate [0,0,0] cam2="camera" camcreate [0,0,0] cam3="camera" camcreate [0,0,0] cam1 camsettarget plane1 cam2 camsettarget plane1 cam3 camsettarget cam1 cam3 camcommit 0 cam3 cameraeffect ["Internal","back"] #Loop cam1 camsetrelpos [5,2,0] cam2 camsetrelpos [5,-2,0] cam1 camcommit 0 cam2 camcommit 0 cam3 setpos getpos cam2 ?!ExitCam:goto "Loop" cam2 cameraeffect ["Terminate","back"] camdestroy cam1 camdestroy cam2 camdestroy cam3 exit It wont follow the wing up/down when the plane turns but it works if the plane flies in a straight line. You  might want to tweak the relpos values a bit I only made it work I didnt try to make it look perfect. Share this post Link to post Share on other sites
trini scourge 1 Posted June 27, 2007 I used: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">useCamera = true _c = "camera" camCreate getPos plane1 _c cameraEffect ["internal","front"] _c camSetTarget plane1 _c camSetFov 0.7 _c camCommit 0 #loop _c camSetRelPos [0, 9, -0.5] _c camCommit 0 ? useCamera : goto "loop" _c cameraEffect ["terminate","front"] camDestroy _c It worked just fine Share this post Link to post Share on other sites
warpuppy 0 Posted June 27, 2007 @ everyone it works now Thanks a lot guys cant thank you enough this what makes arma great once again thanks Share this post Link to post Share on other sites
johnnyboy 3797 Posted June 28, 2007 You may want to add a wait command within the loop so it doesn't use as much cpu: ~.01 Share this post Link to post Share on other sites
InqWiper 0 Posted June 28, 2007 You may want to add a wait command within the loop so it doesn't use as much cpu:~.01 I tried that first and it got really choppy, dont ask me why, i thought it shouldnt. Its not like you are gonna notice a FPS difference anyway. Share this post Link to post Share on other sites
nullsystems 0 Posted July 10, 2007 Hola! Just a quick question: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _c = "camera" camCreate getPos chopper _c cameraEffect ["external","back"] _c camSetTarget chopper _c camSetFov 0.7 _c camCommit 0 #loop _c camSetRelPos [0, -9,1.5] _c camCommit 0 ?(_time < 15) : goto "loop" _c cameraEffect ["terminate","front"] camDestroy _c How would I get that to exec from a trigger/addaction, but only to the person who initiates it? So far, when someone steps on it in MP, everyone gets it Share this post Link to post Share on other sites
InqWiper 0 Posted July 10, 2007 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!(player in list TriggerName):exit Share this post Link to post Share on other sites
nullsystems 0 Posted July 10, 2007 Short n sweet So if I do this: Trigger " none ", Name " camtrig " : Cond: player distance camtrig < 2 act: addaction etc. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!(player in list camtrig):exit TitleCut["Chopper Cam Initialized","Black out"]; ~2 TitleCut["","Black in"]; _c = "camera" camCreate getPos heli1 _c cameraEffect ["external","back"] _c camSetTarget heli1 _c camSetFov 0.7 _c camCommit 0 #loop _c camSetRelPos [0, -9,1.5] _c camCommit 0 ?(_time < 15) : goto "loop" TitleCut["Camera Link: Closing","Black out"]; ~2 TitleCut["","Black in"]; _c cameraEffect ["terminate","back"] camDestroy _c Then the addaction and camera will only show for those who activate it? Share this post Link to post Share on other sites
nullsystems 0 Posted July 10, 2007 That didnt work, my addaction showed but no camera. Share this post Link to post Share on other sites