Jump to content
Sign in to follow this  
ledhead900

How do I fail a mission with lose text?

Recommended Posts

Hello Peeps.

I have eight hostages if any of them die the mission needs to fail with a lose state but it also has to display a brief short message on why the mission ended.

Below is what I have setup right now

Trigger

4LFCm.png

Except when I kill a hostage on purpose to test the trigger -

http://puu.sh/4LFH1.jpg (178 kB)

I believe this is the proper lose state but I need it too display some details about why it was failed before proceeding to this window how can I do that? What I am asking for is an elegant fail window before the de-briefing window appears.

Share this post


Link to post
Share on other sites

Add this to your description.ext:

class CfgDebriefing
{  
class End1
{
	title = "Mission Accomplished!";
	subtitle = "You made it to Camp Maxwell.";
	description = "";
	pictureBackground = "images\main.jpg";
	picture = "b_inf";
	pictureColor[] = {0,1,0,1};	
};

class lose
{
	title = "Mission Failed!";
	subtitle = "Cdr. Gomez died.";
	description = "";
	pictureBackground = "images\main.jpg";
	picture = "b_inf";
	pictureColor[] = {1,0,0,1};	
};
};

And then use in your trigger:

[s]endMission "lose";[/s]
["lose", false, true] call BIS_fnc_endMission;

You may change the paths to the pictures as i copied that from one of my missions. See debriefing for details.

Edited by IndeedPete
correction

Share this post


Link to post
Share on other sites

And then use in your trigger:

[color="#FF0000"][s]endMission "lose";[/s][/color]

   ["lose", false, true] call BIS_fnc_endMission; 

Share this post


Link to post
Share on other sites

I believe this is the proper lose state but I need it too display some details about why it was failed before proceeding to this window how can I do that? What I am asking for is an elegant fail window before the de-briefing window appears.

Oh, i overread that, but of course you can combine Dirty Haz' and my answers. ;)

Share this post


Link to post
Share on other sites
Use this command.

Dirty Haz

Thanks.

   ["lose", false, true] call BIS_fnc_endMission; 

Thanks for the correction.

Add this to your description.ext:
class CfgDebriefing
{  
class End1
{
	title = "Mission Accomplished!";
	subtitle = "You made it to Camp Maxwell.";
	description = "";
	pictureBackground = "images\main.jpg";
	picture = "b_inf";
	pictureColor[] = {0,1,0,1};	
};

class lose
{
	title = "Mission Failed!";
	subtitle = "Cdr. Gomez died.";
	description = "";
	pictureBackground = "images\main.jpg";
	picture = "b_inf";
	pictureColor[] = {1,0,0,1};	
};
};

And then use in your trigger:

[s]endMission "lose";[/s]
["lose", false, true] call BIS_fnc_endMission;

You may change the paths to the pictures as i copied that from one of my missions. See debriefing for details.

Thanks for that :), will custom pictures be sent with the mission if I put them in my mission folder along side the scripts ?, Say I wanted to design my own picture and publish to workshop would that work, or must I use the pictures provided by the game?

Yea I will probably combine the two methods, as far as the condition is concerned though is that correct? I tried to make it an array the first time but that never worked as the I got an error saying "Type:Array, Syntax expects a Group" along those lines. I thought it may have been possible to put group names into an Array but I probably did that wrong.

Is what I used as the condition first time.

!alive [H1, H2, H3, H4, H5, H6, H7, H8];

Would it work with quotation tags surrounding the group names? (["H1"]) I will probably find the answer for this before you respond so if you respond thanks in advance, I am going to have a Google and rummage through the wiki base.

Believe it or not this my second attempt at a mission I got a lot of the basics down pat now, If you want to check out my mission add me on Steam because its public to friends only until I complete the win and lose states.

EDIT

To save creating a new thread for this I will ask some additional things.

The players testing my mission have asked if it was possible to have a counter for how many hostages are left to rescue, I had a couple methods in mind which did not involve scripts -

1. Display a Hint for every hostage you rescue, and accompany this with a trigger which then hinted how many hostages were left (Remaining Hostages: 2/8) I believe this would need to use a counter except I have no idea how to do the second half "counter" part of this method, the hint I can easily do by adding that to the trigger which releases them from being captive.

2.Assign Multiple Tasks once the scenario progresses to the point where you need to rescue the hostages, one for each hostage with a simple description. I know how to do this one as well.

If I learn how to make a counters inside a hint I would be able to use that in a custom debrief as after looking over the stuff you provided I have a much better idea on how the ending needs to be done and what things I can add to the ending.

Any other ideas on this are welcome.

Edited by ledhead900
Asked a new question.

Share this post


Link to post
Share on other sites

First: Yes, if you place custom pictures in your mission folder they will be exported along with the mission. Edit: The debriefing pic however must be 1:1, otherwise it will just look ugly.

1. Well, how do you exactly "rescue" your hostages? What do you do to free them, when are they safe?

2. You can use built in functions to achieve that. But i suggest to create external scripts in your mission folder for that as it's really uncomfortable to work with larger texts in triggers:

[player, "tCamps", ["Search the enemy camps for information!", "Search the Camps", ""], nil, false, 1] call BIS_fnc_taskCreate;
[player, ["tCampCharkia", "tCamps"], ["Search the <marker name=""mCampCharkia"">camp near Charkia</marker> for information!", "Camp near Charkia", "Camp"], "mCampCharkia", false, 1] call BIS_fnc_taskCreate;
[player, ["tCampAgios", "tCamps"], ["Search the <marker name=""mCampAgios"">camp near Agios Georgios</marker> for information!", "Camp near Agios Georgios", "Camp"], "mCampAgios", false, 1] call BIS_fnc_taskCreate;
[player, ["tCampMountains", "tCamps"], ["Search the <marker name=""mCampMountains"">camp in the mountains</marker> for information!", "Camp in the Mountains", "Camp"], "mCampMountains", false, 1] call BIS_fnc_taskCreate;

The above code will generate one parent task with three subtasks, you can look up the exact parameters of this function in the editor -> functions viewer.

Share this post


Link to post
Share on other sites

To rescue them I simply have have any member of the group linked to the trigger walk into the trigger, which activates the trigger. Then the trigger sets the captive to false and allows Ai move and makes the units join Player1 which is the squad leader of the mission.

The problem with your 2. is that I don't want the location reveled I have a trigger setup already in my mission to put a circle on the map where the possible locations of the hostages are but your team has to search those area's for them manually. For 2. all I would use would be a task with no markers being shown on the map and a succeed as each one was rescued. I placed the hostages in the 4 separate triggers so they are in groups of two.

I will try your method 2. out I like the idea of parent tasks as they suit the fact you need to rescue 8 units quite well being that you would have one main task and then the sub objectives of that task :).

Share this post


Link to post
Share on other sites

Okay, probably simplest way is just hard coded numbers. In init.sqf something like:

hostages = 8;
rescuedHostages = 0;

And then in some trigger or script:

rescuedHostages = rescuedHostages  + 1;
hint format ["Hostages rescued: %1/%2", rescuedHostages, hostages];

Of course you could go a bit more advanced by counting them dynamically. Maybe if your hostages are civilian and there are no "normal" civies on the map you could try stuff like:

hostages = {(side _x) == civilian} count allUnits;

Or "store" your hostages in an array:

hostages = [h1, h2, h3, ...];
hostageCount = count hostages;

But there are probably way better ways.

If you want the task to have no destination then just pass nil and leave the marker references. There won't be any icon leading you to some point:

[player, "tReza", ["Capture or kill General Reza!", "Neutralize Gen. Reza", ""], nil, false, 1] call BIS_fnc_taskCreate;

Share this post


Link to post
Share on other sites
Okay, probably simplest way is just hard coded numbers. In init.sqf something like:

hostages = 8;
rescuedHostages = 0;

This sets up the hostage counter correct?

And then in some trigger or script:

rescuedHostages = rescuedHostages  + 1;
hint format ["Hostages rescued: %1/%2", rescuedHostages, hostages];

This could be used on the trigger which the hostages are in, because I have four triggers spread over a couple areas like I said all the playable units of the mission group need to do is step into the trigger and wait a couple seconds then the hostages will be added to that groups leader. Each trigger frees two captives.

Of course you could go a bit more advanced by counting them dynamically. Maybe if your hostages are civilian and there are no "normal" civies on the map you could try stuff like:

hostages = {(side _x) == civilian} count allUnits;

Or "store" your hostages in an array:

hostages = [h1, h2, h3, ...];
hostageCount = count hostages;

But there are probably way better ways.

If you want the task to have no destination then just pass nil and leave the marker references. There won't be any icon leading you to some point:

[player, "tReza", ["Capture or kill General Reza!", "Neutralize Gen. Reza", ""], nil, false, 1] call BIS_fnc_taskCreate;

With that dynamic counter civilian method I could make them FIA as I don't use that side for anything else. But now if I have the counter what can I do with the counter, let's say I wanted the the dynamic count to show as a hint as you collected the hostages. I know how to use hints but how I would display the current number of hostages that remain.

Thanks for the help thus far, I just want to make good missions that are worth playing :)

Edit

I ended up using the simple version, I may try the advanced later but I want to get this mission released soon so I just need the hints showing and that worked really well thanks.

Edited by ledhead900
Solved the hostage count!

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  

×