DestroyerX 0 Posted January 1, 2002 Heya's, happy New Year. I want a simple camera-script that targets a player or object. So, no zooming or moving stuff, but it just hangs still. (Same how that funny move in "How not to be seen" begins ) I looked at a tutorial to do it, but I don't get it really. If someone could type/send me a simple example from such a script, that'll be great. Thx.... Share this post Link to post Share on other sites
Rob 1 Posted January 1, 2002 _cam = "camera" camcreate [0,0,0] _cam cameraeffect ["internal", "back"] ;targets player _cam settarget player ;cameras position [left or right, front or back, up or down] _cam camsetrelpos [0, 6, 4] ;how long it takes for the camera to reach object _cam camcommit 0 ; how long the camera is committed to the object @camcommitted _cam ;wait 10 secs ~10 _cam cameraeffect ["terminate", "back"] camdestroy _cam exit -------------------------------------------------------------------- if u want the camera to go left, back or down in the setrelpos you have to use the minus syntax also "-" hope this helps mate. camera scripting is very simple once you have an idea. (Edited by Rob at 3:00 pm on Jan. 1, 2002) Share this post Link to post Share on other sites
DestroyerX 0 Posted January 1, 2002 Hey, thanks for the example m8! But, I copied everything u typed and setted a -. So now I have this: _cam = "camera" camcreate [0,0,0] _cam cameraeffect ["internal", "back"] ;targets player _cam settarget player ;cameras position [left or right, front or back, up or down] _cam camsetrelpos [0, -6, 4] ;how long it takes for the camera to reach object _cam camcommit 0 ; how long the camera is committed to the object @camcommitted _cam ;wait 10 secs ~10 _cam cameraeffect ["terminate", "back"] camdestroy _cam exit But when I try it in the game I get an error, something like: Unkown command "settarget" Share this post Link to post Share on other sites
Damage Inc 0 Posted January 1, 2002 You have to put it in a script. Share this post Link to post Share on other sites
DestroyerX 0 Posted January 1, 2002 Dude, I have it in a .sqs file... Share this post Link to post Share on other sites
Damage Inc 0 Posted January 1, 2002 I think that should be camsettarget instead of settarget. Share this post Link to post Share on other sites
MP 0 Posted January 1, 2002 A BIG clap for Rob... (only kidding) :biggrin: Share this post Link to post Share on other sites
Rob 1 Posted January 1, 2002 yeah sorry mate i went over it again to make sure it was ok and i thought there was something wrong in that part. _cam camsettarget player it should be... soz mate Share this post Link to post Share on other sites
DestroyerX 0 Posted January 1, 2002 No prob Rob, i'm glad your helping me At this moment i'm busy with all things i have to do for people So mostly I would respond faster. But i'm gonna try it soon, thanks! Share this post Link to post Share on other sites
DestroyerX 0 Posted January 1, 2002 Thanks! It works now! Share this post Link to post Share on other sites
Rob 1 Posted January 1, 2002 i have finished the camera scripting tutorial in the manual so when we have finished it you should easily make camera scripts. Share this post Link to post Share on other sites
DestroyerX 0 Posted January 2, 2002 Thanks, but before that. Actually I wanted to have this script to target an Object. A flag for example.... How to do that? And also that you see the whole flag not only the flagpole. (I saved the previous script on my harddrive) Â Thx Oh, you are right. I think when you understand it a bit better it's not so difficult.... (Edited by DestroyerX at 8:43 am on Jan. 2, 2002) Share this post Link to post Share on other sites
Fishu 0 Posted January 2, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Quote: from DestroyerX on 9:41 am on Jan. 2, 2002 Thanks, but before that. Actually I wanted to have this script to target an Object. A flag for example.... How to do that? And also that you see the whole flag not only the flagpole. (I saved the previous script on my harddrive) Â Thx <span id='postcolor'> _camera camsettarget nameofobject _camera camsetrelpos [0,10,8] you just got to name the flagpole and target it. then specify location for the camera, like that cam set relative position command. X,Y,Z (-W/E, -S/N,Height) Share this post Link to post Share on other sites
DestroyerX 0 Posted January 2, 2002 Hmmm, I now have this: _cam = "camera" camcreate [0,0,0] _cam cameraeffect ["internal", "back"] _camera camsettarget flag1 _camera camsetrelpos [0,10,8] ;cameras position [left or right, front or back, up or down] _cam camsetrelpos [0, -6, 4] ;how long it takes for the camera to reach object _cam camcommit 0 ; how long the camera is committed to the object @camcommitted _cam ;wait 10 secs ~10 _cam cameraeffect ["terminate", "back"] camdestroy _cam exit But it doesn't work. Share this post Link to post Share on other sites
Rob 1 Posted January 2, 2002 2 things for some reason i have never got the camera to be able to target a flag.. but that may be becuz its empty... i dont know.. secondly you have made two camsetrelpositions one after the other with no timing..... it would do _camera camsetrelpos [0,10,8] then straight after that _cam camsetrelpos [0, -6, 4]. you wouldn't even see the first one and if you rush the game like that it has a tendensy to crash... try this.. if it also helps take out the talking of the differences in the script...... _cam = "camera" camcreate [0,0,0] _cam cameraeffect ["internal", "back"] _camera camsettarget flag1 _camera camsetrelpos [0,10,8] ;cameras position [left or right, front or back, up or down] ~3 _cam camsetrelpos [0, -6, 4] ;how long it takes for the camera to reach object _cam camcommit 0 ; how long the camera is committed to the object @camcommitted _cam ;wait 10 secs ~10 _cam cameraeffect ["terminate", "back"] camdestroy _cam exit Share this post Link to post Share on other sites
DestroyerX 0 Posted January 2, 2002 You're right Rob, it doesn't work, but thanks I'm looking forward to your tutorial of simple camera-scripting. (Edited by DestroyerX at 12:07 pm on Jan. 2, 2002) Share this post Link to post Share on other sites
DestroyerX 0 Posted January 2, 2002 Great! I now know how to attach a camera to a player and how to change the view. But how do you attach a camera to a different unit? Share this post Link to post Share on other sites
Rob 1 Posted January 2, 2002 hehe if u want i can send u the page from the manual... its very simple. just simply define another target. ok you had the first target _cam camsettarget player or flag..... define the rest ~5 after five secs you will move to another unit called aP _cam camsettarget aP define the rest... its very simple. Share this post Link to post Share on other sites
Rob 1 Posted January 2, 2002 go here X ignore the editing page in the manual... i have finished it but RED hasn't put the full one up yet. (Edited by Rob at 2:14 pm on Jan. 2, 2002) Share this post Link to post Share on other sites
Fishu 0 Posted January 2, 2002 Destroy, You've defined target for the wrong camera. if your camera name is _cam, you should order it to target the flagpole Just erase that _camera camsetrelpos and change targeting command for _cam instead of _camera. (And leave that one _cam camsetrelpos there) should work as far as i know. Share this post Link to post Share on other sites
DestroyerX 0 Posted January 2, 2002 Fishu, it won't work. But this was not very important and Rob, yea you could send me it and thanks for that other script m8 I had some idea... but wanted to know for sure. Share this post Link to post Share on other sites
Rob 1 Posted January 2, 2002 fishu you need some advice.... destroyer i gave you the site where it was... theres a link on the post above. Share this post Link to post Share on other sites
Rob 1 Posted January 2, 2002 btw RED has finally put the editing page up. lol Share this post Link to post Share on other sites
Rob 1 Posted January 2, 2002 tell me what you think of it.. wether its good or needs improving!? im also trying to persuade snYpir to lte me use his advanced camera tutorial Share this post Link to post Share on other sites