12-03-2014, 11:24 PM
(12-03-2014, 10:51 PM)ion link Wrote: thx for your reply. its an endtrigger or should it be. i want him to fire if all alive playable units reach the marked position. im realy new in scripting things, so im a little bit confused. on activation i set: "End1" call BIS_fnc_endMission; so i thought the condition should be that all alive players reached the marker which activate the trigger to end the mission.
The condition is fine, the problem is that thisList doesn't contain what you think. thisList does not contain everything that is in the trigger. It only contains what matches the trigger's activation condition, so you need to make sure that the playable units fit that. "Anybody" will always work, or otherwise use BLUFOR or OPFOR accordingly.
Quote:sry for my stupid questions but if i use your script how do i call the script from the condition? is it possible? or, im confused....
I usually either use it from an FSM, or from a script. At the end of init.sqf, I put something like this..
[] spawn {
  while {true} do {
    sleep 5;
    if (<condition to find out if the other tasks are finished>) then {
      _list = [endTriggerName, true] call FHQ_UnitsInTrigger;
      if (
        {_x in _list} count playableUnits == {alive _x} count playableUnits
      ) then {
        // Set the extraction task to true
        sleep 15;
        ["End1", "BIS_fnc_endMission, true] call BIS_fnc_MP;
      ];
    };
  };
};
Something of that nature, this will probably contain syntax errors. You need to use BIS_fnc_MP since the BIS_fnc_endMission must run on all of the clients.
Quote:what do you think, is such an ending a stupid idea or am i completly wrong. is there a more safe and easy way for ending a mission?
No, this is fine. This should work.
I don't need luck, I have ammo.