Jump to content

Recommended Posts

I came across an interesting piece of code while taking a look through BI's end game spectator code today:

case "ChildDestroyed":
	{
		scriptName "RscDisplayEGSpectator: ChildDestroyed";
		disableSerialization;

		private ["_display", "_child", "_exitCode"];
		_display	= _params select 0;
		_child 		= _params select 1;
		_exitCode	= _params select 2;

		if (_exitCode == 104) then
		{
			_display closeDisplay 2;
			(findDisplay 46) closeDisplay 2;
		};
	};

This code runs when the spectator display encounters a ChildDestroyed event as you might expect, but what I haven't come across before is the display exit code 104 being used in the condition. Until now the only exit codes I've really been aware of are 1 for display confirmation and 2 for display cancellation (and unofficially 0 is often for scripted closure). The fact that the mission display is manually being closed when this exit code is encountered makes me wonder if this is related to mission end.

 

If anyone knows anything about this I'd be grateful to learn the relevance of this specific code.

Share this post


Link to post
Share on other sites
4 hours ago, silentspike said:

The fact that the mission display is manually being closed when this exit code is encountered makes me wonder if this is related to mission end.

Closing the mission display (46) causes the mission to end. I couldn't find a difference between 0, 1 or 2. Maybe 1 means mission was succesful and 2 means mission failed? Not sure though. Also I guess that ending a mission this way is local only and only the player the command was executed on is being put in the lobby again. Not tested.

Share this post


Link to post
Share on other sites

104? I didn't find any dik keycode with 104 (or 0x68 in fact) . Not in defineDikCodes.inc

But, I can see that 104 like you, in the GUI script RscDisplayEGSpectator.sqf ... So, reserved?

Share this post


Link to post
Share on other sites

For any curious future google searchers: I figured out that this manually handles the case where the abort button is pressed in the pause menu (which is created as a child display of the spectator display).

  • Like 2

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  

×