Jump to content
Sign in to follow this  
DestroyerX

Camera-Scripting

Recommended Posts

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 smile.gif) 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

_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

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

A BIG clap for Rob... (only kidding) :biggrin:

Share this post


Link to post
Share on other sites

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

No prob Rob, i'm glad your helping me smile.gif At this moment i'm busy with all things i have to do for people smile.gif So mostly I would respond faster. But i'm gonna try it soon, thanks!

Share this post


Link to post
Share on other sites

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

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 smile.gif 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

</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 smile.gif 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

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

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

You're right Rob, it doesn't work, but thanks smile.gif 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

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

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

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

Destroy,

You've defined target for the wrong camera.

if your camera name is _cam, you should order it to target the flagpole smile.gif

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

Fishu, it won't work. But this was not very important smile.gif

and Rob, yea you could send me it and thanks for that other script m8 smile.gif I had some idea... but wanted to know for sure.

Share this post


Link to post
Share on other sites

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

btw RED has finally put the editing page up. lol

Share this post


Link to post
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×