Jump to content
Sign in to follow this  
troster

Help with mission ending for seperate sides

Recommended Posts

Hey all, I've made a PvP mission for a few friends and I for a LAN party.

BLUFOR needs to extract two hostages (civillians, host1 and host2) back to their base while OPFOR attempts to fight off BLUFOR. If all BLUFOR units die I want OPFOR to get the Mission complete screen and BLUFOR to get the mission failed screen.

But if BLUFOR extracts the hostages successfully I want OPFOR to have the Mission Failed screen and BLUFOR to get the mission success screen.

Initially, I had a trigger that detected the civilians and once the civilians were detected it would end (The type was End #1) however I figured that this would display mission complete for every unit regardless of what faction they were. I was wondering how to display a mission success and a mission failed for the necessary units.

In Arma 2 I remember making what I guess you could call 'properties' for each End type but it's been a long time since I last did that and I cannot remember how to do it at all.

Everyone's help is appreciated.

Share this post


Link to post
Share on other sites

You can define different endings in the description.ext

Create the file in the missionfolder and add something like this:

class CfgDebriefing
{  
class End1
{
	title = "The Hostages got rescued!";
	subtitle = "";
	description = "The Hostage-takers got annihilated!";
	pictureBackground = "";
	picture = "b_inf";
	pictureColor[] = {0.0,0.3,0.6,1};
};
class End2
{
	title = "The SWAT Team got wiped out!";
	subtitle = "";
	description = "No dinner at home tonight for these hostages.";
	pictureBackground = "";
	picture = "b_inf";
	pictureColor[] = {0.0,0.3,0.6,1};
};
class End3
{
	title = "Everyone died!";
	subtitle = "";
	description = "Suicide statistics going through the roof!";
	pictureBackground = "";
	picture = "b_inf";
	pictureColor[] = {0.0,0.3,0.6,1};
};
};

In the mission you can call each individual ending with this simple line:

"end1" call BIS_fnc_endMission;

Share this post


Link to post
Share on other sites

Thanks, I thought it had something to do with the init.sqf or the description.ext but I couldn't remember what to write.

How would I define End 1 as a BLUFOR win and an OPFOR loss so that it will actually say in game that they've won / lost? Or can I not do that?

Share this post


Link to post
Share on other sites

"end1" call BIS_fnc_endMission;

Ammend this so it calls a different ending depending on your side.

 if (player ==WEST) then {
"end1" call BIS_fnc_endMission;};
if (player ==EAST) then {
"end2" call BIS_fnc_endMission;};

Havnt scripted in several months but you get the idea.

Share this post


Link to post
Share on other sites

You could make a script called

endMission.sqf

inside put

if (player ==WEST) then {
"end1" call BIS_fnc_endMission;};
if (player ==EAST) then {
"end2" call BIS_fnc_endMission;};

Inside your trigger that determines the end of the game on ACT have

null=[]execVM "endMission.sqf";

Is wont this will work in a dedicated server though.

Share this post


Link to post
Share on other sites
You could make a script called

endMission.sqf

inside put

if (player ==WEST) then {
"end1" call BIS_fnc_endMission;};
if (player ==EAST) then {
"end2" call BIS_fnc_endMission;};

Inside your trigger that determines the end of the game on ACT have

null=[]execVM "endMission.sqf";

Is wont this will work in a dedicated server though.

Shit, the mission will be hosted on a dedicated server. :(

I might just do the different endings Grumpy posted earlier. Otherwise, thanks for the help guys. :)

EDIT

Would you guys by any chance know the color coding for OPFOR? For BLUFOR it's 0.0, 0.3, 0.6, 1 but I have no idea what it is for OPFOR.

Edited by ChunkyTomato

Share this post


Link to post
Share on other sites

Could take care of it all from the server, something like ...

_endGameThread = [] spawn {
if (isServer) then {
	while {true} do {
		_bluUnits = [];
		{
			if (isPlayer _x && side _x == west ) then {
				_bluUnits set [count _bluUnits, _x];
		}forEach playableUnits;

		if ( {alive _x} count _bluUnits == 0 ) exitWith {
			[ ["DeadLost", false, 2], "BIS_fnc_endMission", west, false] call BIS_fnc_MP; //fade to black
			[ ["DeadWon", true, true], "BIS_fnc_endMission", east, false] call BIS_fnc_MP; //signature shot
		};

		if ( triggerActivated HostagesEscapedTrigger ) exitWith {
			[ ["HostageWon", true, true], "BIS_fnc_endMission", west, false] call BIS_fnc_MP; //signature shot
			[ ["HostageLost", false, 2], "BIS_fnc_endMission", east, false] call BIS_fnc_MP; //fade to black
		};
	};
};
};

Description.ext

class CfgDebriefing
{  
class HostageWon
{
	title = "The Hostages got rescued!";
	subtitle = "";
	description = "The Hostages were successfully resscued!";
};
class HostageLost
{
	title = "The Hostages got rescued!";
	subtitle = "";
	description = "Time to go AWOL your surely lose you head for this";
};
class DeadLost
{
	title = "Your extraction team got wiped out!";
	subtitle = "";
	description = "No dinner at home tonight for the hostages.";
};
class DeadWon
{
	title = "The extraction team was eliminated";
	subtitle = "";
	description = "Order more bread and water for the infedel captives";
};

};

  • Like 1

Share this post


Link to post
Share on other sites
Could take care of it all from the server, something like ...

_endGameThread = [] spawn {
if (isServer) then {
	while {true} do {
		_bluUnits = [];
		{
			if (isPlayer _x && side _x == west ) then {
				_bluUnits set [count _bluUnits, _x];
		}forEach playableUnits;

		if ( {alive _x} count _bluUnits == 0 ) exitWith {
			[ ["DeadLost", false, 2], "BIS_fnc_endMission", west, false] call BIS_fnc_MP; //fade to black
			[ ["DeadWon", true, true], "BIS_fnc_endMission", east, false] call BIS_fnc_MP; //signature shot
		};

		if ( triggerActivated HostagesEscapedTrigger ) exitWith {
			[ ["HostageWon", true, true], "BIS_fnc_endMission", west, false] call BIS_fnc_MP; //signature shot
			[ ["HostageLost", false, 2], "BIS_fnc_endMission", east, false] call BIS_fnc_MP; //fade to black
		};
	};
};
};

Description.ext

class CfgDebriefing
{  
class HostageWon
{
	title = "The Hostages got rescued!";
	subtitle = "";
	description = "The Hostages were successfully resscued!";
};
class HostageLost
{
	title = "The Hostages got rescued!";
	subtitle = "";
	description = "Time to go AWOL your surely lose you head for this";
};
class DeadLost
{
	title = "Your extraction team got wiped out!";
	subtitle = "";
	description = "No dinner at home tonight for the hostages.";
};
class DeadWon
{
	title = "The extraction team was eliminated";
	subtitle = "";
	description = "Order more bread and water for the infedel captives";
};

};

Cheers Larrow, much appreciated. I'll give it a try.

Share this post


Link to post
Share on other sites

The colors are RGB so, R,G,B. 1.0,0.0,0.0 would be red. 0.0,1.0,0.0 would be green and 0.0,0.0,1.0 would be blue. The last number is alpha or transparency.

Share this post


Link to post
Share on other sites
Cheers Larrow, much appreciated. I'll give it a try.

ChunkyTomato, did you get this to work? If so where did you put the first bit of code, the _endGameThread part?

Thanks for any help.

Share this post


Link to post
Share on other sites
On 5/2/2015 at 12:52 PM, carpetburns said:

ChunkyTomato, did you get this to work? If so where did you put the first bit of code, the _endGameThread part?

Thanks for any help.

Were you able to figure this out?

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  

×