Jump to content
greenpeacekiller

Disable EndMission when out of Tickets

Recommended Posts

I've noticed that when you used Tickets the mission ends automaticlly when all the tickets run out.

Is there a way to make it so all the respawns are disabled when tickets run out and it only ends when all players are dead?

Thanks

Share this post


Link to post
Share on other sites

Anyone?

 

EDIT:

Im pretty confused with this documentation bohiema has provided.

at https://community.bistudio.com/wiki/BIS_fnc_respawnTickets

They say:

Quote

When player runs out of the tickets, his respawn is disabled. If you use also EndMission respawn template, the mission will automatically end once tickets in all name spaces are exhausted.

 

So I went to https://community.bistudio.com/wiki/Arma_3_Respawn in an attempt to figure out why the hell it ends automaticlly and found out they enable it by default

Quote

When the respawnTemplates entry is missing, default templates based on the respawn type are used:

NONE: None

BIRD: Spectator, EndMission

INSTANT: Instant, Counter

BASE: Base, Counter

GROUP: Group, EndMission

SIDE: Side, EndMission

 

Now obviously, my goal here is to disable 'EndMission'

But I dont see any proper instructions on disabling this feature inside the documentation (or i missed it)

 

Please, someone must have an easy fix for this that I am missing?

Share this post


Link to post
Share on other sites

Even though the templates array can be set explicitly via respawnTemplates, it seems the game always ends when the number of tickets for any side reaches zero. Unfortunately, I haven't been able to determine what causes the mission to end, but I have come up with a simple "hack" to disable it:

Add this to description.ext:

allowFunctionsRecompile = 1;

And this to init.sqf:

BIS_fnc_endMission = compileFinal "";

The first line makes compiled functions non-final, i.e. making their values changeable. On init, the second line changes the value of BIS_fnc_endMission to that of an empty piece of code (and makes it final), so when the function is called by any means, it doesn't do anything. Note that this affects all calls to the function, so if you want to call it, you have to assign the original value to another variable and call that.

Share this post


Link to post
Share on other sites

I have totally the opposite problem. I run out of tickets, cannot spawn but the mission doesn't end. This is my description.ext
 

author			= "kibaBG";
onLoadName		= "Trench Code";
onLoadMission	= "Hold the line and save the oil refinery";
loadScreen		= "";

class Header
{
	gameType =  Coop;	
	minPlayers =  5;	
	maxPlayers = 10;	
};

respawnOnStart = 0;
respawn = 3;
respawnTemplates[] = {"MenuPosition","Tickets","EndMission"};
enableDebugConsole = 0;
allowProfileGlasses = 0;
saving = 0;

I saw "EndMission" template is not possible for respawn "BASE". But how can I end mission when all players run out of tickets?
 

Share this post


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

I saw "EndMission" template is not possible for respawn "BASE".

 

???

 

Quote

EndMission  |  Automatically fail the mission once all players are dead (for NONE, BIRD, GROUP and SIDE respawn types) or when all respawn tickets are exceeded (for INSTANT and BASE respawn types with Tickets template)

 

Share this post


Link to post
Share on other sites

.

Edited by UnDeaD.
replied to OP's old post

Share this post


Link to post
Share on other sites

@Harzach Sorry for not understanding what was written but mission does not end when all tickets are zero and player is dead. What can I do to change this ...😔  
 

I define tickets with

[west, 5] call BIS_fnc_respawnTickets;

from initServer.sqf
Maybe I have to define tickets somewhere else?

Share this post


Link to post
Share on other sites

I don't know if anyone is still following this thread, but I manage to figure out why the mission ends (or doesn't end in kibaBG's case).

 

I've posted a snippet below from BIS_fnc_respawnTicketsModule. You'll notice there's a check for tickets when one side reaches zero. If you define tickets using BIS_fnc_respawnTickets like kibaBG above, the mission does not automatically end. You can then make your own trigger or condition check to go from there.

 

//--- End the mission after tickets are exhausted
	if (isnil "bis_fnc_moduleRespawnTickets_end") then {
		bis_fnc_moduleRespawnTickets_end = [] spawn {
			scriptname "bis_fnc_moduleRespawnTickets: Loop";
			waituntil {
				sleep 1;
				(([[west,east,resistance,civilian]] call bis_fnc_respawnTickets) select 1) == 0
			};
			"SideTickets" call bis_fnc_endMissionServer;
		};
	};

 

TL;DR

  • If you want the mission to end automatically, use the Respawn Tickets module in the editor.
  • If you DON'T want the mission to end automatically, set respawn tickets in initServer.sqf using BIS_fnc_respawnTickets.

Hope this helps 😎

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

For MP mission where you have only one playable side:
If you place the Respawn Tickets module and give to Blufor lets say 10 tickets, but you don't enter any number for Opfor tickets, when your tickets reach zero you got "Your Side Won" instead of "Mission Failed" screen.
To get proper "Mission Fail" screen you have to define the Opfor tickets too, I always make them to be more than Blufor tickets, but you can probably just enter only "1" (one ticket). Hope this helps! :shine:
Still wondering how to add custom "Mission Fail" screen when tickets reach zero ... 

Share this post


Link to post
Share on other sites
7 hours ago, kibaBG said:

Still wondering how to add custom "Mission Fail" screen when tickets reach zero ... 

 

Hey Kiba,

 

You can define your own win/fail screens in description.ext using cfgDebriefing.

 

// Add to Description.ext
class CfgDebriefing
{
	class BLU_Wins
	{
		title = "Mission Completed";
		subtitle = "BLUFOR Wins";
		description = "BLUFOR wins the game.";
		pictureBackground = "";
		picture = "b_inf";
		pictureColor[] = { 0.0, 0.3, 0.6, 1 };
	};
};

 

Once you've done that, create a trigger or script to globally execute BIS_fnc_endMission. For example:

 

// Single player.
["BLU_Wins", true] call BIS_fnc_endMission;
// Multiplayer.
["BLU_Wins", true] remoteExec ["BIS_fnc_endMission", 0, true];

 

That's pretty much all you need. I strongly recommend reading those two wiki pages as they contain a lot of information, including additional options/settings I've not listed here.

 

If you have further questions feel free to ask, but I might not be able to answer until later in the day (working!).

 

Cheers 😎

  • Like 1

Share this post


Link to post
Share on other sites

@Mr Elusive Thanks for the replay, I have already defined the custom end screens in description.ext, but I want to customize the default end screen that triggers when tickets reach zero, if its possible. Something like "You have no more reinforcements" ...  

Share this post


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

...I want to customize the default end screen that triggers when tickets reach zero, if its possible. Something like "You have no more reinforcements" ...   

 

Hello again Kiba,

 

Is the mission supposed to end or continue after showing that "you have no more reinforcements" message?

 

Depending on what you want, there's a few approaches you can take.

 

(Just trying to help and want to make sure I understand your question properly)

Share this post


Link to post
Share on other sites

The mission should end with custom end screen, because the players will miss when they reach zero tickets. I play with 2 more friends and want to give them clue why the mission failed.    

Share this post


Link to post
Share on other sites

Oh okay. In that case, the code I posted above should work. Just change Title, Subtitle and Description text to whatever you want.

// Add to Description.ext
class CfgDebriefing
{
	class ZeroTickets
	{
		title = "Mission Failed";
		subtitle = "No More Reinforcements";
		description = "Your team ran out of tickets.";
		pictureBackground = "";
		picture = "b_inf";
		pictureColor[] = { 0.0, 0.3, 0.6, 1 };
	};
};
// Change second parameter to 'false' because it's a failed mission.
["ZeroTickets", false] remoteExec ["BIS_fnc_endMission", 0, true];

This is what you get:

Spoiler

107410-20240326172940-1.png

 

107410-20240326172952-1.png

 

Three things you should be aware of if the mission is "failed" (the second parameter in BIS_fnc_endMIssion is 'false').

  • The title text will be in orange
  • The title text will always be "Mission Failed", regardless of what you put in description.ext
  • The mission failed music will play (obviously)

Does this answer your query?

  • Like 1

Share this post


Link to post
Share on other sites

@Mr Elusive The problem is I don't how to execute  

["ZeroTickets", false] remoteExec ["BIS_fnc_endMission", 0, true];

with the ticket module, so it triggers automatically?
I tried to run 
 

if (isnil "bis_fnc_moduleRespawnTickets_end") then {
		bis_fnc_moduleRespawnTickets_end = [] spawn {
			scriptname "bis_fnc_moduleRespawnTickets: Loop";
			waituntil {
				sleep 1;
				(([[west,east,resistance,civilian]] call bis_fnc_respawnTickets) select 1) == 0
			};
			["ZeroTickets", false] remoteExec ["BIS_fnc_endMission", 0, true];
		};
	};

from initServer.sqf but the result is the same, I get only the default end screen when tickets reach zero ...

Share this post


Link to post
Share on other sites

Apologies @kibaBG I should have explained myself properly.

 

Don't use the respawn tickets module as that will play the default ending - which you don't want. Try this instead:

 

initServer.sqf

[west, 10] call BIS_fnc_respawnTickets;

 

After you've done that, place a default trigger anywhere on the map and check the server only box.

 

Condition:

[west] call BIS_fnc_respawnTickets <= 0


Activation:

["ZeroTickets", false] remoteExec ["BIS_fnc_endMission", 0, true]

 

That should end the mission when BLUFOR (aka 'west') runs out of tickets.

 

(I'm doing some after hours work, but I might be able to respond a bit later if this doesn't work.) 😎

  • Like 1

Share this post


Link to post
Share on other sites

 Unfortunately, it does not work. :icon_confused:
I tried with trigger server only or not, I removed the ticket module, but still it only shows default end screen.

Share this post


Link to post
Share on other sites

Hmm...OK let me see if I can replicate it in a test mission. Give me a few minutes.

Share this post


Link to post
Share on other sites

@kibaBG - Here's a test mission with just the code I provided earlier. It definitely works.

 

Feel free to unpack it and test in the editor for yourself. Make sure you test in MP as respawning doesn't work in SP.

 

I've also given BLUFOR just two tickets instead of 10 to speed things up. Respawn twice and you should get the custom debrief.

 

https://file.io/G6A3QduJ0Vxd (link is valid for 14 days)

Share this post


Link to post
Share on other sites

@Mr Elusive I have tested your mission, works perfectly. I also found my mistake - I have doubled somehow the CfgDebriefing class, now its working as it should! :face_palm: 

Thank you for helping ! :respekt:

  • Haha 1

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

×