Hi Cold,
yay, worked nice, eh?
I thought about what you said there, the thing with the hostage just running off and getting shot and all. You could either smuggle a "setcaptive" command in there:
_trg setTriggerStatements ["this", format ["[%1] join (thislist select 0); %1 setcaptive true;", _x], ""];
But this would be a little unfair, because no enemy unit would ever shoot at the hostage. Rather unrealistic, eh?
Or, you could indeed add a "Free hostage"-action to each hostage. That way, just like in real life, you, the liberator, decide when it's time for the hostage to join you. Problem here: the rescue team leader HAS TO be human, as A.I. soldiers execute actions only when ordered by humans. But this mission is made for an MP environment anyway, so why not give it a try.
Replace the old line in your "init.sqf" with this:
{[_x, 0, 0, ["0"]] execvm "hostage.sqf"; sleep 0.1;} foreach [hostage_1, hostage_2, hostage_3];
And put this into "hostage.sqf":
_hostage = _this select 0;
_liberator = _this select 1;
_action = _this select 2;
_selections = _this select 3;
_selection = _selections select 0;
switch (_selection) do
{
case "0":
{
_trg = createTrigger ["EmptyDetector", getpos _hostage];
_trg setTriggerArea [2, 2, 0, false];
_trg setTriggerActivation ["west", "present", true];
_trg setTriggerStatements ["this", format ["freeman = %1 addaction [""Free hostage"", ""hostage.sqf"", [""1""], 100]", _hostage], format ["%1 removeaction freeman", _hostage]];
_trg attachto [_hostage];
};
case "1":
{
[_hostage] join (_liberator);
_hostage removeaction _action;
deletevehicle _trg;
};
default {};
};
DISCLAIMER! This one is only tested in the editor, but should work fine, too. I'll leave all testing to you this time.
Good night,
mr_book