Jump to content
Sign in to follow this  
strike277

Camera follow terrain ?

Recommended Posts

How do I make a camera follow the terrain? In the start of the game it shows the camera moving over the water towards the island. How can I do this?

thanks

Share this post


Link to post
Share on other sites

place empty (invisible) markers the cam should follow, and animate the cam sequence from marker to marker...

Share this post


Link to post
Share on other sites

Thanks for the reply. How do I animate the sequence? Not sure how to do that.

thanks

Share this post


Link to post
Share on other sites

useCamera = true

_c = "camera" camCreate getPos mk_start

_cam camSetPos [getMarkerPos "mk_start" select 0, getMarkerPos "mk_start" select 1, 20];

_cam camSetTarget [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 0;

_cam camSetPos [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 30;

sleep 25;

camDestroy _c

This is the code I tried to use, but it gave me an error with the sleep 25; init. I took it out, got no error, but no camera either. I set up two game logic markers and named one mk_start and the other mk_end.

Sorry, but i'm a newbie at this if ya cant tell.

Share this post


Link to post
Share on other sites

Try with a semicolon ";" after the camdestroy command.

smile_o.gif

(It is like PASCAL. "Place A SemiColon All Locations.") wink_o.gif

Share this post


Link to post
Share on other sites

you create a camera _c, but you go on with _cam later ...

this mustn't happen wink_o.gif

and yes, don't forget semikolons at end of terms;

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_cam="camera" camCreate getPos mk_start;

_cam camSetPos [getMarkerPos "mk_start" select 0, getMarkerPos "mk_start" select 1, 20];

_cam camSetTarget [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 0;

_cam camSetPos [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 30;

sleep 30;

camDestroy _cam;

Share this post


Link to post
Share on other sites

Still getting an error on the sleep command. |#sleep 30;| Generic error in command. code I'm using below.

Quote[/b] ]useCamera = true

_cam="camera" camCreate getPos mk_start;

_cam camSetPos [getMarkerPos "mk_start" select 0, getMarkerPos "mk_start" select 1, 20];

_cam camSetTarget [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 0;

_cam camSetPos [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 30;

sleep 30;

camDestroy _cam;

Share this post


Link to post
Share on other sites

I changed the sleep 30 to ~30. Got the same error. Not even close to sure whats going on.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">useCamera = true

_cam="camera" camCreate getPos mk_start;

_cam camSetPos [getMarkerPos "mk_start" select 0, getMarkerPos "mk_start" select 1, 20];

_cam camSetTarget [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 0;

_cam camSetPos [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 30;

~ 30;

camDestroy _cam;

Share this post


Link to post
Share on other sites

May be I'm focusing on the wrong thing here. As stated I'm using the above listed code. I get the |#30| generic error upon it loading in. I does not go to cam view, but first person. Along with the code I've set down two markers mk_start and mk_end as well as a game logic with the exec command for the script.

Am I missing something?

Share this post


Link to post
Share on other sites

Try adding this the line before camdestroy

Quote[/b] ]cameraEffect ["Terminate", "Back"]

so it should look like this

Quote[/b] ]useCamera = true

_cam="camera" camCreate getPos mk_start;

_cam camSetPos [getMarkerPos "mk_start" select 0, getMarkerPos "mk_start" select 1, 20];

_cam camSetTarget [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 0;

_cam camSetPos [getMarkerPos "mk_end" select 0, getMarkerPos "mk_end" select 1, 20];

_cam camCommit 30;

~ 30;

cameraEffect ["Terminate", "Back"];

camDestroy _cam;

Hope it helps

Share this post


Link to post
Share on other sites

If I could offer advice I would, but I also need help making this kind of script except locking onto the target but animating the camera to move around the object.

So I bump this because it will also help me to create my camera script.

Share this post


Link to post
Share on other sites
It still does'nt work,Same error using the script provided.

There's also a semicolon missing in the first line: useCamera = true

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  

×