Home   Help Search Login Register  

Author Topic: Slow motion, pause and than rotate round missile  (Read 1566 times)

0 Members and 1 Guest are viewing this topic.

Gooner861

  • Guest
Slow motion, pause and than rotate round missile
« on: 24 Aug 2004, 15:54:25 »
I've just been looking round the editors depot and seen a slow mo script and a pause script. I was just wondering if it wud be possible to mix the two up if u get me.

I aint a very good scripter but heres what wud look really nice in an intro.

Say if theres a convoy of trucks and an enemy AT guy. What i wud like to do is get a shot of the AT guy firing his AT missile, slow it rite down to slow motion and than just before it hits the truck. Pause the cutscene and than circle around the truck or missile.

Than un pause it and have it play at normal speed and see the truck blow up. Now that wud look really, really cool  ;D. I know how to do evrything wit camera.sqs etc its just i dnt know how to implement the two scripts into it.

Thanks

Gooner

bored_onion

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #1 on: 24 Aug 2004, 16:50:36 »
go to the scripts in the ed. depot and find one called bullet camera or bullet time (something like that)

if you wanna pause the game a good way to do this is to setacctime 0.00000001 and then to change it back to 1 later on (bit messy but it works)

if thats not what your looking for i can try modifying a script that i made to film a missile for you but it wont be in the league of the guys that submit to the ed. depot

Offline Blanco

  • Former Staff
  • ****
Re:Slow motion, pause and than rotate round missile
« Reply #2 on: 24 Aug 2004, 16:51:38 »
AFAIK, not possible.  :-\


Pausing the game is easy with setacctime 0, but after that you can't rotate or move the camera anymore because the time has stopped. (also for the camera)

The only way to do it, (and it's not very good) is to setpos the AT missile in the air with a very fast loop...

Search or search or search before you ask.

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #3 on: 24 Aug 2004, 18:34:03 »
Cheers dudes, i think what i'll do is forget about rotating the camera around the missile and just pause time on the missile.

But how wud i target the missile? What command wud i put?

Cheers

Gooner

bored_onion

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #4 on: 25 Aug 2004, 12:23:45 »
ok,

im gonna give you a basic script i made to capture an RPG

basically stick these scripts into your mission and call them using
Code: [Select]
[name of RPG soldier,target] exec "fire.sqs" then whenever the soldier fires the bullet cam will engage and you can enjoy the show

any problems post again or PM me

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #5 on: 25 Aug 2004, 14:49:36 »
Thanks alot bored_onion, u didnt have to make that for me but i much appreciate it. I'll give it a whirl now than.

Cheers  ;D

Gooner

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #6 on: 25 Aug 2004, 15:07:05 »
Very good, kinda wot i wanted. I've been playing around with some of the setAcctime numbers to make it more to what i want but yeh thanks alot it'll add alot more to my cutscene.

Just one thing how wud i make it so that when its first fired it fires at setAcctime 0.01 but when it gets close to the truck it slows rite down to about 0.005?

Thanks alot

Gooner

bored_onion

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #7 on: 25 Aug 2004, 15:25:36 »
make _rocket a public variable wherever it appears in my script (missilecam.sqs) by removing the underscore infront of it

then you could try putting in the condition field of a trigger:
Code: [Select]
(rocket distance truck) <= 10
and then putting
Code: [Select]
setacctime 0.005
into the on activation field

that might work but no guarantees
if it doesnt then i could try fiddling with it a bit for you

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #8 on: 25 Aug 2004, 15:45:46 »
Doesnt matter i dnt need to do that anymore neway. Thanks for the script though, i'll be sure to add ur name in the credits  ;D .

Cheers

Gooner

Offline Blanco

  • Former Staff
  • ****
Re:Slow motion, pause and than rotate round missile
« Reply #9 on: 25 Aug 2004, 22:31:36 »
Hey gooner,
 I have a camscript where a Tomcat fires a missile at an AA gun, the camera follows the missile from behind (you can use logiccam) , and when he's about 60m from the AA gun the camera switches to a sidecam of the missile and everything goes in slowmotion until the missile hits the AA gun. So the explosion occurs at normal speed.

I can give you that script by tommorow, when I find it on my HD...  ;)
« Last Edit: 25 Aug 2004, 22:33:14 by Blanco »
Search or search or search before you ask.

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #10 on: 25 Aug 2004, 22:42:23 »
That sounds cool, yeh may as well have a look at it if u have it.

Cheers m8

Gooner

Offline Blanco

  • Former Staff
  • ****
Re:Slow motion, pause and than rotate round missile
« Reply #11 on: 26 Aug 2004, 16:20:08 »
I could find the one I was talking about, but I've made a similar one.
No addons needed.
It's a cutscene of an SU-25 against a Vulcan.
Open the camscript.sqs to find some comments.






Search or search or search before you ask.

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #12 on: 26 Aug 2004, 19:17:51 »
Very nice indeed. I had a look at the script and i think it shud be relatively easy to chang things to what i want in my intro. I just want a shot of an RPG firing at a colum of trucks. But that shuldnt be too hard to do.

Cheers yet again,

Gooner  ;D

Offline Blanco

  • Former Staff
  • ****
Re:Slow motion, pause and than rotate round missile
« Reply #13 on: 26 Aug 2004, 19:42:50 »
ok, imo filming missiles fired from planes are easier to follow with a camera because a plane rarely misses his shot.
Make sure your AT soldier has a high skill and a good position. (not too close!)

Also, some projectiles that go faster then 1000 km/h will become invisible even when you slowdown the time.
You can fix that a bit with setvelocity (less hen 400km/h makes it vissible again), but I'm not very good with that command...
That's not a problem with a LAW or RPG, the rocket will always be visible, but make sure you got a "backup-plan" when the AT soldier misses his shot

Last thing, I had problems with filming sabots. sometimes the shells accelaration speed is so fast that the nearestobject command is not able to catch the projectile.

Search or search or search before you ask.

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #14 on: 28 Aug 2004, 11:20:36 »
Kinda gotta it sorted, just needs sum fine tuning. I'll keep the thread open just in case though  ;D .

This shud go well with sum Prodigy music i got too  ;D

Cheers

Gooner


Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #15 on: 31 Aug 2004, 11:53:16 »
Just been playing this great mission Farcile Ground by Sui and that has something what i want, a tank gets hit by a mine the cutscene slows rite down and spins round the front of the tank.

Very cool

Gooner

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Slow motion, pause and than rotate round missile
« Reply #16 on: 31 Aug 2004, 13:34:28 »
Teh code I used to do that:

Code: [Select]
abrams setspeedmode "normal"
_c4 camsetpos [(getpos (object 91142) select 0), (getpos (object 91142) select 1) + 4,0.5]
_c4 camcommit 0
abrams lockwp true
@ getdammage abrams > 0
0 fademusic 0
setacctime 0.03
_i = 0.03
#matrixloop
_c4 camsetpos [(getpos abrams select 0) + (sin ((_i*1000)+ 120) * 10), (getpos abrams select 1) + (cos ((_i*1000)+ 120) * 10), (0.5 + (_i*5))]
_c4 camcommit 0.1
_i = _i + 0.02
setacctime (0.03 + (_i/2))
~0.05
? _i < 0.24: goto "matrixloop"
setacctime 0.25
~0.25
setacctime 0.375
~0.25
setacctime 0.5
~0.25
setacctime 0.625
~0.25
setacctime 0.75
~0.25
setacctime 1
titlecut ["","BLACK OUT",1]

The main part you'll want to look at is this:

_i = 0.03
#matrixloop
_c4 camsetpos [(getpos abrams select 0) + (sin ((_i*1000)+ 120) * 10), (getpos abrams select 1) + (cos ((_i*1000)+ 120) * 10), (0.5 + (_i*5))]
_c4 camcommit 0.1
_i = _i + 0.02
setacctime (0.03 + (_i/2))
~0.05
? _i < 0.24: goto "matrixloop"

That's the bit that rotates the camera around the abrams. It uses a trig function to move the camera 20 degrees (you can change that by changing the underlined bit) every loop.

The numbers may seem strange, but multiply them by 1000 and you'll see you get a range from 30 to 240. That's bearings from the tank... the camera moves in an arc from 30 degrees to 240 degrees, based on the setpos.
It looks nasty, but it's not too bad if you break it down.

I'm happy to explain further if you'd like ;)
« Last Edit: 31 Aug 2004, 13:37:28 by Sui »

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #17 on: 31 Aug 2004, 15:48:50 »
Thanks a heap Sui.  ;D Well it does look rather difficlut at the moment but i'm willing to learn. The thing is though in my intro im concentrating more on an RPG firing at a convoy of trucks.

But i want to slow mo rite down wen it is fired and than follow the missile, like ur lose outro u have made. That was cool.

I've been looking at how u did it:

Quote
player switchcamera "internal"
_cam camsettarget atguy
_cam camcommit 5
~3
_cam camsetfov 0.1
_cam camcommit 3
~2
atguy dofire ftruck
~2
atguy dofire ftruck
_cam camsetpos [(getpos atguy select 0) - 5, (getpos atguy select 1) - 2, 1]
_cam camsettarget atguy
_cam camsetfov 0.7
_cam camcommit 0
atguy dofire ftruck
~1
atguy dofire ftruck
(leader group atguy) say "rus10"
(leader group atguy) setcombatmode "yellow"
setacctime 0.25
_now = (time + 7)
#OLatguyloop
~0.01
atguy dofire ftruck
? (atguy ammo "AT4Launcher" == 1) and (alive atguy) and (time < _now): goto "OLatguyloop"
_at4 = (nearestobject [atguy,"AT4"])
setacctime 0.05
~0.2
_cam camsetpos [(getpos _at4 select 0) + sin (getdir _at4 + 5) * 20, (getpos _at4 select 1) + cos (getdir _at4 + 5) * 20, 1]
_cam camsettarget _at4
_cam camcommit 0
setacctime 0.05
_now = (time + 2)
@ (_at4 distance ftruck < 50) or (time > _now)
setacctime 1
_cam camsetpos [(getpos ftruck select 0) + sin (getdir ftruck - 80) * 50, (getpos ftruck select 1) + cos (getdir ftruck - 80) * 50, 8]
_cam camsetfov 0.7
_cam camsettarget ftruck
_cam camcommit 0
~0.1
setacctime 0.05
#OLatloop
setacctime (acctime * 1.25)
~ (1/(acctime*22.5))
? (acctime < 1): goto "OLatloop"
setacctime 1
~3
_cam camsetpos [getpos (object 85439) select 0, getpos (object 85439) select 1, 20]
_cam camsettarget ftruck
_cam camcommit 0
_cam camsetpos [getpos (object 40149) select 0, getpos (object 40149) select 1, 20]
_cam camcommit 30
~2

Now on this thread sum guys have helped me get a type of bullet cam on the RPG which was very good as well. But i also wanna know how u kind of followed the RPG missile as it flew past the camera.

Plus, sorry keep on at you, just thinking now wud it be possible to use your rotation thing for a truck. Cos i wud like to have the RPG pause about 5 metres away from the truck, rotate round the truck and than play in normal time for a great explosion etc.

Cheers

Gooner

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Slow motion, pause and than rotate round missile
« Reply #18 on: 01 Sep 2004, 11:11:13 »
This is the bit of code I used to grab the rocket as it was going past:

Code: [Select]
_at4 = (nearestobject [atguy,"AT4"])
You have to use that as soon as the rocket is fired, as nearest object only works to 50m and the rocket is moving very fast.

Once you have given it a name (here it's called '_at4'), you can camtarget it just like anything else ;)

Feel free to use any code you'd like... just throw my name in the credits/readme somewhere ;D

Just bear in mind that you may have to do a lot of trial and error with the timings to get the movement right... I know I did...

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #19 on: 01 Sep 2004, 11:53:08 »
Cheers for that, will get onto it. Just one more thing : I was looking at this bit of the script,

Quote
_cam camsetpos [(getpos _at4 select 0) + sin (getdir _at4 + 5) * 20, (getpos _at4 select 1) + cos (getdir _at4 + 5) * 20, 1]
_cam camsettarget _at4
_cam camcommit 0
setacctime 0.05
_now = (time + 2)
@ (_at4 distance ftruck < 50) or (time > _now)
setacctime 1

And was interested in this bit:
Quote
@ (_at4 distance ftruck < 50) or (time > _now)
setacctime 1

Does that just look to see that when the missile is about 50m away frm the target ftruck it will move setacctime to 1. So cud that code be used to set up the spin around the abrams:


So the script cud look like this:

player switchcamera "internal"
_cam camsettarget atguy
_cam camcommit 5
~3
_cam camsetfov 0.1
_cam camcommit 3
~2
atguy dofire tank
~2
atguy dofire tank
_cam camsetpos [(getpos atguy select 0) - 5, (getpos atguy select 1) - 2, 1]
_cam camsettarget atguy
_cam camsetfov 0.7
_cam camcommit 0
atguy dofire tank
~1
atguy dofire tank
(leader group atguy) say "rus10"
(leader group atguy) setcombatmode "yellow"
setacctime 0.25
_now = (time + 7)
#OLatguyloop
~0.01
atguy dofire tank
? (atguy ammo "AT4Launcher" == 1) and (alive atguy) and (time < _now): goto "OLatguyloop"
_at4 = (nearestobject [atguy,"AT4"])
setacctime 0.05
~0.2
_cam camsetpos [(getpos _at4 select 0) + sin (getdir _at4 + 5) * 20, (getpos _at4 select 1) + cos (getdir _at4 + 5) * 20, 1]
_cam camsettarget _at4
_cam camcommit 0
setacctime 0.05
_now = (time + 2)
@ (_at4 distance tank < 50) or (time > _now)

Then add the spin around the tank

i = 0.03
#matrixloop
_c4 camsetpos [(getpos tank select 0) + (sin ((_i*1000)+ 120) * 10), (getpos tank select 1) + (cos ((_i*1000)+ 120) * 10), (0.5 + (_i*5))]
_c4 camcommit 0.1
_i = _i + 0.02
setacctime (0.03 + (_i/2))
~0.05
? _i < 0.24: goto "matrixloop"


Now obviously bits wud have to be changed but cud that be done?

Cheers

Gooner

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Slow motion, pause and than rotate round missile
« Reply #20 on: 01 Sep 2004, 12:36:31 »
Yeap... you've got the idea :)

If you remeber that loose outro, the camera cuts to a side view of the truck just before the rocket hits. That's how I did it.

You could do exactly the same thing with your tank scenario. I'd up the distance slightly though... remember that rocket is travelling really fast ;D

Do some experimentation and see what looks good and what doesn't... I'm happy to answer any more questions you might have.

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #21 on: 01 Sep 2004, 16:31:28 »
Quote
You could do exactly the same thing with your tank scenario

I dnt wanna copy your work, im only interested in the techniques used, been very helpful though. Your mission gave me alot of ideas  ;D .

Anyway this is another query that i've been trying to figure out.

Ok so you have all the cutscenes in scene.sqs, i opened up the mission in the editor but couldn't find any triggers that activated the cutscenes .

Like for example at the minefield part where the tank gets hit, i went to that exact place but cudnt find anything that cud of activated the cutscene. Im i just being blind or was there another technique.

Thanks for your help, been very interesting  ;D

Gooner

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Slow motion, pause and than rotate round missile
« Reply #22 on: 02 Sep 2004, 10:59:49 »
I use another wierd scripting technique in that mission to try to cut down on cpu time...

Instead of using a whole bunch of triggers to activate things, I have a single looping script (trigs.sqs I think I called in in that mission), which acts as the triggers instead.

From memory, the tank cutscene is activated by checking when the convoy is approaching Larche... when it gets close enough the 'trigger' calls the scene.sqs, and plays the cutscene...

Gooner861

  • Guest
Re:Slow motion, pause and than rotate round missile
« Reply #23 on: 02 Sep 2004, 18:59:00 »
Ahhhh i see ok thanks for the feedback  :) .
I'll leave this thread open incase i encounter any problems with my camera script, but i won't be doing that for a while now. Im concentrating now on my mission, its shaping up pretty nice at the moment. (But not as good as yours, sadly  :'( )

Anyway thanks,

Gooner