Jump to content
Sign in to follow this  
cobrosstuidos

Mission complete once all zones green using EOS?

Recommended Posts

So I just downloaded the EOS script (Enemy Occupation System, like Insurgency Mission) and have it within my mission. The furthest I've ever been with "Mission Complete" scripting is using the in-game triggers. But I don't think those will work with EOS since the AI's are spawned in. So now is when I got to put my big boy pants on and learn how to end missions via scripts.

Anyone got any ideas how to end a mission once all zones go "green"?

Share this post


Link to post
Share on other sites

You could simply check the colour of your markers.

If ((markerColor "Marker1" == "ColorGreen") && (markerColor "Marker2" == "ColorGreen")) then
{
    "end1" call BIS_fnc_endMission;
};

*not tested

Share this post


Link to post
Share on other sites
You could simply check the colour of your markers.

If ((markerColor "Marker1" == "ColorGreen") && (markerColor "Marker2" == "ColorGreen")) then
{
    "end1" call BIS_fnc_endMission;
};

*not tested

I'll test it. Where should it be put? the init?

Share this post


Link to post
Share on other sites

You could put it into a trigger.

However, if you want to put it into the init.sqf or a seperate sqf file you would need modifie it a little bit.

[] spawn = {
while {true} do
{
	if ((markerColor "Marker1" == "ColorGreen") && (markerColor "Marker2" == "ColorGreen")) then
	{
		 "end1" call BIS_fnc_endMission;
	};
               sleep 5; // checks if conditions are true every 5 seconds
}
};

*also not tested

Share this post


Link to post
Share on other sites
Just tried them both. Doesn't work :(

Any error message? Or just nothing? Was completely my fault, sorry for the inconvenience. I had a typo in the code.

[color="#FF8040"][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]spawn[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
[color="#191970"][b]scopeName[/b][/color] [color="#7A7A7A"]"endMission"[/color][color="#8B3E2F"][b];[/b][/color]
[color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
	[color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]markerColor[/b][/color] [color="#7A7A7A"]"Marker1"[/color] [color="#8B3E2F"][b]=[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"ColorGreen"[/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]&[/b][/color][color="#8B3E2F"][b]&[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]markerColor[/b][/color] [color="#7A7A7A"]"Marker2"[/color] [color="#8B3E2F"][b]=[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"ColorGreen"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color]
	[color="#8B3E2F"][b]{[/b][/color]
		 [color="#7A7A7A"]"end1"[/color] [color="#191970"][b]call[/b][/color] BIS_fnc_endMission[color="#8B3E2F"][b];[/b][/color]
		 [color="#191970"][b]breakOut[/b][/color] [color="#7A7A7A"]"endMission"[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
               [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]5[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// checks if conditions are true every 5 seconds[/i][/color]
[color="#8B3E2F"][b]}[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

I also added a breakOut command, without it, the script was looping even after bis_fnc_endMission was called, causing the mission to never end.

Edited by R3vo

Share this post


Link to post
Share on other sites
Any error message? Or just nothing? Was completely my fault, sorry for the inconvenience. I had a typo in the code.

[color="#FF8040"][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]spawn[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
[color="#191970"][b]scopeName[/b][/color] [color="#7A7A7A"]"endMission"[/color][color="#8B3E2F"][b];[/b][/color]
[color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
	[color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]markerColor[/b][/color] [color="#7A7A7A"]"Marker1"[/color] [color="#8B3E2F"][b]=[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"ColorGreen"[/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]&[/b][/color][color="#8B3E2F"][b]&[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]markerColor[/b][/color] [color="#7A7A7A"]"Marker2"[/color] [color="#8B3E2F"][b]=[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"ColorGreen"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color]
	[color="#8B3E2F"][b]{[/b][/color]
		 [color="#7A7A7A"]"end1"[/color] [color="#191970"][b]call[/b][/color] BIS_fnc_endMission[color="#8B3E2F"][b];[/b][/color]
		 [color="#191970"][b]breakOut[/b][/color] [color="#7A7A7A"]"endMission"[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
               [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]5[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// checks if conditions are true every 5 seconds[/i][/color]
[color="#8B3E2F"][b]}[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

I also added a breakOut command, without it, the script was looping even after bis_fnc_endMission was called, causing the mission to never end.

im going to give this a shot right now, thanks for the help so far. I really do appreciate it

EDIT: IT works!

Thanks man!

Edited by CoBrosStuidos

Share this post


Link to post
Share on other sites
im going to give this a shot right now, thanks for the help so far. I really do appreciate it

EDIT: IT works!

Thanks man!

I'm glad I could help.

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  

×