Home   Help Search Login Register  

Author Topic: How to implement an unsteady camera in a cutscene?  (Read 2441 times)

0 Members and 1 Guest are viewing this topic.

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
How to implement an unsteady camera in a cutscene?
« on: 23 Oct 2008, 17:58:05 »
Hi OFPEC people!

In a cutscene I made, there comes a "first person" sniper scope view.
Wolfrug saw this cutscene and gave me the idea to implement a script at this part that "simulates" some breathing or unsteady aim (for example like it's ingame when you go to the scope view). Otherwise the camera would be too steady and uneventful and when it moves from target to target, it would be just too precise.

So I looked for a script that could make such randomized camera movements but I could not find anyone.
I just found Surdus Priest's cool "Screen Shaking Script" and took a look on it and managed to slow down the "shock effect".
The problem is that in this script (as far as I could understand it) the camera does only jump directly from one point to the other, instead of be moving. Also it only does move up and down.

Can someone here show me another script for an unsteady camera or adjust Surdus' script in terms of a randomly moving camera to all sides?

Thank you, guys!
« Last Edit: 23 Oct 2008, 18:01:41 by Undeceived »
Current project: Black Lands (Arma 3)

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: How to implement an unsteady camera in a cutscene?
« Reply #1 on: 23 Oct 2008, 19:13:41 »
I digged around my olde OFP folders, and found this script by or very own bedges. I believe it should work out of the box, since the camcommands are the same OFP -- ArmA. Try it out. :)

*attached*

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
Re: How to implement an unsteady camera in a cutscene?
« Reply #2 on: 23 Oct 2008, 20:29:51 »
Hi Wolfrug. Thank you very much! It seems to work, yes but since the mission is from OFP, I firstly became some errors because of missing addons. Then I made some adjustments in the mission.sqm (replaced OFP units with ArmA units such as M60, etc.) and then the misison loaded.

But the problem is that the whole "event" :) takes place offshore, some kilometers away from Rahmadi, I only can see the borders of these huge triggers, the rest is not visible on the map. But at least the thing worked, I hit preview and oohh... A beautiful unsteady cam! :) Even though all units are swimming...

But so far so good! I tried to change some parameters and that worked too.
But it's quiet hard to work with the script in a whole because it all is not visible on the map (triggers, game logic, etc...).

Thx, buddy!! Good to know that there are still some good ol' cases where one can dig in and find such great things! ;)


Edit:

Ok, I'm trying to put this in my cutscene now.
the game logic "gl_cam" is just the place, where the camera starts, right?
"Target" is clear for me, but so far I have a problem with it: The cam does only target the ground at the target. The first target is the sniper on the platform, do you remember? But the camera doesn't target him, but the ground below. Same for other targets.
So I tried to insert a coordinate (with height) in the exec command instead of the name of the target.

Code: [Select]
[gl_cam, [97462.38,-8472.14,-36442.95], 0.1, 0.05] exec "scripts\BEDG_shakycam.sqs"
instead of

Code: [Select]
[gl_cam, sniperbase, 0.1, 0.05] exec "scripts\BEDG_shakycam.sqs"
but this returns a error to me. Is there another way to make the shaky camera target the target, when this is situated some meters above the ground?



Edit 2:

Just a small addittion to the thing with the targeting the ground:
I increased _setup in Bedges' script from 0.12 + (random 0.2) to 0.5 + (random 0.2) so the movement of the shaking is slower now and what the heck, the camera firstly really does target the target properly, but right after targeting it, it moves down to the floor.
« Last Edit: 23 Oct 2008, 21:44:37 by Undeceived »
Current project: Black Lands (Arma 3)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to implement an unsteady camera in a cutscene?
« Reply #3 on: 23 Oct 2008, 21:58:47 »
The script is looking for an object, so passing positional coordinates instead of an object name will throw that error.

To raise the height, where it says

Code: [Select]
;get new camera target position with shake included
_x = (getpos _lookat select 0) + (_shudder * sin (_dir))
_y = (getpos _lookat select 1) + (_shudder * cos (_dir))
_z = (getpos _lookat select 2) + _hgt

amend the _z coordinate like this

Code: [Select]
_z = (getpos _lookat select 2) + _hgt + n
where n is however high you want it to look.

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
Re: How to implement an unsteady camera in a cutscene?
« Reply #4 on: 24 Oct 2008, 00:50:44 »
This really is ingenious, Bedges! :D And thanks for teaching me such things!!


Ok, this one worked. The only (minor) problem left is that the different targets are not on the same height. The first, for example, stands on a platform, the others normally on the ground.
I solved it this way that I use the script with "target sniper on platform @ 8 m height", then in the moment of targeting the next target, I close the script and launch the same script but renamed and with "1.5 m height". Is is very abrasive or gross or is there a more professional way to do it? :)

Thx anyway!! Great script!
Current project: Black Lands (Arma 3)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to implement an unsteady camera in a cutscene?
« Reply #5 on: 24 Oct 2008, 08:46:01 »
You're on the right track, as the script is designed to be called over and over. Just pass another variable to the script on calling it, like this

Code: [Select]
[gl_cam, sniperbase, 8.0, 0.1, 0.05] exec "scripts\BEDG_shakycam.sqs"
then amend the script like this

Code: [Select]
;initialise variables
BEDG_shakycam = false

_moveto = _this select 0
_lookat = _this select 1
_heightmod = _this select 2
_setup = _this select 3
_shake = _this select 4

and this

Code: [Select]
;get new camera target position with shake included
_x = (getpos _lookat select 0) + (_shudder * sin (_dir))
_y = (getpos _lookat select 1) + (_shudder * cos (_dir))
_z = (getpos _lookat select 2) + _hgt + _heightmod

So the next time you call it, the variables would be

Code: [Select]
[gl_cam, groundloon, 1.5, 0.1, 0.05] exec "scripts\BEDG_shakycam.sqs"
Glad this old stuff is finding new life in ArmA.  :good:

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
Re: How to implement an unsteady camera in a cutscene?
« Reply #6 on: 24 Oct 2008, 12:41:39 »
:clap:

Simple, but effectiv... And I would have never become this idea! :) I need to think a bit more logical...

So... Thanks, Bedges!!! This cutscene is now finished!
Current project: Black Lands (Arma 3)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to implement an unsteady camera in a cutscene?
« Reply #7 on: 24 Oct 2008, 13:16:47 »
Gern geschehen!  ;)