Jump to content
Sign in to follow this  

Recommended Posts

Hi, I would like my mission to end after a specified amount of time. I found this info to add to the xmt

titleParam1 = "Time limit:";
valuesParam1[] = {10000, 300, 600, 900, 1200, 1500, 1800, 2100, 3600, 7200};
defValueParam1 = 1800;
textsParam1[] = {"Unlimited", "5 min", "10 min", "15 min", "20 min", "25 min",
"30 min", "35 min", "60 min", "120 min", };

Problem is... the mission doesn't end.

I added this trigger but it still doesnt work.

th_endmissiontrigger.jpg

Can someone help me? My skill level is NOOB.

Share this post


Link to post
Share on other sites

Can you post the contents of your trigger in text? (I can't view your pic due to web filter)

Share this post


Link to post
Share on other sites

why don't you put the desired time in the countdown time space?

Where you have:

Min: 0, Mid: 0, Max: 0, change the 0 with the desired time.

Share this post


Link to post
Share on other sites
Can you post the contents of your trigger in text? (I can't view your pic due to web filter)

would you be referring to this? from the mission?

class Item2
	{
		position[]={6642.3584,320.76923,7987.8462};
		a=10;
		b=10;
		timeoutMin=300;
		timeoutMid=300;
		timeoutMax=300;
		interruptable=1;
		age="UNKNOWN";
		name="TimeEnd";
		expCond="(param1 < 10000) and (time>=param1)";
		expActiv="EndOfMission=true";
		class Effects
		{
		};
	};

---------- Post added at 09:49 PM ---------- Previous post was at 09:34 PM ----------

why don't you put the desired time in the countdown time space?

Where you have:

Min: 0, Mid: 0, Max: 0, change the 0 with the desired time.

I entered 300 in min, mid and max and under preview the mission didnt end in 5minutes. I tried it in preview and switched it over to multiplayer. the mission did not end.

Edited by SpecterM

Share this post


Link to post
Share on other sites

I'm not sure if this will help or do anything but I found it in one of the BIS SP missions.

if ((time > (3 * 3600)) && !BIS_timeUp) then {BIS_timeUp = true};

I'm wondering if this can go into a trigger somehow or how to use it in the init.sqf, if possible. In the mission Freedom Fighters its in data/scripts/winConditions.sqf and seems to control a 3 hour time limit. I changed the 3 to a 10 to make the mission end after 10 hrs not 3. I haven't played around with it in my own missions but was intrigued by it.

Share this post


Link to post
Share on other sites

Could put the following in your init.sqf, or any other script.

_timeLanded = time;
_minsWait = 10; //Minutes to wait before continue
waituntil {((time - _timeLanded) > (60 * _minsWait) )};
endMission "END1"; //or whatever type of ending you want, i.e. loser.

Edited by Rocket

Share this post


Link to post
Share on other sites

a trigger with

condition : time > param1 && param1 < 10000

activation : endmission "end1"

or another possible solution :

type : end1

condition : time > param1 && param1 < 10000

activation : forceEnd

another one is to write in a init.sqf file in mission folder:

if (param1 < 10000) then
{
   [] spawn
   {
       while (time < param1) do {sleep 1};
       endmission "end1";
   };
};

yet another one in init.sqf file :

_trig = createTrigger ["emptydetector", [0, 0]];
_trig setTriggerArea [0, 0, 0, false];
_trig setTriggerTimeout [param1, param1, param1, false];
_trig setTriggerType "end1";
_trig setTriggerActivation ["any", "present", false];
_trig setTriggerStatements ["true", "forceEnd", ""];

and all the other combinations ... :-)

Edited by d3nn16

Share this post


Link to post
Share on other sites
I entered 300 in min, mid and max and under preview the mission didnt end in 5minutes. I tried it in preview and switched it over to multiplayer. the mission did not end.

At least in ArmA1 it work properly.

Add that time in the respective place like you mentioned, then execute a script with something similar to this code and adding the following Game Logic (in pic).

  • End1.sqs code:
END1 = true;
~1
publicVariable "END1"
~1 
exit

  • Game Logic for END1:
end1_s.jpg

  • introend1.sqs
fin1 = true
PublicVariable "fin1"
exit

ps- i might miss some details.. Open some missions and check how its done.

Share this post


Link to post
Share on other sites

Remember, there is a new command in ArmA2 called EndMission

And I have found that waitUntil offers better performance what while..do loops.

Share this post


Link to post
Share on other sites

What worked for me is simply setting the trigger type to lose, set condition to true, make it countdown, and put the 300 in min, mid and max. May not be the most elegant way but it worked when I tried it.

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  

×