Jump to content
domcho

Display debfiering when player(s) is/are killed in SP/MP?

Recommended Posts

I'm trying to create a singleplayer mission and a multiplayer co-op variant of it where the player(s) has/have to get killed and receive a different debriefing based on a condition. I've had partial success by either using playerKilledScript.sqs or by overwriting the None class in CfgRespawnTemplates in the description.ext:

class CfgRespawnTemplates
{
    class None
    {
        onPlayerKilled = "scripts\playerKilled.sqf";
    };
};

and in the script file:

if (task1F) then { endMission "END3"; } else { endMission "END1"; };

However, I want to use BIS_fnc_endMission instead of the old endMission, and it will not work.

endMission works in both playerKilledScript.sqs and in an overwritten respawn template using a script to handle player death, but BIS_fnc_endMission is bugged. For example:

if (task1F) then { ["end3", false, 5, true, true] call BIS_fnc_endMission; } else { ["end1", true] call BIS_fnc_endMission; };

the fading effects and music of BIS_fnc_endMission are played but there is no debriefing screen nor does the game end. The default fade effect only plays for a second. User input is disabled and I have to kill the game process and restart the game. Is there some other way I can prevent the default death screen to appear and instead force the mission to display the debriefing with the proper end? For multiplayer: I know you can overwrite the default "loser" debriefing but that doesn't help as I want to keep it in case all players die in a firefight, and have a custom debriefing if the players die from a script command (task1F = true; allPlayers setDamage 1 -> display custom debriefing). I am also aware that I have to remoteExec my commands for multiplayer, but for now I want to get this to work in singleplayer first.

Share this post


Link to post
Share on other sites

playerKilledScript.sqs  is an outdated sqs. Forget sqs. Always use sqf

use onPlayerKilled.sqf 

  or EHs like  MEH "entityKilled" or MPEH "MPKilled" or EH "killed"

 

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

playerKilledScript.sqs  is an outdated sqs. Forget sqs. Always use sqf

use onPlayerKilled.sqf 

  or EHs like  MEH "entityKilled" or MPEH "MPKilled" or EH "killed"

 

From what I tested, it doesn't work with onPlayerKilled.sqf, nor with event handlers. The debriefing won't show, you'll get the default player death camera and effects with the menu. You can't prevent default game behavior after player death (in singleplayer) unless you use playerKilledScript.sqs, or overwrite the default respawn template "None" in the description.ext like I did. With this method, user input gets disabled until mission ends (I can't re-enable it with disableUserInput false), but the game continues to run normally without showing the menu and death camera effect, and I can use endMission command in the script to end the mission with the desired ending. It's just that BIS_fnc_endMission doesn't work in this case, I am forced to use endMission, which is why I am looking for a workaround.

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

×