Jump to content
Sign in to follow this  
LeafMaster510

Making camera script

Recommended Posts

Hello.

I have question.

How to made a camera script in advanced mode, e.g.:

_camera setCamPos [54367,5432,43]
_camera camSetTarget [7765,3523.1,4]
_camera camSetFOV 0.700
_camera camCommit 0

I taking a coordinates from WrpTool (I loading map, e.g, everon, and write out coordinations from a box at the bottom of the screen).

Someone know easier way to get that coordinates? Any program or something like this? Help guys :eek:

Share this post


Link to post
Share on other sites

You do this by "camera.sqs"

You insert a unit on the map and in its INIT field you write:

this exec "camera.sqs"

Then you will get a film strip screen like in a intro but you will have a crosshair in the middle, use the arrows on your keyboard to navigate and the Q & Z to change altitude and if you hold SHIFT you will move faster.

Find a spot were you would like your camera to be and press left CTRL, now switch to Windows and open a notpad window and press "Paste" (CTRL + V).

should look something like this:

;=== 20:51:45
_camera camSetTarget [9533.20,103967.28,30.57]
_camera camSetPos [9533.20,3967.28,2.00]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera

Now go back to OFP and find the possition were you want your camera to travel to, againn press CTRL, switch back to notepad and paste the text under the first one so you have something like this:

;=== 20:51:45
_camera camSetTarget [9533.20,103967.28,30.57]
_camera camSetPos [9533.20,3967.28,2.00]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera

;=== 20:52:52
_camera camSetTarget [9533.20,103967.28,30.40]
_camera camSetPos [9533.20,3998.27,2.00]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera

Now at the top, above all that paste this:

_camera="camera" camCreate [0,0,0]
_camera cameraEffect ["internal","back"] 

See the three zeros? [0,0,0]

we will replace them with the number that is in the first text we pasted form OFP "_camera camSetTarget [9533.20,103967.28,30.57]"

so it should look like this:

_camera="camera" camCreate [9533.20,103967.28,30.57]
_camera cameraEffect ["internal","back"]

Now in the second text we pasted from ofp find the line that says:

_camera camCommit 0

And replace the zero with a different number e.g. 10, this will indicate how long it takes the camera to travel from the first place to the second, in this case 10 seconds.

Now between the two texts write: ~5

this will make a delay of 5 seconds before the script moves on and the camera starts moving.

So you whole notepad window should look like this:

_camera="camera" camCreate [9533.20,103967.28,30.57]
_camera cameraEffect ["internal","back"]

;=== 20:51:45
_camera camSetTarget [9533.20,103967.28,30.57]
_camera camSetPos [9533.20,3967.28,2.00]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera

~5

;=== 20:52:52
_camera camSetTarget [9533.20,103967.28,30.40]
_camera camSetPos [9533.20,3998.27,2.00]
_camera camSetFOV 0.700
_camera camCommit 10
@camCommitted _camera

Now save the file as "INTRO.sqs" to your mission folder make sure save as "all files" are selected when you save. Now in editor remove the "this exec "caamera.sqs"" from the unit INIT filed, you can delete the unit if you dont need it and in a trigger, waypoint "on activation" or units INIT files write this:

this exec "Intro.sqs"

Now hit preview and watch your intro :)

NOTE: you can write your own text were it says ";=== 20:52:52"

e.g.

;=== camera looks at house

but it wont show in game, you can also use different commands like:

setacctime 1.0
setviewdistance 2000

Play music trough the script, add titles and pictures and so on...

Edited by -Martin-

Share this post


Link to post
Share on other sites

-Martin-

I know everything, I just wanned to know, how to get that coordinates, not another scripts..

Anyway, thanks :D

Edited by LeafMaster510

Share this post


Link to post
Share on other sites

Haha, thanks for the camera script. I'm going to try this!

Share this post


Link to post
Share on other sites

Its like tutorial :D It works !! :D

But you must remove @commited camera or something like this, because then you must wait longer, eg

_camera camCommit 4

~2

...

And if there under _camera camCommit 4 is @commited camera you must wait 4 seconds + 2 = thats 6 seconds, but if you want to change your camera after 2 seconds, remove that (@commited camera)

Share this post


Link to post
Share on other sites
Its like tutorial It works !!

But you must remove @commited camera or something like this, because then you must wait longer, eg

_camera camCommit 4

~2

...

And if there under _camera camCommit 4 is @commited camera you must wait 4 seconds + 2 = thats 6 seconds, but if you want to change your camera after 2 seconds, remove that (@commited camera)

Yeah it's like a little tutorial :) Actually I might have to write a PDF from this :D

Anyway you dont have to put the "~2" in between the two texts, thats only if you want a delay of 2 seconds between them, also for the "_camera camCommit 4"

you dont have to remove it just leave it at 0 as it is by default when you paste it from OFP :) So it looks like this:

_camera camCommit 4

Share this post


Link to post
Share on other sites

D@mn i know DDD

I can make tutorial.. Be online on icq gg or skype, then we talk about this okay?

Share this post


Link to post
Share on other sites

I have one slight problem with the camera stuff.

I got everything running, once the clip is finished it returns to gameplay... but i want all the actors and vehicles to be removed when gameplay actually begins. Any suggestions?

A basic script to delete units and vehicles with a given name should be all that is needed I am assuming, but I don't even know how to do that.

Thanks guys.

Share this post


Link to post
Share on other sites

@VirusLIVED

Look for deleteVehicle in command reference. If units are players use setPos to move them somewhere else.

Someone know easier way to get that coordinates?

Use manual camera (camCommand in command reference) and hint, chat or titletext to display coordinates (getPos).

If you're using fwatch you could bind to key displaying current coordinates and saving it to file.

Share this post


Link to post
Share on other sites

Thanks for the reply Faguss. I ran into "deleteVehicle" but was not sure if that was the one... and "setPos" sounds like a good little trick. Thanks for all your help, I will get right to using these methods now!

Also, is there a way to kill selected units before I move their bodies to a "setPos"? Just wondering. Thanks.

Share this post


Link to post
Share on other sites

put a trigger over all units to be killed.

Trigger activation anybody once

name the trigger dead_ducks

in activation of same trigger put: {_x setDammage 1}forEach list dead_ducks

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  

×