mirror of
https://github.com/rambo/arma3_missions.git
synced 2024-08-30 16:52:13 +00:00
refactor getting alive players to function, refactor array inserts
This commit is contained in:
parent
42b41662f5
commit
a984aa6203
@ -9,6 +9,7 @@ _centreCoords set [1, ((_centreCoords select 1) + 100 + (floor random 300))];
|
|||||||
|
|
||||||
private _enemyPosition = _centreCoords findEmptyPosition [0,100];
|
private _enemyPosition = _centreCoords findEmptyPosition [0,100];
|
||||||
|
|
||||||
|
// TODO: use some preconfigured fireteam setup
|
||||||
private _groupEnemy = createGroup east;
|
private _groupEnemy = createGroup east;
|
||||||
"O_Soldier_F" createUnit [_enemyPosition, _groupEnemy,"",0.6, "CORPORAL"];
|
"O_Soldier_F" createUnit [_enemyPosition, _groupEnemy,"",0.6, "CORPORAL"];
|
||||||
"O_Soldier_F" createUnit [_enemyPosition, _groupEnemy,"",0.1, "PRIVATE"];
|
"O_Soldier_F" createUnit [_enemyPosition, _groupEnemy,"",0.1, "PRIVATE"];
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//diag_log format["createSquad called, _this: %1", _this];
|
//diag_log format["createSquad called, _this: %1", _this];
|
||||||
private _spawnPos = _this select 0;
|
private _spawnPos = _this select 0;
|
||||||
|
|
||||||
|
// TODO: use some preconfigured fireteam setup
|
||||||
private _groupTaxi = createGroup west;
|
private _groupTaxi = createGroup west;
|
||||||
"B_Soldier_F" createUnit [_spawnPos, _groupTaxi,"",0.6, "CORPORAL"];
|
"B_Soldier_F" createUnit [_spawnPos, _groupTaxi,"",0.6, "CORPORAL"];
|
||||||
"B_soldier_AR_F" createUnit [_spawnPos, _groupTaxi,"",0.3, "PRIVATE"];
|
"B_soldier_AR_F" createUnit [_spawnPos, _groupTaxi,"",0.3, "PRIVATE"];
|
||||||
|
@ -29,10 +29,10 @@ class Params
|
|||||||
class LZSize
|
class LZSize
|
||||||
{
|
{
|
||||||
//paramsArray[1]
|
//paramsArray[1]
|
||||||
title = "LZ Size";
|
title = "LZ Size (land within X meters of center)";
|
||||||
values[] = {100,200,300,400,500,600,700,800,900,1000};
|
values[] = {15, 25, 50, 100, 150, 200,300,400,500,600,700,800,900,1000};
|
||||||
texts[] = {"100m","200m","300m","400m","500m","600m","700m","800m","900m","1000m"};
|
texts[] = {"15m", "25m", "50m", "100m", "150m", "200m","300m","400m","500m","600m","700m","800m","900m","1000m"};
|
||||||
default = 300;
|
default = 100;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SmokeSetting
|
class SmokeSetting
|
||||||
|
11
helotraining_mp.Altis/getAlivePlayers.sqf
Normal file
11
helotraining_mp.Altis/getAlivePlayers.sqf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
private _returnValue = [];
|
||||||
|
|
||||||
|
private _justPlayers = (call BIS_fnc_listPlayers) - entities "HeadlessClient_F";
|
||||||
|
{
|
||||||
|
if (alive _x) then
|
||||||
|
{
|
||||||
|
[_returnValue, _x] call BIS_fnc_arrayPush;
|
||||||
|
};
|
||||||
|
} forEach _justPlayers;
|
||||||
|
|
||||||
|
_returnValue
|
@ -5,7 +5,7 @@ private _returnValue = [];
|
|||||||
{
|
{
|
||||||
if (!(_x call BIS_fnc_taskCompleted)) then
|
if (!(_x call BIS_fnc_taskCompleted)) then
|
||||||
{
|
{
|
||||||
_returnValue = _returnValue + [_x];
|
[_returnValue, _x] call BIS_fnc_arrayPush;
|
||||||
};
|
};
|
||||||
} forEach ([_side] call getSideTasks);
|
} forEach ([_side] call getSideTasks);
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
// TODO: Rename this function, since it checks for the landing status too
|
||||||
//diag_log format["playerVehicleInList called, _this: %1", _this];
|
//diag_log format["playerVehicleInList called, _this: %1", _this];
|
||||||
private _triggerList = _this select 0;
|
private _triggerList = _this select 0;
|
||||||
private _returnValue = false;
|
private _returnValue = false;
|
||||||
|
|
||||||
private _justPlayers = (call BIS_fnc_listPlayers) - entities "HeadlessClient_F";
|
|
||||||
scopeName "main";
|
scopeName "main";
|
||||||
{
|
{
|
||||||
private _plr = _x;
|
private _plr = _x;
|
||||||
@ -12,7 +12,7 @@ scopeName "main";
|
|||||||
_returnValue = _veh;
|
_returnValue = _veh;
|
||||||
breakTo "main";
|
breakTo "main";
|
||||||
}
|
}
|
||||||
} forEach _justPlayers;
|
} forEach ([] call getAlivePlayers);
|
||||||
|
|
||||||
//diag_log format["playerVehicleInList returning: %1", _returnValue];
|
//diag_log format["playerVehicleInList returning: %1", _returnValue];
|
||||||
_returnValue
|
_returnValue
|
@ -15,6 +15,7 @@ getSideTasks = compileFinal preProcessfile "getSideTasks.sqf";
|
|||||||
getSideActiveTasks = compileFinal preProcessfile "getSideActiveTasks.sqf";
|
getSideActiveTasks = compileFinal preProcessfile "getSideActiveTasks.sqf";
|
||||||
isLanded = compileFinal preProcessfile "isLanded.sqf";
|
isLanded = compileFinal preProcessfile "isLanded.sqf";
|
||||||
selectLZ = compileFinal preProcessfile "selectLZ.sqf";
|
selectLZ = compileFinal preProcessfile "selectLZ.sqf";
|
||||||
|
getAlivePlayers = compileFinal preProcessfile "getAlivePlayers.sqf";
|
||||||
|
|
||||||
taskSpawner = compileFinal preProcessfile "taskSpawner.sqf";
|
taskSpawner = compileFinal preProcessfile "taskSpawner.sqf";
|
||||||
xenoRepair = compileFinal preProcessfile "xenoRepair.sqf";
|
xenoRepair = compileFinal preProcessfile "xenoRepair.sqf";
|
||||||
|
@ -32,7 +32,6 @@ lzList = [];
|
|||||||
_x = 0;
|
_x = 0;
|
||||||
while {_x < LZCOUNT} do
|
while {_x < LZCOUNT} do
|
||||||
{
|
{
|
||||||
_lz = missionNamespace getVariable ("lz" + format["%1", _x + 1]);
|
[lzList, (missionNamespace getVariable (format["lz%1", _x + 1]))] call BIS_fnc_arrayPush;
|
||||||
lzList = lzList + [_lz];
|
|
||||||
_x = _x + 1;
|
_x = _x + 1;
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,7 @@ if (!(_excludeList isEqualTo false)) then
|
|||||||
};
|
};
|
||||||
private _taskLocations = [];
|
private _taskLocations = [];
|
||||||
{
|
{
|
||||||
_taskLocations = _taskLocations + [([_x] call BIS_fnc_taskDestination)];
|
[_taskLocations, ([_x] call BIS_fnc_taskDestination)] call BIS_fnc_arrayPush;
|
||||||
} forEach ([west] call getSideActiveTasks);
|
} forEach ([west] call getSideActiveTasks);
|
||||||
|
|
||||||
scopeName "main";
|
scopeName "main";
|
||||||
|
@ -8,19 +8,11 @@ scopeName "main";
|
|||||||
while {true} do
|
while {true} do
|
||||||
{
|
{
|
||||||
scopeName "mainloop";
|
scopeName "mainloop";
|
||||||
private _justPlayers = (call BIS_fnc_listPlayers) - entities "HeadlessClient_F";
|
private _alivePlayers = [] call getAlivePlayers;
|
||||||
private _alivePlayers = [];
|
|
||||||
{
|
|
||||||
if (alive _x) then
|
|
||||||
{
|
|
||||||
_alivePlayers = _alivePlayers + [_x];
|
|
||||||
};
|
|
||||||
} forEach _justPlayers;
|
|
||||||
while {count ([west] call getSideActiveTasks) < count _alivePlayers} do
|
while {count ([west] call getSideActiveTasks) < count _alivePlayers} do
|
||||||
{
|
{
|
||||||
scopename "spawnloop";
|
scopename "spawnloop";
|
||||||
diag_log format["taskSpawner: active tasks: %1 players: %2", (count ([west] call getSideActiveTasks)), (count _alivePlayers)];
|
diag_log format["taskSpawner: active tasks: %1 players: %2", (count ([west] call getSideActiveTasks)), (count _alivePlayers)];
|
||||||
// TODO: Filter the list so that locations near currently active tasks are not considered
|
|
||||||
private _newLZLocation = [_lzexclude] call selectLZ;
|
private _newLZLocation = [_lzexclude] call selectLZ;
|
||||||
private _plrAssigned = false;
|
private _plrAssigned = false;
|
||||||
if (_tryAssignPlr) then
|
if (_tryAssignPlr) then
|
||||||
|
Loading…
Reference in New Issue
Block a user