Forum Jump :

Author Message

Duke  



Posts: 401
Rank:


Level: Member

Country: ca
Location: Under your bed.
Occupation: Avid Gamer, Loving Father.
Age: 49
In-game name:

 
#1 Posted at 2007-01-23 14:20        
     
Does anyone know where I can find in-depth tuts on AmrA camera scripting? I've been all over the Wiki, here and virtually everywhere but there are huge gaps in the information provided in every camera control readme I've seen so far.

The other thing that would be really helpful is real examples of how each camera script behaves or an example of simple - robust camera.sqs files for dl/demo.

I really hope this isn't a silly question but I assure you, I've spent way more than 5 minutes combing the web to get as much info as possible and still come up short with effects such as rotation and affixing cameras to moving vehicles.


Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#2 Posted at 2007-01-23 15:34        
     
Hi Duke

Have you tried the incorporated camera.sqs?
By putting the following code in your unit
[] exec "camera.sqs"
as soon as the mission starts you will become a camera which you can use to make an intro......all you have to do is look around/zoom etc etc until you think you had enough. Than exit the camera, press "controle C" (to copy), alt tab out of game and paste it in a txt file and save it as .sqs

Here you have a nice camera.sqs tutorails (or at least I think its a very good one), made by Lolsav:
camera tut

I suggest you try to make a simple intro with that, after saving the data to the txt file......open it and read what it contains.
That will clear a lot of stuff up for you.

If you than have more questions feel free to ask :thumb

Visit my family webshop desteigerhoutshop.nl.

Advertisement


Author Message

Duke  



Posts: 401
Rank:


Level: Member

Country: ca
Location: Under your bed.
Occupation: Avid Gamer, Loving Father.
Age: 49
In-game name:

 
#3 Posted at 2007-01-24 14:14        
     
Thanks for the reply Foxhound, much appreciated.

I found that freecam ingame really limited what I could do so I wanted to record scripted elements partially for FMV/INTRO to MP Missions as well as for creating my own ArmA movies.

I've been messing around with scripts a bit over the past few weeks but some of the things I've had trouble locating are how to add effects such as:

- camera shake
- fixing a camera to a vehicle
- camera view of ordinance (missle cam) assuming it's possible

I guess a good example would be following a chopper as it destroys armor. Using a camera.sqs file really doesn't help me as the coordinates are setup as right/left - front/back - height along with camera time to reach the given position. This does me no good because a helicopter is not a static target so it's rarely at the same height/speed/dive rate on two consecutive script executions.

This is the reason I'd love to fix a camera to the heli if possible.

Thanks.


Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#4 Posted at 2007-01-24 16:33        
     
Thats surely possible. But that will require you to make your own camera script.
That is why I wanted you to take a look at the camera.sqs and what file is makes.......not what it can do (I dont like it neither for making intro's).
In the saved file you see exactly how it can make a camera, how it moves etc etc.

Take a look at the following
; for the intro camera scripting tutorial

; create camera
_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"] 

; point the camera at the player, and place it 2m to the players left,
; 10m to his front and 3m above the ground
_cam camsettarget player
_cam camsetrelpos [-2,10,3]
_cam camcommit 0 

; fade in from black over 2 seconds
titlecut [" ","BLACK IN",2]

; wait for 2 seconds for the fade to complete
~2 

; move the camera to 5m behind the player, 2m to his left and 0.5m above the ground
; do the move over 10 seconds, and then wait for 2 seconds
_cam camsetrelpos [-2,-5,0.5]
_cam camcommit 10
@camcommitted _cam
~2 

; target object2, moving the camera to a relative position that is
; 3m in front, 1m to the left and 2m above the ground. Move over 10 seconds, then wait for 2.
_cam camsettarget object2
_cam camsetrelpos [-1,3,2]
_cam camcommit 10
@camcommitted _cam
~2 

; fade out to black over 2 seconds
titlecut [" ","BLACK OUT",2]

; wait for 2 seconds for the fade to complete
~2 

; end cutscene
_cam cameraeffect ["terminate", "back"]
camdestroy _cam

; fade back in over 2 seconds
titlecut [" ","BLACK IN",2]

exit 

If you want the camera to follow your chopper (name it chopper1) you could make something like this
#follow_chopper
_camera camSetTarget chopper1
_camera camSetRelPos [0,-13,50] <-----I added 50 here as the height the chopper flies at, change to the height you make it fly
_camera camCommit 0
~0.01
?(alive chopper1) : goto "follow_chopper"
I let the camera follow the chopper for as long as its alive, you can use any kind of variable to make the script to stop following the chopper. For example make the camera stop following if the chopper has fired.

The below I have directly copied from the BI forums and was posted by KyleSarnik
Now for the camera to follow the rocket fired:
First in the init of the chopper ad the follwoing
unit addeventhandler ["fired",{_this execVM "cam.sqf"}]

Now
_projectile = nearestobject [_this select 0,_this select 4];
_list = ["R_M136_AT","M_Javelin_AT","M_Stinger_AA","R_PG7V_AT","R_PG7VR_AT","M_Strela_AA","R_Hydra_HE",
"R_57mm_HE","R_80mm_HE","M_Sidewinder_AA","M_TOW_AT","M_AT5_AT","M_Hellfire_AT","M_Vikhr_AT"];
if((_this select 4) in _list)then{
setacctime 0.5;
_camera = "camera" camCreate [0,0,0];
_camera cameraeffect ["internal", "back"];
while{alive _projectile && alive _camera}do{
_camera camSetTarget _projectile;
_camera camSetRelPos [0,-13,1.2];
_camera camCommit 0;
sleep 0.001;
};
if(alive _camera)then{sleep 1};
_camera cameraeffect ["terminate", "back"];
camdestroy _camera;
setacctime 1;
};

Please do note that in _list you should make sure to add the type of ammo the chopper fires at the target and remove the other not needed types.
You can find the ammo types here.

Also note the last script is a sqf script and not a sqs script like the follow chopper or the camera.sqs
Arma is optimised for sqf scripts, but I havent really had time to look into it and I didnt have time (gtg to work) to change the sqf to sqs anymore.
I hope you dont mind :)

Anyway, I hope this clears up some stuff for you.........if not.........just keep asking :)

This post was edited by Foxhound (2007-01-27 22:41, ago)

Visit my family webshop desteigerhoutshop.nl.

Author Message

Duke  



Posts: 401
Rank:


Level: Member

Country: ca
Location: Under your bed.
Occupation: Avid Gamer, Loving Father.
Age: 49
In-game name:

 
#5 Posted at 2007-01-26 16:26        
     
I actually did look at the link you posted my friend but most, if not all the territory covered in the link was included in snYpirs tutorial (which I dl'd weeks ago and tested the various scripts). I feel I was beyond this point when I initially posted my original question and to be perfectly honest, I'd already spend well over 10 hours monkeying around with various scripting techiques prior to posting here.

I've also taken as much from your tutorials posted here and even have them bookmarked for reference now and again.

Of the four code snippets you posted above, I am familiar with the first but the last three are new territory to me. The problem I find with learning scripting for ArmA (from the viewpoint of a user who played OFP but never scripted and has no exposure to VBS) is that there are only tuts on the web for the basics of camera.sqs but nothing in-depth as in your further examples. What makes it even tougher is finding out what camera scripting options a user has available because the WIKI tells a n00bie such as myself virtually nothing.

I really appreciate your help with this topic and fully intend to work with your examples this weekend. I'll be sure to post regardless of outcome so I'm warning you, this isnt' the last you've seen of me in this topic :D

Thanks again,

Ken


Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#6 Posted at 2007-01-26 18:40        
     
Duke : - What makes it even tougher is finding out what camera scripting options a user has available because the WIKI tells a n00bie such as myself virtually nothing.

- I'll be sure to post regardless of outcome so I'm warning you, this isnt' the last you've seen of me in this topic :D

Thanks again,

Ken


About the wiki:
Yes, thats definatly true. The wiki has all commands listed but not a very good explanation of how to implement those. It has nothing to do with being noobie or more advanced, its so very limited with info it mostly starts with just trying to make it work (but this will be more difficult to someone starting scripting than someone already familiar with the basics).

About you posting more question:
Feel free to post here (or any other forum section :)) if you are stuck or need some additional info......even if its already explained and you cant get it to work.....ask again.
Thats the only way to learn; try, ask, try, ask agian, see the results :) <-----considering scripting this should be known to be a very "short but succesfull road, most of the times the road will be longer and going around many times :lol.


About the scripts 2-4
Number 2 just makes the camera reset its position behind (and relative to) the chopper each 0.01 second.
The time delay (~) might even have to be made shorter to make it run smoother, thats just a mater of testing.
As soon as the chopper is killed the scripts continues with anything else (not added to snippet 2) except following the chopper.

Number 3 is the command line you will have to put in the chopper "init line" which you can find when you select and double click the unit in the editor. In the new screen popping up you will see a space called "init" that is where the command goes.

Number 4 is the function (.sqf) to follow the bullet fired by the chopper. Depending on what kind of ammo you want to follow (_list) and the fired round is equal to any type added to that _list the camera will follow it.


Like I mention above do note that number 4 is a function. Functions differ from sqs files. For me being able to explain it the best I can I suggest for now we stick to sqs files
unless as posted above I have a good reason to post the sqf file :thumb
Arma is optimised for sqf files specially if you need a lot of loops (like the check if chopper is alive), scripts you need only once or a few times can be sqs files (like for example an intro).

Visit my family webshop desteigerhoutshop.nl.

Author Message

Duke  



Posts: 401
Rank:


Level: Member

Country: ca
Location: Under your bed.
Occupation: Avid Gamer, Loving Father.
Age: 49
In-game name:

 
#7 Posted at 2007-01-27 09:41        
     
The chopper script works fine but the issue becomes that the camera doesn't update its location in relation to the chopper which I guess I should have realized in the first place, duh.

What I was looking for is a camera that updates it's position relative to the chopper at any given moment. Think of it more as a chopper mounted camera than just a static camera locked to one position.

As of this post, I still have not tested the ballistics but will post once I've tried it out.

Thanks.


Author Message

Duke  



Posts: 401
Rank:


Level: Member

Country: ca
Location: Under your bed.
Occupation: Avid Gamer, Loving Father.
Age: 49
In-game name:

 
#8 Posted at 2007-01-27 19:25        
     
I tried the camera affixed to weaponry and it works like a charm. I'll have to spend more time flushing it out because I'd like to change x,y,z coordinates during the ballistic tracking process. Other than that, pretty cool script.

I'm still trying to figure out how to attach a camera to a vehicle though and possibly add effects such as camera angle or camera shake.

Any thoughts on this Foxhound?


Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#9 Posted at 2007-01-27 23:29        
     
I will help you asap.......atm I am building my new comp......changing my old one and my house is a mess.
Should be able to help you with this tomorrow :)

Visit my family webshop desteigerhoutshop.nl.

Author Message

Duke  



Posts: 401
Rank:


Level: Member

Country: ca
Location: Under your bed.
Occupation: Avid Gamer, Loving Father.
Age: 49
In-game name:

 
#10 Posted at 2007-01-28 02:11        
     
I'm thinking that I should be able to work with the above ballistic code and edit it to follow the chopper instead but I'm not 110% sure whether or not it will work.


Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#11 Posted at 2007-01-28 07:07        
     
Yes, that should work!

:D

Visit my family webshop desteigerhoutshop.nl.

Author Message


Posts: 431
Rank:


Level: Member

Country: pt
Location:
Occupation:
Age: 39
In-game name:

 
#12 Posted at 2007-02-01 04:50        
     
Well, its too bad ofpec is down but you should be able to find info about this in the BIS forum (OPF editing section).
I presume everything still works like OPF/vbs1?
Foxhound:
all you have to do is look around/zoom etc etc until you think you had enough. Than exit the camera, press "controle C" (to copy), alt tab out of game and paste it in a txt file and save it as .sqs

You dont have to do this, you can just lock the camera into something (press space), adjust fov, eight, etc and then press Ctrl, Arma should automatically create a text file in the main directory called clipboard.txt where all your shots are saved (everytime you press Ctrl).

For example you can look at a vehicle from above, save (Ctrl), then zoom in/out and save again, in the clipboard.txt file you will have 2 camera angles that you can then copy into your movie.sqs. just throw a delay betwean them (~9).

showcinemaborder true
enableradio false

cutText ["","white In", 6]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]

_camera camSetTarget [22560.18,24515.04,-0.00]
_camera camSetPos [22578.72,24492.12,7.82]
_camera camSetFOV 0.374
_camera camCommit 0
@camCommitted _camera

~2.5

_camera camSetTarget [22560.18,24515.04,-0.00]
_camera camSetPos [22565.24,24493.50,8.12]
_camera camSetFOV 0.374
_camera camCommit 8
@camCommitted _camera

~15

cutText ["R I P","black out", 5]

~8

_camera cameraeffect ["terminate","back"];
camdestroy _camera

enableradio true
showcinemaborder false

exit

The above is a tiny outro i made for a coop map that fires when all players die (2 basic shots and rotation), replace my shots with ones from your own clipboard.txt and play with it, add to it, i recomend you get used to control the camera and do some simple rotations before you move on with the more dificult stuff.

Now i've never been much of a camera guy and it can be a great pain in the ass after a while but it can also be fun, i hope this helps :).


Author Message

Duke  



Posts: 401
Rank:


Level: Member

Country: ca
Location: Under your bed.
Occupation: Avid Gamer, Loving Father.
Age: 49
In-game name:

 
#13 Posted at 2007-02-01 10:11        
     
Thanks Heatseeker!

I've been combing the BI forums and have found some stuff but not much that gets too far into the subject of camera control. Don't get me wrong, some has helped but for every question I answer, another 10 popup in it's place.

In looking at your example script above, I'm not really sure I understand the enableradio command. I'm also at a loss as to where the rotation happens because there's nothing above (that I can see) that forces the camera to rotate beyond the object it passes. Now please keep in mind that I'm no script guru but with the exception of enableradio and showcinemaborder, I've pretty much used similar scripts for my own camera control.

I think what I may do is record some of what I currently have and add the scripting to the film in one of the corners so you can get an idea of what I'm up to.

I do have some scripts created by snypir <sp> such as a rotate script that I'll be messing with soon. I don't know if it will get me anywhere but it's worth trying.

Lastly, the following is a list of exactly what I'd like to do:

1. Video Tour of Town prior to (OPFOR) Takeover: Nearly Complete.
2. Enemy Takeover of Town: In progress (Requires Elements A, B, C, D,) SEE BELOW.
3. Liberation of Town (BLUEFOR): Not Started Yet. (Requires Elements B and C) SEE BELOW.
4. Video Tour of Town after final conflict: This will be a simple script that moves through shattered reminents of town as well as some specific static shots.

Elements:

A. Tanks scripted to destroy buildings: Help Required
B. Spotfires scripted to create in area where building fell: Help Required
C. Vehicle Mounted Static Camera for choppers, and tanks: Help Required
D. Ordinance Cam (camera to follow shells): complete

This is pretty much the entire idea. I hope to use the mini cutscene in various stages throughout the MP Mission I create as well as add some length and storyline to it for a separate video release. Those of you who help me realize this goal will see your name credited in the movie (with your permission) as well as a link to wherever you wish (within reason).


Author Message


Posts: 431
Rank:


Level: Member

Country: pt
Location:
Occupation:
Age: 39
In-game name:

 
#14 Posted at 2007-02-01 20:21        
     
Well...
The showcinemaborder and enableradio do just that. cinemaborder is on by default but i always used it in vbs because a system module (observer) could disable the 2 black borders. Enable radio prevents radio comands from appearing on screen wich will look bad in your cut. (i.e. All: Danger, 12 o'clock sniper blablah).There is also enableuserinput (?) that prevents the player from interacting with the game while the cut is running.
You should always enable them back in the end of your cut.sqs!
______________________________________________________________

My example was just a very simple example, you have to go and grab your own shots (using camera.sqs and saving) to understand it better and get used to it (thru experimentation).

Example of a flying cam:
Start a map in camera.sqs, press space to lock on something (like the ground) and press ctrl.
Now press A or B to move the camera sideways (around your "target"), do a 180


Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#15 Posted at 2007-02-01 20:34        
     
Duke : Thanks Heatseeker!

I've been combing the BI forums and have found some stuff but not much that gets too far into the subject of camera control. Don't get me wrong, some has helped but for every question I answer, another 10 popup in it's place.

In looking at your example script above, I'm not really sure I understand the enableradio command. I'm also at a loss as to where the rotation happens because there's nothing above (that I can see) that forces the camera to rotate beyond the object it passes. Now please keep in mind that I'm no script guru but with the exception of enableradio and showcinemaborder, I've pretty much used similar scripts for my own camera control.

1. Video Tour of Town prior to (OPFOR) Takeover: Nearly Complete.
2. Enemy Takeover of Town: In progress (Requires Elements A, B, C, D,) SEE BELOW.
3. Liberation of Town (BLUEFOR): Not Started Yet. (Requires Elements B and C) SEE BELOW.
4. Video Tour of Town after final conflict: This will be a simple script that moves through shattered reminents of town as well as some specific static shots.

Elements:

A. Tanks scripted to destroy buildings: Help Required
B. Spotfires scripted to create in area where building fell: Help Required
C. Vehicle Mounted Static Camera for choppers, and tanks: Help Required
D. Ordinance Cam (camera to follow shells): complete

This is pretty much the entire idea. I hope to use the mini cutscene in various stages throughout the MP Mission I create as well as add some length and storyline to it for a separate video release. Those of you who help me realize this goal will see your name credited in the movie (with your permission) as well as a link to wherever you wish (within reason).


Showcinemaborder:
Force drawing of cinema borders. This is normally used in cutscenes to indicate player has no control

Enableradio:
Enable and disable radio messages to be heard and shown in the left lower corner of the screen. That can be helpful during cutscenes.

All scripting commands with a short (and often unclear but still very helpfull) discription can be found in the Arma wiki :)


As for using cutscenes during MP
Not many people do actually really like cutscenes during play. You have to make 200% sure the players can not be killed and will continue the mission where they were when the cutscene started.
Also keep the new JIP (join in progress) in mind. New clients must be told wether yes or no to show the cutscene and all other stuff related to it.


As for A, B and C
Very well possible without to much troubles.
Just ask when you are ready to work on it :)


[EDIT]
Although Heatseeker needed some sleep he was still faster than me :wink

Visit my family webshop desteigerhoutshop.nl.