Jump to content
Sign in to follow this  
-gonzo-

Multiplayer Death Cam

Recommended Posts

Hi everybody,

I was wondering, is there a way to make it so that when you die during an editor made mission in singleplayer,

the standard death menu doesn't pop up, but you remain in game and only get into the menu by pressing escape?

For example in a mission when your position is overrun, you get killed, but you can still look around freely and watch the soldiers execute the others or something like that. it would make a nice 'heavily wounded\unconscious' effect.

Thanks!

-Gonzo-

Share this post


Link to post
Share on other sites

I'm confused. Are you making a multiplayer mission with only one player in it or a true single player mission? (If the latter why is this thread called multiplayer death cam?)

If you're making a singleplayer mission you just need to override the default event script onPlayerKilled.sqs with your own. Note that you cannot look around freely and have the "Retry", "End" dialog on the screen at the same time. You need to decide at what point to display the "Retry" dialog bars because the player will have no way of exiting the mission until it is shown and no way to move the camera after it is shown.

Here is an example single player script, it needs to be named onPlayerKilled.sqs and placed in your mission folder:

_unit = _this select 0
_killer = _this select 1
_pos = getpos _unit
_pos set[2,80]
_seagull = "seagull" camcreate _pos

_camera = "camera" camCreate [0,0,0]
_camera cameraEffect ["internal","back"]
_camera camSetTarget _unit
_camera camSetRelPos [2.71,19.55,12.94]
_camera camCommit 0
@camCommitted _camera

_camera camSetTarget _seagull
_camera camSetRelPos [-6.66,18.99,2.59]
_camera camSetFOV 0.700
_camera camCommit 3
@camCommitted _camera
_camera camSetRelPos [1.17,-21.71,-1.07]
_camera camSetFOV 0.070
_camera camCommit 3
@camCommitted _camera
_seagull switchCamera "external"
_seagull cameraEffect ["terminate","back"]
_seagull camCommit 0
@camCommitted _seagull
camdestroy _camera
_seagull camcommand "manual on"

~10
enableEndDialog

It gives the player control of a seagull for 10 seconds to have a look around then displays the Retry dialog which prevents further camera movement. Alternatively you can use switchcamera to get the view of another unit (e.g for a first person kill cam). Or create a standard camera object and give manual control of its position (camcommand "manual on").

In multiplayer the situation is different depending on the type of respawn you have selected in description.ext. onPlayerKilled.sqs is executed if you die permanently (respawn = "NONE"/0), onPlayerRespawnAsSeagull.sqs for seagull mode (respawn = "BIRD"/1) or onPlayerRespawnAsOtherUnit.sqs when you spawn into a teammate (respawn = "GROUP"/4). For unlimited respawning modes ("INSTANT"/2 or "BASE"/3) no script will be executed, instead you need to use a killed eventhandler to detect the player's death which performs whatever camera manipulations you want (usually during the respawnDelay period) before terminating back to the respawned player unit.

Edited by *Zeewolf*

Share this post


Link to post
Share on other sites

Hi, thanks for the reply! This is exactly what i meant, its great! just one problem: i didnt get the end dialog, so how do i add that? like 30 seconds after death or something would be good.

Share this post


Link to post
Share on other sites

enableEndDialog (if you scroll down in the code above it's the last line). That is what causes the Retry dialog to appear and effectively ends the mission from a user input standpoint.

Just change ~10 to ~30 or whatever for more time, alternatively you could use some other condition based on what's going on in the mission e.g. @!(alive someOtherBloke).

Share this post


Link to post
Share on other sites

Yes the script is perfect, but the problem is that the retry dialog doesnt appear at all! i have to ctrl-alt-del it out of the game everytime i test it now. Also when i press escape or something, nothing happens. What might solve this??

I appreciate your help, Zeewolf! :D

Share this post


Link to post
Share on other sites

Well, I can't break it. Tested it in 1.96 and 1.99 as a single player mission. Here's the mission for what it's worth.

The further up the script you move enableEndDialog the sooner it should appear. There doesn't appear to be another way to end the mission once the player is dead in single player.

Share this post


Link to post
Share on other sites

ah i see, your mission works fine but i don't want a seagull, i want to stay in 1st person view, can the switchcamera do this? maybe switch it to internal?

Share this post


Link to post
Share on other sites

You don't need anything to stay in first person view of the dead player you just have:

~30
enableEndDialog

In the onPlayerKilled script with nothing else. To look left and right you need to enable freelook (* on numpad by default), you can't move the camera without freelook because your characters dead and can't move. If you want the first person view of another unit then use switchcamera to switch to them. If you want third person views them it's better to create a camera and manipulate it through standard camera commands.

Share this post


Link to post
Share on other sites

YES it works!!! i can't thank you enough for this, Zeewolf!!! You've really helped me out here, thank you so much!!! Sorry for being so unclear in the beginning but this is really fantastic. Thanks again!!

-Gonzo

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  

×