Description:
The idea was to quickly build a little demo to showcase two little cam-scripts. Well, it got a bit out of hands and ended up in a full blown camera & sound demo. Still, the core (or main thing to share) are cam_panShot.sqf & cam_panShotFollow(Clocked).sqf.
Content:
cam_panShot.sqf:
this script is for single pan-shots, where you target a position or an object, and define the start- and end-values of the relative distance, height and angle. Thus you can make nice non-linear panShots (circular, oval, whatever..).
If you have trouble with cam-scripting, this little script might be of great use to you, since you don't have to deal with all that camSet/Commit-stuff or any trigonometry...
cam_panShotFollow(Clocked).sqf:
this script builds on top of our cam_panShot.sqf and is an enhanced way to follow a given unit/vehicle, since we don't simply attach the cam to the unit/vehicle in question. (it's a bit randomized, and we react on the units movement a bit, to make it look more natural... hopefully). Also there's a clocked version, which I needed for the demo to synchronise the shots to the music, but I don't think, that this script will be of much use anyone...
The above scripts have some fancy accessory like `critical death` counteractive measures which replaces the target-object with a game-logic in case it died (projectiles tend to do such things.. hehe).. so we should never end up with ugly `[0,0,0] sea-shots`.
Second, we can pass an offsetMatrix (aswell as a mempoint) along with the target-Vehicle. Thus we can have shots, where that target isn't always centered, but for e.g. nicely placed a bit to the side...
And last but not least, we can pass a time-mapping function to our defining transitions (distance, height, angle) to get non-linear transitions.
Camera and sound demo:
What we have now is a bit more than a simple cam-script demo. It's a tool to watch a laid out mission with nice camera shots and synchronized music and it should work with any mission you have (just copy the init.sqf and the needed scripts/music-files, clear the immediateShotStack and there you go..)... And it could become a handy tool (module anyone?) to create or assist the creation of intros, cutscenes or thelike..
About the mechanics:
Basically we pick a random unit (allUnits) and take that unit as target for the next shot. We have several different shot-types (extendable pool if you will...) and we pick them based on the units class (if defined) and to another part randomly again. Also there is a high chance to pick a unit of the same group for the next shot, to get a bit of consistency/to allow some understanding, hehe.
message-stack
We can fill a message-stack. Messages will be poped and displayed (synchronised) at the beginning of the next shot.
blacklist, whitelist, immediate-shot-stack
Now, to get back control, we have a blacklist (thus units will never get picked for our shots) and we have a whitelist (we only pick units from this pool). Then we have an immediate-shot-stack (if not empty, any unit in this stack will be poped next with highest priority). Those three pools can be modified throughout the mission (e.g. blacklisting some units at t0, unlisting them at t1, and whitelisting them at t2 or whatever). If something interessting happens, and you can note that by script, .. there you go, put the unit in question onto the immediate-shot-stack and it will be seen next. (you may put something ontop or at the bottom of the immediate-shot-stack! (in case there already are shots queued))
target selection
The immediate-shot-stack can be used in several way: besides objects/units, you may aswell pass a nullObj (random selection) as a target and still define the shot-type/-settings or submit some shot-code. Also you may limit the randomization and pick a random unit of a certain class (air, men, etc. work aswell as exact classnames such as USMC_Soldier_TL or RU_Soldier_Sniper).. thus you may randomise your cutscene a little each time it runs, and still have total control over it. (imagine three attacking teams to be shown in a cutscene, then you alternate with usmc teamleaders and east teamleaders or something like that!)
shot-code
Every shot can have a shot-code, which will be executed exactly at the start of the shot. The shot-duration is passed to this shot-code. This is extremely usefull to perfectly time things like micro-movements (binocular) or speech or stuff like that.
scene dependend camera filters
We may place some markers and define subtile camera filters for each. Then - every new shot - we pick that filter, whose marker is nearest to the camera. This should support the understanding of what-the-heck is going on here, if you have multiple scenes/distant places... So the recipient may instinctly know, we have switched the scene, etc..
In the demo, we have two scenes, one with a blue-ish another with a red-ish filter. This should help a bit... hopefully. (btw. you can run cam-filters with shot-codes for single/special use)
synchronised music
The idea is to synchronise music to the cam-shots and as a second goal, to have some progression going on. Synchronization is more or less ensured, since we know how fast our music is, so we can clock the shots accordingly on 1/4, 4/4, ... (or whatever). For the progression: there are several music-blocks (from slow/slight, to medium, to hard/fast) all with the same music-bits. Those music-bits are all on one note (E-bit, A-bit, C-bit, etc...) and thus, we can rearrange this music-bits into a song, and have some variance by means of switching the music-blocks. Unforunately scripting isn't that much fun with such time critical tasks, but IMHO it doesn't work too bad.
Demo mission:
mission notes (read or you'll probably end up confused):
I probably should have used the whitelist a bit more (at all, that is) in the beginning, to introduce the recipient a bit better to the mission.. I'm not sure, one can follow that easily what's going on.. but for a `technical demo`, this shouldn't be too bad.
Anyway, quick briefing: there is a russion camp on a hill (main scene) and some west units attack. Second, there is an east artillery located west to this camp (side scene). This artillery will illuminate the main scene and begin to shoot smoke and HE too... of course, there is another west team (frostbite) which will try to disable this artillery.. Frostbite (aswell as most of the arty-units/guards) will be blacklisted for some time... Once frostbite begins to attack the artillery, those units there will be whitelisted, so we watch only the side scene until the scene is released (the arty blown up)...
There is also a arty-projectile-shot (immediate-shot)... though not half that nice as the bulletcam-script :/, hehe
Have a quick look, that should do it:
There are some immediate-shots in the beginning and some later inserted by script.. (paratrooper anyone?) But most of the time, you will watch random shots. Now remember, this is only a poor demo. You can easily make 100% controlled intros/cutscenes with this! (e.g. binocular-shot in the beginning, arty-radio-shot a bit later, ...)
Notes:
- this demo has a crapload of AI (of course!) and could assrape your poor computer, though it doesn't work too bad here on a freaking laptop :/
- have some patience.. though the shots are pretty cool (hehe) it's still no hollywood (thus things need some time to evolve, mission-wise).. Also, you might watch it a second time, for it will be totally different.
- unpbo the demo and have a look at the scripts/comments, setup your own mission and give it a try!
-> you can also deactivate the debug-info (general debug and the projectil-shot debug text)
- any suggestions or feedback in general is welcome.