mirror of
https://github.com/rambo/arma3_missions.git
synced 2024-08-30 16:52:13 +00:00
fix lz landing trigger for MP
This commit is contained in:
parent
ad0533ea2c
commit
ad471edf9e
@ -17,20 +17,21 @@ _lzLoc = (_lzLocs - [_prevLZ]) call BIS_fnc_SelectRandom;
|
||||
|
||||
|
||||
_taskid = format["p%1_lz%2", _playerno, _lzLoc];
|
||||
[west,[_taskid],[format["Player %2: Fly to and land within %1m of the LZ", lzSize, _playerno], format["p%1 LZ", _playerno], "LZ"],(getPos _lzLoc),"CREATED",1,true, "move", true] call BIS_fnc_taskCreate;
|
||||
[[_player, west],[_taskid],[format["Player %2: Fly to and land within %1m of the LZ", lzSize, _playerno], format["p%1 LZ", _playerno], "LZ"],(getPos _lzLoc),"AUTOASSIGNED",1,true, "move", true] call BIS_fnc_taskCreate;
|
||||
taskIdsArray set [_playerno, _taskid];
|
||||
|
||||
|
||||
_trg = createTrigger["EmptyDetector",getPos _lzLoc];
|
||||
_trg = createTrigger["EmptyDetector",getPos _lzLoc, true];
|
||||
_trg setTriggerArea[lzSize,lzSize,0,false];
|
||||
_trg setTriggerActivation["WEST","PRESENT",false];
|
||||
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
|
||||
_trgcond = "{ _plr = _x; _veh = vehicle _plr; if ((_plr != _veh) && (_veh in thisList) && (isTouchingGround _veh)) then { True } } forEach playableUnits; False;";
|
||||
_trgaction = format["null = [thisTrigger, '%2', (playersArray select %1), %3, %4, %1] execVM 'landingComplete.sqf'", _playerno, _taskid, _lzLoc, _lzLocs];
|
||||
_trgcond = "[thisList] call lzlanded";
|
||||
diag_log format["LZ trigger condition: %1", _trgcond];
|
||||
diag_log format["LZ trigger action: %1", _trgaction];
|
||||
_trg setTriggerStatements[_trgcond, _trgaction, ""];
|
||||
_trg setTriggerStatements[_trgcond, _trgaction, ""];
|
||||
|
||||
// TODO: delete the trigger when deleting the task on player death or similar
|
||||
|
||||
null = [(getPos _lzLoc), (playersArray select _playerno), _playerno] execVM 'createSquad.sqf';
|
||||
|
||||
|
@ -4,7 +4,7 @@ disabledAI=1;
|
||||
debriefing=1;
|
||||
showGPS=1;
|
||||
Respawn = 3;
|
||||
RespawnDelay = 12;
|
||||
RespawnDelay = 8;
|
||||
RespawnDialog = 0;
|
||||
enabledebugconsole = 1;
|
||||
loadScreen = "main.jpg";
|
||||
|
@ -1,3 +1,6 @@
|
||||
lzLanded = compile preProcessfile "lzlanded.sqf";
|
||||
|
||||
|
||||
null = execVM "briefing.sqf";
|
||||
_maxplayers = 4;
|
||||
_lzCount = 86;
|
||||
|
14
helotraining.Altis/lzlanded.sqf
Normal file
14
helotraining.Altis/lzlanded.sqf
Normal file
@ -0,0 +1,14 @@
|
||||
_triggerList = _this select 0;
|
||||
_returnValue = false;
|
||||
|
||||
{
|
||||
_plr = _x;
|
||||
_veh = vehicle _plr;
|
||||
systemChat format["_plr: %1 _veh: %2 (isTouchingGround _veh): %3 _triggerList: %4", _plr, _veh, (isTouchingGround _veh), _triggerList];
|
||||
if ( (_plr != _veh) && (isTouchingGround _veh) && (_veh in _triggerList) ) then
|
||||
{
|
||||
_returnValue = true;
|
||||
}
|
||||
} forEach playableUnits;
|
||||
|
||||
_returnValue
|
Loading…
Reference in New Issue
Block a user