Jump to content
poodude28

Making a mission end when a empty vehicle is destroyed

Recommended Posts

Been trying to do this for hours, couldn't find anything so I could use some help here please. Essentially I have a landed empty plane and some Blufor guys will eventually get into it and if it gets destroyed or crashes when they are in it or out of it I need the mission to end. Thanks for any help guys. Also, I've never done a whole lot with variables and init etc if it has anything to do with that I need a decent explanation. I've been pretty decent with triggers and waypoints but this seems to go beyond my knowledge. Thanks.

 

 

Problem solved, but I have another question below if someone could please help with this one?

 

 

[EDIT] Got this to work, but does anybody know how to change text from Mission Successful to something that I type using this?

 

plane1 addEventHandler ["Killed", {"end1" call BIS_fnc_endMission;}];

Share this post


Link to post
Share on other sites

hey,

maybe you could use an  addEventHandler

in the planes Init write:

 

plane addEventHandler ["Killed", {"end1" call BIS_fnc_endMission;}];

Share this post


Link to post
Share on other sites
9 hours ago, Alert23 said:

hey,

maybe you could use an  addEventHandler

in the planes Init write:

 

plane addEventHandler ["Killed", {"end1" call BIS_fnc_endMission;}];

Thanks a lot that works! do you know of a way that I can change it from saying Mission Completed to something else? Like text that I would type into it.

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/Description.ext#CfgDebriefing

 

E.g. from a random mission of mine:

 

class CfgDebriefing
{  
	class End1
	{
		title = "Mission Completed";
		subtitle = "";
		description = "The warhead is safe thanks to your efforts. Well done.";
		pictureBackground ="overviewPicture_ca.paa";
		picture = __EVAL((__FILE__ select [0, count __FILE__ - 15]) + "GhostSkullS");
		pictureColor[] = {0,0,0,1};
	};
	class Fail
	{
		title = "Mission Failed";
		subtitle = "";
		description = "You have left the area.";
	};
};

 

Share this post


Link to post
Share on other sites
8 minutes ago, theend3r said:

https://community.bistudio.com/wiki/Description.ext#CfgDebriefing

 

E.g. from a random mission of mine:

 


class CfgDebriefing
{  
	class End1
	{
		title = "Mission Completed";
		subtitle = "";
		description = "The warhead is safe thanks to your efforts. Well done.";
		pictureBackground ="overviewPicture_ca.paa";
		picture = __EVAL((__FILE__ select [0, count __FILE__ - 15]) + "GhostSkullS");
		pictureColor[] = {0,0,0,1};
	};
	class Fail
	{
		title = "Mission Failed";
		subtitle = "";
		description = "You have left the area.";
	};
};

 

What do I do with that? Put it in the description.ext and change the description/title? I am going to need a better explanation :). Essentially I have a plane that gets destroyed, when the mission ends I want it to say something custom instead of Mission Successful so how would I go about doing that? Thanks.

Share this post


Link to post
Share on other sites
3 minutes ago, poodude28 said:

What do I do with that? Put it in the description.ext and change the description/title? I am going to need a better explanation :). Essentially I have a plane that gets destroyed, when the mission ends I want it to say something custom instead of Mission Successful so how would I go about doing that? Thanks.

I kinda intentionally don't go into detail because people will gain more by learning to read the wiki and the existing hundreds of threads than by getting stuff handed to them.

 

But yes, you just put it into description.ext, change the title and call the class name with BIS_fnc_endMission.

Share this post


Link to post
Share on other sites
31 minutes ago, theend3r said:

I kinda intentionally don't go into detail because people will gain more by learning to read the wiki and the existing hundreds of threads than by getting stuff handed to them.

 

But yes, you just put it into description.ext, change the title and call the class name with BIS_fnc_endMission.

Ok thanks for your help I got that to work but the text cuts off. Is there a way of fixing that? I also need to change the music when that pops up if possible?

Edited by poodude28
Edited because I figured something out and needed help with another thing.

Share this post


Link to post
Share on other sites
15 minutes ago, poodude28 said:

So in the description.ext for example if I have named a plane plane1 in the editor,  I go to the description.ext and change  (class end1) to class plane1?

You said that you use

plane1 addEventHandler ["Killed", {"end1" call BIS_fnc_endMission;}]; 

where end1 is the class name of the debriefing that you are calling with BIS_fnc_endMission.

 

In your case you'd do

// in mission

plane1 addEventHandler ["Killed", {"PlaneDestroyed" call BIS_fnc_endMission;}]; 

// in description.cfg

class CfgDebriefing
{  
	class PlaneDestroyed
	{
		title = "The plane got destroyed!";
		subtitle = "";
		description = "The plane got shot down, mission failed.";
	};
};

But really, you would know this if you read the frickin wiki.

 

Also note that using Killed EH may not be the best because it might get just damaged and land somewhere and your missions gets broken. It'd be better to check for damage.

Share this post


Link to post
Share on other sites
Just now, theend3r said:

You said that you use


plane1 addEventHandler ["Killed", {"end1" call BIS_fnc_endMission;}]; 

where end1 is the class name of the debriefing that you are calling with BIS_fnc_endMission.

 

In your case you'd do


// in mission

plane1 addEventHandler ["Killed", {"PlaneDestroyed" call BIS_fnc_endMission;}]; 

// in description.cfg

class CfgDebriefing
{  
	class PlaneDestroyed
	{
		title = "The plane got destroyed!";
		subtitle = "";
		description = "The plane got shot down, mission failed.";
	};
};

But really, you would know this if you read the frickin wiki.

No need to be rude...I just typed that I figured that out but I need help with something else that I replied to you with.

Share this post


Link to post
Share on other sites
2 minutes ago, poodude28 said:

No need to be rude...I just typed that I figured that out but I need help with something else that I replied to you with.

I used "frickin" to try to sound not too serious about that. Sorry, I'm not the best when it comes to communication.

 

Added something about another potential problem to my previous post.

Share this post


Link to post
Share on other sites
1 minute ago, theend3r said:

I used "frickin" to try to sound not too serious about that. Sorry, I'm not the best when it comes to communication.

That's fine, now I feel like a prick lol. Do you know how to do what I asked above? (Stop the text from being cut off, or changing the music when that mission debriefing pop-up happens.)

Share this post


Link to post
Share on other sites

Unfortunately I don't think you can play the music simply by editing the class. Playing a music with playMusic after "plane1 addEventHandler ["Killed", {"PlaneDestroyed" call BIS_fnc_endMission;}];" might work, at least I know I got it to work somehow in one of my missions but I'm not sure where I have it in the pile of them.

 

Text getting cut off... didn't happen to me. Do you use some very large text for that? Failure screens shouldn't really need that unless you're making a campaign where you can fail something and continue on.

 

It's better to make a radio call in game after said event happens and explain to the player directly like that, like a call from HQ how you messed up and then show a simple game over screen.

Share this post


Link to post
Share on other sites
1 minute ago, theend3r said:

Unfortunately I don't think you can play the music simply by editing the class. Playing a music with playMusic after "plane1 addEventHandler ["Killed", {"PlaneDestroyed" call BIS_fnc_endMission;}];" might work, at least I know I got it to work somehow in one of my missions but I'm not sure where I have it in the pile of them.

 

Text getting cut off... didn't happen to me. Do you use some very large text for that? Failure screens shouldn't really need that unless you're making a campaign where you can fail something and continue on.

 

It's better to make a radio call in game after said event happens and explain to the player directly like that, like a call from HQ how you messed up and then show a simple game over screen.

class CfgDebriefing
{  
    class End1
    {
        title = "There was nothing that could be done.";
        subtitle = "";
        description = "There was nothing that could be done.";
        
    };
    class Fail
    {
        title = "There was nothing that could be done.";
        subtitle = "";
        description = "There was nothing that could be done.";
    };
};

 

That's what I made mine look like, when the object is destroyed in game and it ends and the text shows in the middle it's cut off. Any ideas?

Share this post


Link to post
Share on other sites
1 minute ago, poodude28 said:

class CfgDebriefing
{  
    class End1
    {
        title = "There was nothing that could be done.";
        subtitle = "";
        description = "There was nothing that could be done.";
        
    };
    class Fail
    {
        title = "There was nothing that could be done.";
        subtitle = "";
        description = "There was nothing that could be done.";
    };
};

 

That's what I made mine look like, when the object is destroyed in game and it ends and the text shows in the middle it's cut off. Any ideas?

No idea, sorry. I can't even check it now since I'm on my work laptop. Also it seems like the subtitle is not really needed. Also no need to have 2 identical endings.

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

×