![]() |
#1 | |
Procrastination Incarnate
Development Director
|
![]() A Jass system designed for cinematic composing and playback.
It grants the mapmaker more control and precision in manipulating units, special effects and cameras than is possible with regular GUI triggers. The system was first used in the Blizzard's cinematic contest winner, The Spirit of Vengeance made by me and iNfraNe.
Last edited by Anitarf : 06-24-2010 at 07:50 PM. |
|
![]() |
![]() |
Sponsored Links - Login to hide this ad! |
|
![]() |
#2 |
User
|
![]() This might come in handy, but i might need to learn some JAss first.
__________________Any BTW, I LOVED your movie, its soo awesome. Great job! |
![]() |
![]() |
![]() |
#3 |
Free Software Terrorist
Technical Director
|
![]() GC is a horribly generic name and needs to be more specific to the system but the problem is that you call it everytime
__________________![]() function CameraMainLoop takes nothing returns nothing local real array a local real array v local real array s local real array time local integer i = 0 loop exitwhen i == 9 set i = i + 1 set time[i] = GetStoredReal( GC(), "camera", "time" + I2S(i) ) + CameraPeriod() if time[i] > GetStoredReal( GC(), "camera", "endtime" + I2S(i) ) then if GetStoredReal( GC(), "camera", "acc2" + I2S(i) ) != 0 then call StoreReal( GC(), "camera", "acc" + I2S(i), GetStoredReal( GC(), "camera", "acc2" + I2S(i) ) ) call StoreReal( GC(), "camera", "startvel" + I2S(i), GetStoredReal( GC(), "camera", "vel" + I2S(i) ) ) call StoreReal( GC(), "camera", "startdis" + I2S(i), GetStoredReal( GC(), "camera", "dis" + I2S(i) ) ) call StoreReal( GC(), "camera", "time" + I2S(i), 0.00 ) call StoreReal( GC(), "camera", "acc2" + I2S(i), 0.00 ) set time[i] = 0.00 else endif endif set a[i] = GetStoredReal( GC(), "camera", "acc" + I2S(i) ) set v[i] = GetStoredReal( GC(), "camera", "startvel" + I2S(i) ) set s[i] = GetStoredReal( GC(), "camera", "startdis" + I2S(i) ) call StoreReal( GC(), "camera", "time" + I2S(i), (time[i]) ) set s[i] = s[i] + ( v[i] * time[i] ) + ( a[i] * time[i] * time[i] / 2 ) set v[i] = v[i] + ( a[i] * time[i] ) if i > 3 and i < 7 then if s[i] > 360 then set s[i] = s[i] - 360 elseif s[i] < 0 then set s[i] = s[i] + 360 endif endif call StoreReal( GC(), "camera", "vel" + I2S(i), v[i] ) call StoreReal( GC(), "camera", "dis" + I2S(i), s[i] ) endloop call PanCameraToTimed( s[1], s[2], 0.00 ) call SetCameraField( CAMERA_FIELD_ZOFFSET, s[3], 0.00 ) call SetCameraField( CAMERA_FIELD_ROTATION, s[4], 0.00 ) call SetCameraField( CAMERA_FIELD_ANGLE_OF_ATTACK, s[5], 0.00 ) call SetCameraField( CAMERA_FIELD_ROLL, s[6], 0.00 ) call SetCameraField( CAMERA_FIELD_FIELD_OF_VIEW, s[7], 0.00 ) call SetCameraField( CAMERA_FIELD_FARZ, s[8], 0.00 ) call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, s[9], 0.00 ) endfunction ![]() function CameraMainLoop takes nothing returns nothing local real array a local real array v local real array s local real array time local integer i = 0 local gamecache g=g loop exitwhen i == 9 set i = i + 1 set time[i] = GetStoredReal( g, "camera", "time" + I2S(i) ) + CameraPeriod() if time[i] > GetStoredReal( g, "camera", "endtime" + I2S(i) ) then if GetStoredReal( g, "camera", "acc2" + I2S(i) ) != 0 then call StoreReal( g, "camera", "acc" + I2S(i), GetStoredReal( g, "camera", "acc2" + I2S(i) ) ) call StoreReal( g, "camera", "startvel" + I2S(i), GetStoredReal( g, "camera", "vel" + I2S(i) ) ) call StoreReal( g, "camera", "startdis" + I2S(i), GetStoredReal( g, "camera", "dis" + I2S(i) ) ) call StoreReal( g, "camera", "time" + I2S(i), 0.00 ) call StoreReal( g, "camera", "acc2" + I2S(i), 0.00 ) set time[i] = 0.00 else endif endif set a[i] = GetStoredReal( g, "camera", "acc" + I2S(i) ) set v[i] = GetStoredReal( g, "camera", "startvel" + I2S(i) ) set s[i] = GetStoredReal( g, "camera", "startdis" + I2S(i) ) call StoreReal( g, "camera", "time" + I2S(i), (time[i]) ) set s[i] = s[i] + ( v[i] * time[i] ) + ( a[i] * time[i] * time[i] / 2 ) set v[i] = v[i] + ( a[i] * time[i] ) if i > 3 and i < 7 then if s[i] > 360 then set s[i] = s[i] - 360 elseif s[i] < 0 then set s[i] = s[i] + 360 endif endif call StoreReal( g, "camera", "vel" + I2S(i), v[i] ) call StoreReal( g, "camera", "dis" + I2S(i), s[i] ) endloop call PanCameraToTimed( s[1], s[2], 0.00 ) call SetCameraField( CAMERA_FIELD_ZOFFSET, s[3], 0.00 ) call SetCameraField( CAMERA_FIELD_ROTATION, s[4], 0.00 ) call SetCameraField( CAMERA_FIELD_ANGLE_OF_ATTACK, s[5], 0.00 ) call SetCameraField( CAMERA_FIELD_ROLL, s[6], 0.00 ) call SetCameraField( CAMERA_FIELD_FIELD_OF_VIEW, s[7], 0.00 ) call SetCameraField( CAMERA_FIELD_FARZ, s[8], 0.00 ) call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, s[9], 0.00 ) set g=null endfunction Why? Because the GC function has a comparission and a return and many other things that charge the performance - As bad as using BJ functions. In functions like this one it is getting called way too much times and using a local will make the charge lighter, Any logical explanation for doing this: ![]() call StoreReal( GC(), "camera", "startdis" + I2S(1), CameraSetupGetDestPositionX( whichSetup ) ) call StoreReal( GC(), "camera", "startdis" + I2S(2), CameraSetupGetDestPositionY( whichSetup ) ) call StoreReal( GC(), "camera", "startdis" + I2S(3), CameraSetupGetField( whichSetup, CAMERA_FIELD_ZOFFSET ) ) call StoreReal( GC(), "camera", "startdis" + I2S(4), CameraSetupGetField( whichSetup, CAMERA_FIELD_ROTATION ) ) call StoreReal( GC(), "camera", "startdis" + I2S(5), CameraSetupGetField( whichSetup, CAMERA_FIELD_ANGLE_OF_ATTACK ) ) call StoreReal( GC(), "camera", "startdis" + I2S(6), CameraSetupGetField( whichSetup, CAMERA_FIELD_ROLL ) ) call StoreReal( GC(), "camera", "startdis" + I2S(7), CameraSetupGetField( whichSetup, CAMERA_FIELD_FIELD_OF_VIEW ) ) call StoreReal( GC(), "camera", "startdis" + I2S(8), CameraSetupGetField( whichSetup, CAMERA_FIELD_FARZ ) ) call StoreReal( GC(), "camera", "startdis" + I2S(9), CameraSetupGetField( whichSetup, CAMERA_FIELD_TARGET_DISTANCE ) ) instead of this? ![]() call StoreReal( GC(), "camera", "startdis1", CameraSetupGetDestPositionX( whichSetup ) ) call StoreReal( GC(), "camera", "startdis2", CameraSetupGetDestPositionY( whichSetup ) ) call StoreReal( GC(), "camera", "startdis3", CameraSetupGetField( whichSetup, CAMERA_FIELD_ZOFFSET ) ) call StoreReal( GC(), "camera", "startdis4", CameraSetupGetField( whichSetup, CAMERA_FIELD_ROTATION ) ) call StoreReal( GC(), "camera", "startdis5", CameraSetupGetField( whichSetup, CAMERA_FIELD_ANGLE_OF_ATTACK ) ) call StoreReal( GC(), "camera", "startdis6", CameraSetupGetField( whichSetup, CAMERA_FIELD_ROLL ) ) call StoreReal( GC(), "camera", "startdis7", CameraSetupGetField( whichSetup, CAMERA_FIELD_FIELD_OF_VIEW ) ) call StoreReal( GC(), "camera", "startdis8", CameraSetupGetField( whichSetup, CAMERA_FIELD_FARZ ) ) call StoreReal( GC(), "camera", "startdis9", CameraSetupGetField( whichSetup, CAMERA_FIELD_TARGET_DISTANCE ) ) Edit: you also have an ==true in the B2I function which is btw useless |
![]() |
![]() |
![]() |
#4 |
PhD
Cinematics Moderator
|
![]() Well the good thing about this is, you dont REALLY have to know jass, just some common sense, since all the functions are prebuild and you just need to write some lines (almost all functions are showed in the example cinematic it holds, to make it even easier)
__________________ |
![]() |
![]() |
![]() |
#5 | ||||
Procrastination Incarnate
Development Director
|
![]() Quote:
Quote:
Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
#6 | |
Free Software Terrorist
Technical Director
|
![]() Why have a B2I at all ?
__________________And Quote:
|
|
![]() |
![]() |
![]() |
#7 |
Procrastination Incarnate
Development Director
|
![]() Yeah, well... I had a deadline when I was making this! (excuses, excuses :) )
__________________Anyway, I fixed that now, at least in the most critical functions. It was kinda lame not to use the handle vars because of performance reasons, but then do things like this. |
![]() |
![]() |
![]() |
#8 |
Missing You All at Wc3c
Site Owner
|
![]() You know I love this. Awesome beyond a doubt.
__________________ |
![]() |
![]() |
![]() |
#9 |
User
Join Date: Jan 2005
Posts: 497
![]() |
![]() Is it alright if I kiss the very ground you walk on?
__________________ |
![]() |
![]() |
![]() |
#10 |
User
|
![]() Rename it,
__________________Cinematic Jass for Dummies. |
![]() |
![]() |
![]() |
#11 |
Free Software Terrorist
Technical Director
|
![]() why would it have such a lame name?
__________________ |
![]() |
![]() |
![]() |
#12 |
Girl+Guns= DanL.
|
![]() Good cinematic, and also good concept .
![]() |
![]() |
![]() |
![]() |
#13 |
I love you all.
Join Date: May 2003
Posts: 1,915
![]() ![]() |
![]() I hate Jass, but guess i have to learn it :/
__________________ |
![]() |
![]() |
![]() |
#14 |
User
Join Date: Dec 2002
Posts: 305
![]() |
![]() Does this work on multiplayer maps?
|
![]() |
![]() |
![]() |
#15 |
Procrastination Incarnate
Development Director
|
![]() Hmm... cinematic maps are usually single player, no?
__________________But anyway, if you mean to use this in a playable map for an introduction cinematic or anything like that, yes, it should work in multiplayer too. I looked through the code again quickly and I found nothing that would limit it to only one player. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
|