mirror of
https://github.com/rambo/arma3_missions.git
synced 2024-08-30 16:52:13 +00:00
spawning pickup tasks works now
This commit is contained in:
parent
8b96a3a024
commit
dd9557416d
@ -1,29 +1,29 @@
|
||||
diag_log format["createEnemySquad called, _this: %1", _this];
|
||||
_centrePos = _this select 0;
|
||||
_includeAA = this select 1;
|
||||
private _centrePos = _this select 0;
|
||||
private _includeAA = _this select 1;
|
||||
|
||||
_centreX = _centrePos select 0;
|
||||
_centrePos set [0, _centreX + 100 + (floor random 300)];
|
||||
// Some variance
|
||||
private _centreCoords = getPos _centrePos;
|
||||
_centreCoords set [0, ((_centreCoords select 0) + 100 + (floor random 300))];
|
||||
_centreCoords set [1, ((_centreCoords select 1) + 100 + (floor random 300))];
|
||||
|
||||
_position = _centrePos findEmptyPosition [0,100];
|
||||
private _enemyPosition = _centreCoords findEmptyPosition [0,100];
|
||||
|
||||
// TODO: check if we want to create multiple enemy squads
|
||||
|
||||
_groupEnemy = createGroup east;
|
||||
"O_Soldier_F" createUnit [_position, _groupEnemy,"",0.6, "CORPORAL"];
|
||||
"O_Soldier_F" createUnit [_position, _groupEnemy,"",0.1, "PRIVATE"];
|
||||
"O_soldier_M_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_AR_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_M_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_AR_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_M_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_AR_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_M_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_AR_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
private _groupEnemy = createGroup east;
|
||||
"O_Soldier_F" createUnit [_enemyPosition, _groupEnemy,"",0.6, "CORPORAL"];
|
||||
"O_Soldier_F" createUnit [_enemyPosition, _groupEnemy,"",0.1, "PRIVATE"];
|
||||
"O_soldier_M_F" createUnit [_enemyPosition, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_AR_F" createUnit [_enemyPosition, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_M_F" createUnit [_enemyPosition, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_AR_F" createUnit [_enemyPosition, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_M_F" createUnit [_enemyPosition, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_AR_F" createUnit [_enemyPosition, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_M_F" createUnit [_enemyPosition, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"O_soldier_AR_F" createUnit [_enemyPosition, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
|
||||
if (_includeAA) then
|
||||
{
|
||||
"O_soldier_AA_F" createUnit [_position, _groupEnemy,"",0.75, "CORPORAL"];
|
||||
"O_soldier_AA_F" createUnit [_enemyPosition, _groupEnemy,"",0.75, "CORPORAL"];
|
||||
};
|
||||
|
||||
[_groupEnemy]
|
@ -1,9 +1,9 @@
|
||||
diag_log format["createSquad called, _this: %1", _this];
|
||||
_spawnPos = _this select 0;
|
||||
private _spawnPos = _this select 0;
|
||||
|
||||
_groupTaxi = createGroup west;
|
||||
private _groupTaxi = createGroup west;
|
||||
"B_Soldier_F" createUnit [_spawnPos, _groupTaxi,"",0.6, "CORPORAL"];
|
||||
"B_soldier_AR_F" createUnit [_position, _groupEnemy,"",0.3, "PRIVATE"];
|
||||
"B_soldier_AR_F" createUnit [_spawnPos, _groupTaxi,"",0.3, "PRIVATE"];
|
||||
"B_Soldier_F" createUnit [_spawnPos, _groupTaxi,"",0.5, "PRIVATE"];
|
||||
"B_Soldier_F" createUnit [_spawnPos, _groupTaxi,"",0.5, "PRIVATE"];
|
||||
"B_Soldier_F" createUnit [_spawnPos, _groupTaxi,"",0.5, "PRIVATE"];
|
||||
|
13
helotraining_rewrite.Altis/getSideActiveTasks.sqf
Normal file
13
helotraining_rewrite.Altis/getSideActiveTasks.sqf
Normal file
@ -0,0 +1,13 @@
|
||||
diag_log format["getSideActiveTasks called, _this: %1", _this];
|
||||
private _side = _this select 0;
|
||||
private _returnValue = [];
|
||||
|
||||
{
|
||||
if (!(_x call BIS_fnc_taskCompleted)) then
|
||||
{
|
||||
_returnValue = _returnValue + [_x];
|
||||
};
|
||||
} forEach ([_side] call getSideTasks);
|
||||
|
||||
diag_log format["getSideActiveTasks returning: %1", _returnValue];
|
||||
_returnValue
|
@ -14,6 +14,7 @@ deleteSquads = compile preProcessfile "deleteSquads.sqf";
|
||||
playerVehicleInList = compile preProcessfile "playerVehicleInList.sqf";
|
||||
playerVehicleInListBool = compile preProcessfile "playerVehicleInListBool.sqf";
|
||||
getSideTasks = compile preProcessfile "getSideTasks.sqf";
|
||||
getSideActiveTasks = compile preProcessfile "getSideActiveTasks.sqf";
|
||||
|
||||
|
||||
execVM "briefing.sqf";
|
||||
|
@ -4,12 +4,12 @@ while {true} do
|
||||
{
|
||||
scopeName "mainloop";
|
||||
private _justPlayers = (call BIS_fnc_listPlayers) - entities "HeadlessClient_F";
|
||||
_result = [([west] call getSideTasks), {_this call BIS_fnc_taskCompleted}] call CBA_fnc_reject;
|
||||
diag_log format["taskSpawner: active tasks: %1 players: ", (count _result), (count _justPlayers)];
|
||||
while {count _result != count _justPlayers} do
|
||||
diag_log format["taskSpawner: active tasks: %1 players: %2", (count ([west] call getSideActiveTasks)), (count _justPlayers)];
|
||||
while {count ([west] call getSideActiveTasks) < count _justPlayers} do
|
||||
{
|
||||
scopename "spawnloop";
|
||||
private _newLZLocation = lzList call BIS_fnc_SelectRandom;
|
||||
private _plrAssigned = false;
|
||||
{
|
||||
scopename "playerloop";
|
||||
private _plr = _x;
|
||||
@ -17,10 +17,16 @@ while {true} do
|
||||
if (count (_plr call BIS_fnc_tasksUnit) == 0) then
|
||||
{
|
||||
[_newLZLocation, [_plr]] spawn createPickupLZ;
|
||||
_plrAssigned = true;
|
||||
breakTo "spawnloop";
|
||||
};
|
||||
} forEach _justPlayers;
|
||||
[_newLZLocation, false] spawn createPickupLZ;
|
||||
if (!_plrAssigned) then
|
||||
{
|
||||
[_newLZLocation, false] spawn createPickupLZ;
|
||||
};
|
||||
// rate limit
|
||||
sleep 1;
|
||||
};
|
||||
sleep 10;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user