Tweaks to missin extraction tools: see description

Added a function to set mission center at player position. This is the recommended method for defining the center.

Fixed an error when pulling map marker information

Fixed an error that added a coma before the open bracket of some parameters.
This commit is contained in:
Chris Cardozo 2019-02-07 22:42:38 -05:00
parent 35b881fead
commit 6ae1e6d969
4 changed files with 51 additions and 36 deletions

View File

@ -1,3 +1,4 @@
player addAction["Pull MARKER Info","pullMarkerInfo.sqf"];
player addAction["Set Mission Center @ Player Pos","setCenterAtPlayer.sqf"];
player addAction["Pull DYNAMIC mission","pullDynamicMission.sqf"];

View File

@ -100,14 +100,15 @@ diag_log "========== <START> ==========================";
// Define the coordinates of the center of the mission.
///////////////////
CENTER = [0,0,0];
if (isNil "CENTER") then {CENTER isEqualTo [0,0,0]};
if (isNil "CENTER" || CENTER isEqualTo [0,0,0]) then
if (CENTER isEqualTo [0,0,0]) then
{
hint "Please define a center point for your mission";
hint parseText "Please define a center point for your mission,br/>Using position of nearest flashing road cone as the center";
_obj = allMissionObjects objectAtMissionCenter;
_obj1 = _obj select 0;
diag_log format["Determining position of first roadcone found which is located at %1 with player found at %2",getPos _obj1,position Player];
systemChat format["Setting Mission Center at That of Nearest Road Cone"];
if (count _obj > 0) then
{
CENTER = [3,3,0] vectorAdd (getPosATL _obj1);
@ -199,7 +200,6 @@ systemChat _logging;
//diag_log format["_cb = %1%2",endl,_cb];
_configuredStatics = [];
_configuredStaticsPositions = [];
_configuredUnits = [];
/*
This bit will set up the garrison for each building having units and / or statics inside it or on top.
@ -223,7 +223,7 @@ _fn_configureGarrisonForBuildingATL = {
if (_b isEqualTo _building) then
{
_configuredStatics pushBackUnique _x;
//_configuredStaticsPositions pushBack (getPosATL _x) vectorDiff CENTER;
if (_staticsText isEqualTo "") then
{
_staticsText = format['["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff (getPosATL _b),getDir _x];
@ -262,7 +262,7 @@ _fn_configureGarrisonForBuildingATL = {
_buildingGarrisonATL
};
private _count = 0;
_counter = 0;
_cb = _cb + "_garrisonedBuilding_ATLsystem = [";
{
private _isInside = [_x] call _fn_isInside;
@ -272,28 +272,29 @@ _cb = _cb + "_garrisonedBuilding_ATLsystem = [";
private _include = if ( !(_building in _garrisonedBuildings) && !((typeOf _building) isEqualTo unitMarkerObject) && !((typeOf _building) isEqualTo garrisonMarkerObject)) then {true} else {false};
if (_include) then
{
//diag_log format["_x = %1 | _building = %1",_x,_building];
diag_log format["_x = %1 | _building = %1",_x,_building];
systemChat format["_x = %1 | _building = %1",_x,_building];
private _buildingGarrisonInformation = [_building] call _fn_configureGarrisonForBuildingATL;
//diag_log format["_buildingGarrisonInformation = %1",_buildingGarrisonInformation];
if (_count == 0) then
if (_counter == 0) then
{
_cb = _cb + format["%1%2",endl,_buildingGarrisonInformation];
} else {
_cb = _cb + format[",%1%2",endl,_buildingGarrisonInformation];
};
_count = _count + 1;
_counter = _counter + 1;
};
};
} forEach ((allMissionObjects "StaticWeapon") + (allMissionObjects "Man") + (allMissionObjects unitMarkerObject));
} forEach ((allMissionObjects "StaticWeapon") + (allMissionObjects unitMarkerObject));
_cb = _cb + format["%1];%1%1",endl];
uiSleep 10;
///////////////////
// Configure info remaining mission landscape
///////////////////
_counter = 0;
_land = allMissionObjects "Static";
_cb = _cb + format["_missionLandscape = [",endl];
{
diag_log format["evaluating mission landscape: _x = %1 | typeOf _x = %1",_x, typeOf _x];
@ -301,14 +302,14 @@ _cb = _cb + format["_missionLandscape = [",endl];
if !(_x in _garrisonedBuildings && !((typeOf _x) isEqualTo unitMarkerObject) && !((typeOf _x) isEqualTo garrisonMarkerObject)) then
{
_line = format[' ["%1",%2,%3,%4,%5]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x, 'true','true'];
systemChat _line;
if (_forEachIndex == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_counter = _counter + 1;
};
}forEach allMissionObjects "Static";
_cb = _cb + format["%1];%1%1",endl];
@ -316,16 +317,18 @@ _cb = _cb + format["%1];%1%1",endl];
///////////////////
// Configure loot boxes
///////////////////
_counter = 0;
_cb = _cb + "_missionLootBoxes = [";
{
_line = format[' ["%1",%2,%3,%4,%5]',typeOf _x,(getPosATL _x) vectorDiff CENTER, '_crateLoot','_lootCounts',getDir _x];
systemChat _line;
if (_forEachIndex == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_counter = _counter + 1;
}forEach ((allMissionObjects "ReammoBox") + (allMissionObjects "ReammoBox_F"));
_cb = _cb + format["%1];%1%1",endl];
@ -336,6 +339,7 @@ _missionLootVehicles = [];
_missionVehicles = ((allMissionObjects "Car") + (allMissionObjects "Tank") + allMissionObjects "Ship");
_lootVehicleMarkers = allMissionObjects lootVehicleMarker;
diag_log format["_lootVehicleMarkers = %1",_lootVehicleMarkers];
_counter = 0;
_cb = _cb + format["_missionLootVehicles = ["];
{
_kindOf = "nothing";
@ -351,12 +355,13 @@ _cb = _cb + format["_missionLootVehicles = ["];
_missionLootVehicles pushBack _object;
_line = format[' ["%1",%2,%3,%4,%5]',typeOf _object,(getPosATL _x) vectorDiff CENTER, '_crateLoot','_lootCounts',getDir _x];
systemChat _line;
if (_forEachIndex == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_counter = _counter + 1;
};
} forEach allMissionObjects lootVehicleMarker;
_cb = _cb + format["%1];%1%1",endl];
@ -364,34 +369,38 @@ _cb = _cb + format["%1];%1%1",endl];
///////////////////
// Setup Info for vehicle patrols
///////////////////
_counter = 0;
_cb = _cb + format["_missionPatrolVehicles = ["];
{
if ( !((typeOf _x) isKindOf "SDV_01_base_F") && !(_x in _missionLootVehicles) ) then
{
_line = format[' ["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x];
systemChat _line;
if (_forEachIndex == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_counter = _counter + 1;
};
}forEach ((allMissionObjects "Car") + (allMissionObjects "Tank") + allMissionObjects "Ship");
_cb = _cb + format["%1];%1%1",endl];
_counter = 0;
_cb = _cb + "_submarinePatrolParameters = [";
{
if ((typeOf _x) isKindOf "SDV_01_base_F") then
{
_line = format[' ["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x];
systemChat _line;
if (_forEachIndex == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_counter= _counter + 1;
};
}forEach allMissionObjects "Ship";
_cb = _cb + format["%1];%1%1",endl];
@ -399,49 +408,49 @@ _cb = _cb + format["%1];%1%1",endl];
///////////////////
// Configs for Air Patrols
///////////////////
_counter = 0;
_cb = _cb + "_airPatrols = [";
//[selectRandom _aircraftTypes,[22830.2,16618.1,11.4549],"blue",1000,60]
{
_line = format[' ["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x, 'true','true'];
systemChat _line;
if (_forEachIndex == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
_counter = _counter + 1;
}forEach allMissionObjects "Air";
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Setup info for remaining static/emplaced weapons
///////////////////
_count = 0;
_counter = 0;
_cb = _cb + format["_missionEmplacedWeapons = ["];
{
//if !(_x in _configuredStatics) then
private _isInside = [_x] call _fn_isInside;
if !(_isInside) then
{
if !(_x in _configuredStatics) then
{
// ["B_HMG_01_high_F",[22883.5,16757.6,6.31652],"blue",0,10]
_line = format[' ["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x, 'true','true'];
systemChat _line;
if (_count == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_count = _count + 1;
_counter = _counter + 1;
};
}forEach allMissionObjects "StaticWeapon";
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Setup information for infantry groups spawning outside buildings
///////////////////
_counter = 0;
_cb = _cb + format["_missionGroups = ["];
{
//[[22920.4,16887.3,3.19144],"red",[1,2], 75,120],
@ -454,20 +463,22 @@ _cb = _cb + format["_missionGroups = ["];
{
_line = format[' [%1,%2,%3,"%4",%5,%6]',(getPosATL _x) vectorDiff CENTER,minAI,maxAI,aiDifficulty,minPatrolRadius,maxPatrolRadius];
systemChat _line;
if (_forEachIndex == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_counter = _counter + 1;
};
};
}forEach allMissionObjects "Man";
_cb = _cb + format["%1];%1%1",endl];
_counter = 0;
_cb = _cb + "_scubaGroupParameters = [";
{
//[[22920.4,16887.3,3.19144],"red",[1,2], 75,120],
//[[22920.4,16887.3,3.19144],"red",[1,2], 75,120],
_isInside = [_x] call _fn_isInside;
_isInfantry = [_x] call _fn_isInfantry;
//diag_log format["_missionGroups: _unit %1 | _isInside %2 _isInfantry %3",_x,_isInside,_isInfantry];
@ -477,12 +488,13 @@ _cb = _cb + "_scubaGroupParameters = [";
{
_line = format[' [%1,%2,%3,"%4",%5,%6]',(getPosATL _x) vectorDiff CENTER,minAI,maxAI,aiDifficulty,minPatrolRadius,maxPatrolRadius];
systemChat _line;
if (_forEachIndex == 0) then
if (_counter == 0 && !(_line isEqualTo "")) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_counter = _counter + 1;
};
};
}forEach allMissionObjects "Man";

View File

@ -28,9 +28,11 @@ if (count _allmkr == 0) then
diag_log format["_mk = %1",_mk];
systemChat format["marker shape = %1",markerShape _mk];
systemChat format["marker type = %1",markerType _mk];
systemChat format["marker size = %1",markerSize _mk];
systemChat format["markerColor = %1",markerColor _mk];
systemChat format["marker brush = %1",markerBrush _mk];
//systemChat
switch (markerShape _mk) do
switch (toUpper(markerShape _mk)) do
{
case "ELLIPSE": {
_cb = _cb + format['_markerType = ["%1",%2,"%3"];%4',toUpper(MarkerShape _mk),getMarkerSize _mk,toUpper(markerBrush _mk),endl];
@ -39,13 +41,12 @@ if (count _allmkr == 0) then
_cb = _cb + format['_markerType = ["%1",%2,"%3"];%4',toUpper(MarkerShape _mk),getMarkerSize _mk,toUpper(markerBrush _mk),endl];
};
case "ICON": {
_cb = _cb + format['_markerType = ["%1",[0,0]];%2',getMarkerType _mk,endl];
_cb = _cb + format['_markerType = ["%1"];%2',getMarkerType _mk,endl];
};
};
_cb = _cb + format['_markerColor = "%1";%2',markerColor _mk,endl];
_cb = _cb + format['_markerMissionName = "%1";%2',MarkerText _mk,endl];
_cb = _cb + format['_markerLabel = "%1";%2',"",endl];
_cb = _cb + format['_markerLabel = "%1";%2',MarkerText _mk,endl];
_cb = _cb + format["%1%1",endl];
};

View File

@ -0,0 +1 @@
CENTER = getPos player;