Jump to content
Sign in to follow this  
Alvim-R

Shortening death camera panning time

Recommended Posts

Hi, all!

Although being somewhat unfamiliar with war simulations, I've recently bought Operation Flashpoint - Game of the Year Edition and I must say it's been a tremendously fantastic gaming experience so far, especially with the vast array of excellent addons and total conversions by the industrious OFP community. My most sincere thanks to all of you!

However, I've come across a slightly frustrating situation when playing some Flashpoint missions, both in singleplayer and multiplayer modes. As far as I can gather, if you are the leader of a group (or part of the group, in multiplayer) and you die, you usually switch to another soldier in that group until no more units are left. The switch process is carried out through a death camera that pans from the deceased soldier to the one you're about to take control of.

The problem is the game doesn't pause while the camera takes precious seconds to pan and zoom, often leading to the death of the next soldier when the group engages in fierce firefight. Sometimes, you can actually lose three or more men in succession while you patiently wait for the camera to allow you to control each of them.

Although I understand BIS might have decided to go for this unit switching method for realism reasons (it would probably take a while for the chain of command to be rearranged in a real combat situation), is there any way to lower the camera pan time to about one second or even allow an immediate switch, removing the camera entirely?

I'm using OFP 1.96 and ECP 1.085.

Many thanks in advance!

Share this post


Link to post
Share on other sites

Rúben,

I was thinking just the same this week. Although, I cant supply a solution for you, the method of switching player on death is implemted by the ECP mod, and so it would be more apropriate to ask one of the ECP team or to check the ECP thread.

Let us know if you find a suitable answer!

(I'd prefer the game to pause with a similar switching time but any solution would be good)

Actually, isn't this all Kegetys Spectating script or am I mistaken?

Share this post


Link to post
Share on other sites
the method of switching player on death is implemted by the ECP mod, and so it would be more apropriate to ask one of the  ECP team or to check the ECP thread.

An interesting possibility, but the exact same thing seems to happen when playing the game without ECP activated (i.e. launching OPF from the default "Flashpoint GOTY Edition" shortcut instead of the ECP one). I've checked both the ECP mod thread (on this and other forums) and the ECP script settings files, but couldn't find any specific information on this subject. I could have missed something though.

Quote[/b] ]Actually, isn't this all Kegetys Spectating script or am I mistaken?

Correct. Kegety's spectator script is embedded in ECP, but it only kicks in when all units in your group are dead, allowing you then to spectate any remaining non-playable unit in your side or respawn as a seagull.

The actual zoom-out, wide-panning and zoom-in camera moves after a player-controlled soldier in a group is dead are apparently part of OFP itself.

So far, I've found two theoretical ways of changing or removing this set of camera moves:

• Adding respawndelay to the mission's "description.ext" file and setting it to "1" (one second) or "0" (which I assume would mean no delay at all). The code should look like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

respawn = "group";

respawndelay = 1;

It doesn't seem to work with the "group" entry though. Other entries (ex. "instant" or "bird") do work with respawndelay.

• Editing the "scripts.pbo" file in the "Operation Flashpoint\Dta" folder or "Operation Flashpoint\@ECP\Dta" (the latter for the ECP mod). In an unrelated thread I've found hints that this file is one of the default sources for death camera processing scripts in OFP.

When dePBOing the file, there are several scripts available, one of them, "onPlayerrespawnOtherUnit.sqs", sounding like the perfect candidate for inclusion of the camera move configuration. Indeed, when opened, that script shows a lot of camera-related code.

Making some minor changes to this file and rePBOing it would most probably produce visible results, but I'd rather have a step-by-step guide than risking corrupting the OFP installation, as my experience with script editing is very limited.

Share this post


Link to post
Share on other sites

Add exit command to the start of onPlayerrespawnOtherUnit.sqs and you will change to other unit immidiately when you die. Like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">exit

_player = _this select 0

_killer = _this select 1

_new = _this select 2

;init

_camera = "camera" camCreate [9578.59,3540.29,1.66]

_camera cameraEffect ["internal","back"]

titleCut["","BLACK IN",1]

...(cut)...

Note that it doesnt work from folder 'scripts' unless you rename both ECP's and OFP's scripts.pbo.

Share this post


Link to post
Share on other sites
Add exit command to the start of onPlayerrespawnOtherUnit.sqs and you will change to other unit immidiately when you die.

Not only an unexpectedly simple answer, but actually extremely effective as well! In fact, I'd even go as far as to say it's almost too efective, as by preventing the script's execution the transition between units is so abrupt (instantaneous, I reckon) that most of the time you don't realize you've just been shot dead and are now in control of another soldier, especially if the squad under your command shares similar weapons and is moving in more or less the same kind of terrain.

Consequently, I've been looking into editing the script so there is a clear sign to the player the unit he controls has just fallen under enemy fire. My initial idea was having the following happening once a soldier dies:

- Soldier falls lifelessly to the ground. Point of view remains internal (i.e. through his eyes).

- Fade-out over two seconds.

- Quick fade-in on the internal point of view of the next soldier under player control.

Unfortunately, it seems there is no easy way (or a way at all) to have a soldier's point of view remaining internal for a few seconds after that soldier dies. The very instant he is lethally hit, control switches to the next unit. Even trying to force a switchCamera "INTERNAL" camera command in the script on the fallen soldier doesn't seem to work. Apparently, when the game regards a unit as dead you simply can't see through his eyes (which actually makes perfect sense).

As such, I resorted to using the standard external camera. The effect becomes then:

- Soldier falls lifelessly to the ground. Point of view switches to zooming-out external as soon as the deadly bullet or explosion impacts.

- Fade-out over two seconds.

- Quick fade-in on the point of view of the next soldier under player control.

The code for this event sequence follows below:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_player = _this select 0

_new = _this select 2

;Camera initialisation

_camera = "camera" camCreate [9578.59,3540.29,1.66]

_camera cameraEffect ["internal","back"]

;Camera movement initialisation

_camera camSetTarget _player

_camera camSetRelPos [0.20,0.39,1.86]

_camera camSetFOV 0.143

_camera camCommit 0

@camCommitted _camera

;Camera zooms out over 3 seconds, fading to black on the last 2 seconds

_camera camSetRelPos [-0.07,7.96,3.48]

_camera camSetFOV 0.7

_camera camCommit 3

titlecut [" ","black out",2]

@camCommitted _camera

;Quick fade-in on internal point of view of the next unit

_camera camSetTarget _new

_new switchCamera "INTERNAL"

_new cameraEffect ["terminate","back"]

camDestroy _camera

titlecut [" ","black in",1]

~1

exit

And that's it. Replacing all the code in the "onPlayerrespawnOtherUnit.sqs" file with the above shown, rePBOing the set of unpacked files into "scripts.pbo" and replacing the ECP mod "scripts.pbo" file with this one seems to do the trick (and, if necessary, a similar sequence of steps can be done to OFP's default "scripts.pbo" for people not using ECP). After some testing, I'm quite happy with the results and wouldn't have been able to do it without your initial guidance, Metal Heart. Thanks a lot!

This is my very first attempt at OFP scripting, so I'm sure there is still room for improvement in the code. In case anyone finds this script interesting, feel free to use it or expand on it.

(I'd prefer the game to pause with a similar switching time but any solution would be good)

Unfortunately, as far as I could see from my limited scripting experience, pausing the entire game via scripts seems something quite complex to pull off, to put it lightly. The best information I could find was slowing the game down to near zero speed using the setAccTime command, but this will also slow down any camera movement and is not compatible at all with multiplayer modes, I believe. Still, I'll keep looking into this and will get back to you if and when I have positive news.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×