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

Hello everyone. I know that this post is really old but I have a similar problem as the one mentioned above. I set respawn tickets for individual players through initPlayerLocal.sqf  like this:
 

[_player, 3] call BIS_fnc_respawnTickets;

I have the Tickets and the EndMission respawn templates and not only the mission does not end when all players do not have any more respawn tickets but they continue to spawn in even when their respawn tickets have been depleted!

I got no idea what I am doing wrong here but it seems that I am missing something here!

Share this post


Link to post
Share on other sites

Hey @A. Ares,

 

Unless I'm mistaken, I think the BIS_fnc_respawnTickets function has to be executed on the server.

 

Replace your line in initPlayerLocal.sqf with this one, let me know if it works.

[player, 3] remoteExec ["BIS_fnc_respawnTickets", 2, false];

 

  • Like 1

Share this post


Link to post
Share on other sites

@Mr Elusive thank you for taking the time to answer to my "calling"...

I did try your solution out but it seems that the problem is not solved! Although, with my tests I "discovered" some other weird things:

- To disable respawn, I have to set the respawn tickets for the player to and have both "Tickets" and "TicketsSpawn" Respawn Templates active.

- If I set the respawn tickets to >1 the player respawn no matter what I do.
- For all the above the locality of the executed function seems to produce no different effect!

For now, my workaround to this is to check the number of the respawn tickets when a player is killed and if they don not have any left, I will set the respawn time to something really big (bigger than the mission time itself at least). But this is really weird! I will dig into it later and I will let you know!

Again mate, thank you for the help! Really appreciate it!
 

E-D-I-T:
SCRAP EVERYTHING... I am officially retarded... I had a command to change the respawn time onPlayerKilled.sqf... So, when the game was having the player unable to respawn (there is a chance that this is achieved with a very high respawn time), I was setting it to desired value and the timer was resetting to this number so, the player could respawn again!

Also, all my tests were in Local Host through the editor! I will check more and let you know!

Again @Mr Elusive really appreciate the help!

  • Haha 1

Share this post


Link to post
Share on other sites

@A. Ares Yeah of course, happy to help!

 

I feel like we're probably just missing a step somewhere.

 

Two questions:

  1. Where are you changing the respawn settings? Within the editor or description.ext?
  2. What respawn template are you using? Base? Instant? MenuPosition?

I think #2 might be the issue as BIS_fnc_respawnTickets doesn't work properly if you're using the wrong template(s). Double-check that for me please.

 

I'm working today, but if you're still stuck on this, I'll see if I can re-create what you're trying to do in the editor when I get home.

 

Good luck! 😎

  • Like 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

×