make lz distance configurable, sanity-check loop, make pilots helipilots

This commit is contained in:
Eero af Heurlin
2016-07-31 19:47:03 +03:00
parent 6d85e86d5c
commit 66efdc582e
5 changed files with 39 additions and 19 deletions

View File

@ -105,13 +105,14 @@ while {true} do
if (triggerActivated _trg) then
{
diag_log format["createPickupLZ: triggedred, loading up %1", _squad];
// TODO: Filter the list so that locations near currently active tasks are not considered
private _newLZLocation = [[_lzLocation]] call selectLZ;
private _veh = [list _trg] call playerVehicleInList;
private _handle = [_veh, _squad, _taskid] spawn loadSquad;
waitUntil {isNull _handle};
// TODO check that the return value is not false (could not choose LZ due to constraints)
private _newLZLocation = [[_lzLocation]] call selectLZ;
private _handle = [_newLZLocation, _veh, _squad, _taskid] spawn createDropoffLZ;
waitUntil {isNull _handle};
breakOut "mainloop";

View File

@ -30,8 +30,8 @@ class Params
{
//paramsArray[1]
title = "LZ Size (land within X meters of center)";
values[] = {15, 25, 50, 100, 150, 200,300,400,500,600,700,800,900,1000};
texts[] = {"15m", "25m", "50m", "100m", "150m", "200m","300m","400m","500m","600m","700m","800m","900m","1000m"};
values[] = {15, 25, 50, 100, 150, 200,300};
texts[] = {"15m", "25m", "50m", "100m", "150m", "200m","300m"};
default = 100;
};
@ -61,5 +61,14 @@ class Params
texts[] = {"None", "Low", "Medium", "High", "Kill Me"};
default = 10;
};
class LZMinDistace
{
//paramsArray[5]
title = "LZ min distance from other active missions";
values[] = {1000,1500,2000,5000,10000};
texts[] = {"1 km", "1.5 km", "2 km", "5 km", "10 km"};
default = 1000;
};
};

View File

@ -8,7 +8,7 @@ class EditorData
toggles=513;
class ItemIDProvider
{
nextID=177;
nextID=183;
};
class MarkerIDProvider
{
@ -2511,7 +2511,7 @@ class Mission
class PositionInfo
{
position[]={14314.04,17.971205,16001.183};
angles[]={0.0013439035,5.3116474,6.2818413};
angles[]={0.0013439034,5.3116469,6.2818408};
};
side="West";
flags=6;
@ -2524,8 +2524,8 @@ class Mission
isPlayer=1;
isPlayable=1;
};
id=11;
type="B_Pilot_F";
id=177;
type="B_Helipilot_F";
class CustomAttributes
{
class Attribute0
@ -2572,7 +2572,7 @@ class Mission
"STRING"
};
};
value="Air 1-1";
value="Alpha 1-1";
};
};
};
@ -2910,8 +2910,8 @@ class Mission
name="player2";
isPlayable=1;
};
id=170;
type="B_Pilot_F";
id=178;
type="B_Helipilot_F";
class CustomAttributes
{
class Attribute0
@ -2958,7 +2958,7 @@ class Mission
"STRING"
};
};
value="Air 2-1";
value="Alpha 2-1";
};
};
};
@ -2990,8 +2990,8 @@ class Mission
name="player3";
isPlayable=1;
};
id=174;
type="B_Pilot_F";
id=179;
type="B_Helipilot_F";
class CustomAttributes
{
class Attribute0
@ -3038,7 +3038,7 @@ class Mission
"STRING"
};
};
value="Air 3-1";
value="Alpha 3-1";
};
};
};
@ -3070,8 +3070,8 @@ class Mission
name="player4";
isPlayable=1;
};
id=176;
type="B_Pilot_F";
id=180;
type="B_Helipilot_F";
class CustomAttributes
{
class Attribute0
@ -3118,7 +3118,7 @@ class Mission
"STRING"
};
};
value="Air 4-1";
value="Alpha 4-1";
};
};
};

View File

@ -35,3 +35,6 @@ while {_x < LZCOUNT} do
[lzList, (missionNamespace getVariable (format["lz%1", _x + 1]))] call BIS_fnc_arrayPush;
_x = _x + 1;
};
LZMinDistace = paramsArray select 5;
publicVariable "LZMinDistace";

View File

@ -13,6 +13,7 @@ private _taskLocations = [];
} forEach ([west] call getSideActiveTasks);
scopeName "main";
private _i = 0;
while {true} do
{
scopeName "selectloop";
@ -21,7 +22,7 @@ while {true} do
{
scopeName "checkloop";
private _dist = _candidate distance _x;
if (_dist < (4*lzSize)) then
if (_dist < LZMinDistace) then
{
_usable = false;
breakOut "checkloop";
@ -32,6 +33,12 @@ while {true} do
_returnValue = _candidate;
breakOut "selectloop";
};
_i = _i + 1;
if (_i > LZCOUNT) then
{
_returnValue = false;
breakOut "selectloop";
}
};
//diag_log format["selectLZ returning: %1", _returnValue];