Fixed issues with export of simple objects

This commit is contained in:
Chris Cardozo
2020-09-21 21:58:48 -04:00
parent f937d9987f
commit 4878bccd0b
7 changed files with 58 additions and 210 deletions

View File

@ -1,34 +0,0 @@
#define oddsOfGarrison 0.67
#define maxGarrisonStatics 3
#define maxGarrisonUnits 4
#define typesGarrisonStatics [] // When empty a static will be randomly chosen from the defaults for blckeagls
#define garrisonMarkerObject "Sign_Sphere100cm_F" // This can be anything you like. I find this large sphere easy to see and convenient.
#define unitMarkerObject "Sign_Arrow_Direction_Green_F" // This can be anything. I chose this arrow type because it allows you to easily indicate direction.
_helpers = allMissionObjects garrisonMarkerObject;
//diag_log format["_helpers = %1",_helpers];
{
if ( (typeOf _x) isEqualTo garrisonMarkerObject) then
{
private _isInside = [_x] call _fn_isInside;
if (_isInside) then
{
_building = [_x] call _fn_buildingContainer;
blck_garrisonedBuildings pushbackunique _building;
blck_garrisonedBuildings pushbackunique _x;
// data structure ["building Classname",[/*building pos*/],/*building dir*/,/*odds of garrison*/, /*Max Statics*/,/*types statics*/,/*max units*/],
// 1 2 3 4 5 6 7 8 9
_line = format[' ["%1",%2,%3,%4,%5,%6,%7,%8,%9]',typeOf _building,(getPosATL _building) vectorDiff CENTER,getDir _building, 'true','true',oddsOfGarrison,maxGarrisonStatics,typesGarrisonStatics,maxGarrisonUnits];
systemChat _line;
//diag_log _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
};
} forEach _helpers;

View File

@ -50,13 +50,16 @@ _unitsText joinString _lineBreak;
if !((_staticsText isEqualTo []) && (_unitsText isEqualTo [])) then
{
private _allowDamage = (_building get3DENAttribute "allowDamage") select 0;
private _enableSimulation = (_building get3DENAttribute "enableSimulation") select 0;
diag_log format["_configureGarrisonATL: _building %1 | damage %2 | simulation %3",_allowDamage,_enableSimulation];
_buildingGarrisonATL = [
format["%1",
typeOf _building],
(getPosATL _building) vectorDiff _center,
getDir _building,
true,
true,
_allowDamage,
_enableSimulation,
_staticsText,
_unitsText
];

View File

@ -1,148 +1,11 @@
/*
Dynamic Mission Generated
Using 3DEN Plugin for blckeagls
dynamicMission.sqf generated:: blckeagls 3DEN Plugin Version 0 : Build 5 : Build Date 09/19/20
By Ghostrider-GRG-
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
#include "\q\addons\custom_server\Missions\privateVars.sqf";
_defaultMissionLocations = [];
_markerType = ["ELLIPSE",[250,250],"SOLID"];
_markerColor = "COLORRED";
_startMsg = "TODO: Change approiately";
_endMsg = "TODO: Change Appropriately";
_markerMissionName = "TODO: Update appropriately";
_crateLoot = blck_BoxLoot_Blue;
_lootCounts = blck_lootCountsBlue;
_garrisonedBuildings_BuildingPosnSystem = [
];
_garrisonedBuilding_ATLsystem = [
["Land_Cargo_Patrol_V3_F",[0,0,0],45,true,true,[["O_GMG_01_high_F",[0.533447,-1.45142,4.34404],229.902]],[]],
["Land_Cargo_Patrol_V3_F",[0,0,0],90,true,true,[["O_GMG_01_high_F",[-0.669434,-1.43628,4.34404],272.772]],[]],
["Land_Cargo_HQ_V3_F",[0,0,0],269.183,true,true,[["O_Mortar_01_F",[4.13428,-1.79297,3.12652],0]],[[[-1.19116,2.72095,3.12796],0]]],
["Land_Cargo_Patrol_V3_F",[0,0,0],179.749,true,true,[["O_GMG_01_high_F",[-1.22046,0.542969,4.34404],0]],[]]
];
_missionLandscape = [
["Land_HBarrier_Big_F",[-1.98413,-1.92993,-4.76837e-007],45,true,true],
["Land_HBarrier_Big_F",[3.98779,-7.51294,-4.76837e-007],45,true,true],
["Land_HBarrier_Big_F",[-7.52954,12.9387,-4.76837e-007],270,true,true],
["Land_HBarrier_Big_F",[-7.65234,21.4033,-4.76837e-007],90,true,true],
["Land_HBarrier_5_F",[24.321,15.1624,-4.76837e-007],270,true,true],
["Land_HBarrier_Big_F",[25.2722,-3.87012,-4.76837e-007],328.551,true,true],
["Land_HBarrier_Big_F",[20.9385,18.7275,-4.76837e-007],180,true,true],
["Land_HBarrier_Big_F",[18.2209,-8.25903,-4.76837e-007],330,true,true],
["Land_HBarrier_Big_F",[10.5823,-10.2063,-4.76837e-007],0,true,true],
["Land_HBarrier_Big_F",[34.0476,6.36035,-4.76837e-007],299.181,true,true],
["Land_Cargo_House_V3_F",[11.125,-4.1167,-4.76837e-007],180,true,true],
["Land_Cargo_House_V3_F",[33.6809,29.3313,-4.76837e-007],90.6682,true,true],
["Land_HBarrier_Big_F",[17.3999,23.9451,-4.76837e-007],90,true,true],
["Land_HBarrier_Big_F",[3.64941,26.885,-4.76837e-007],0,true,true],
["Land_HBarrier_Big_F",[29.6377,37.4236,-4.76837e-007],225,true,true],
["Land_HBarrier_Big_F",[12.1257,27.1333,-4.76837e-007],1.36604e-005,true,true],
["Land_HBarrier_Big_F",[36.0908,34.8279,-4.76837e-007],0,true,true],
["Land_HBarrier_Big_F",[22.8857,39.9236,-4.76837e-007],180,true,true],
["Land_HBarrier_Big_F",[37.969,13.8748,-4.76837e-007],299.181,true,true],
["Land_HBarrier_Big_F",[39.5908,21.3279,-4.76837e-007],270,true,true],
["Land_HBarrier_Big_F",[39.4658,29.7029,-4.76837e-007],90,true,true],
["Land_HBarrier_Big_F",[-4.69336,26.6685,-4.76837e-007],0,true,true],
["Land_HBarrier_Big_F",[14.4446,39.6458,-4.76837e-007],180,true,true],
["Land_HBarrier_5_F",[16.6345,47.3489,-4.76837e-007],180.149,true,true],
["Land_HBarrier_5_F",[11.1445,47.3962,-4.76837e-007],180.149,true,true],
["Land_HBarrier_5_F",[18.7251,43.8938,-4.76837e-007],269.822,true,true],
["Land_HBarrier_5_F",[7.49487,45.4861,-4.76837e-007],124.084,true,true],
["Land_Cargo_House_V3_F",[33.5195,22.5332,-4.76837e-007],90.6682,true,true],
["Land_HBarrier_Big_F",[-6.20093,4.80859,-4.76837e-007],75.8618,true,true],
["RoadCone_L_F",[9.69141,6.51465,-4.76837e-007],0,true,true],
["Land_Cargo40_military_green_F",[-3.2334,35.5225,-4.76837e-007],45.5098,true,true],
["Land_Cargo20_grey_F",[-7.22656,32.293,-4.76837e-007],44.3033,true,true],
["Land_Cargo20_grey_F",[-13.3616,30.4897,-4.76837e-007],0,true,true],
["Land_Cargo20_grey_F",[26.2278,-12.2869,-4.76837e-007],6.20739,true,true],
["Land_Cargo20_grey_F",[39.1899,4.03271,-4.76837e-007],272.936,true,true],
["Land_Canteen_F",[36.6631,46.6692,-4.76837e-007],0,true,true],
["Land_PaperBox_01_open_boxes_F",[30.7021,49.6111,-4.76837e-007],0,true,true]
];
_simpleObjects = [
];
_missionLootVehicles = [
];
_missionPatrolVehicles = [
["O_LSV_02_armed_F",[24.1306,-41.168,0],87.1292,75,75],
["O_LSV_02_armed_F",[12.8894,74.8223,-4.76837e-007],87.7224,75,75]
];
_submarinePatrolParameters = [
];
_airPatrols = [
];
_missionEmplacedWeapons = [
["O_HMG_01_high_F",[9.55957,44.0073,-4.76837e-007],0],
["O_HMG_01_high_F",[21.7991,15.363,-4.76837e-007],0]
];
_missionGroups = [
[[16.9512,1.75757,0.00143862],3,6,"Blue",30,45],
[[8.01904,18.9385,3.12796],3,6,"Blue",30,45],
[[23.6782,30.5142,0.00143862],3,6,"Blue",30,45],
[[30.0935,9.90186,0.00143862],3,6,"Blue",30,45],
[[-0.340576,10.3516,0.00143862],3,6,"Blue",30,45]
];
_scubaGroupParameters = [
];
_missionLootBoxes = [
["Land_Pallet_MilBoxes_F",[-3.88013,11.6785,-4.76837e-007],_crateLoot,_lootCounts,0]
];
/*
Use the parameters below to customize your mission - see the template or blck_configs.sqf for details about each them
*/
_chanceHeliPatrol = blck_chanceHeliPatrolBlue;
_noChoppers = blck_noPatrolHelisBlue;
_missionHelis = blck_patrolHelisBlue;
_chancePara = blck_chanceParaBlue;
_noPara = blck_noParaBlue;
_paraTriggerDistance = 400;
_paraSkill = 'Blue';
_chanceLoot = 0.0;
_paraLoot = blck_BoxLoot_Blue;
_paraLootCounts = blck_lootCountsBlue;
_missionLandscapeMode = "precise";
_uniforms = blck_SkinList;
_headgear = blck_headgear;
_vests = blck_vests;
_backpacks = blck_backpacks;
_sideArms = blck_Pistols;
_spawnCratesTiming = "atMissionSpawnGround";
_loadCratesTiming = "atMissionSpawn";
_endCondition = "allKilledOrPlayerNear";
_minNoAI = blck_MinAI_Blue;
_maxNoAI = blck_MaxAI_Blue;
_noAIGroups = blck_AIGrps_Blue;
_noVehiclePatrols = blck_SpawnVeh_Blue;
_noEmplacedWeapons = blck_SpawnEmplaced_Blue;
_minNoAI = blck_MinAI_Blue;
_maxNoAI = blck_MaxAI_Blue;
_noAIGroups = blck_AIGrps_Blue;
_noVehiclePatrols = blck_SpawnVeh_Blue;
_noEmplacedWeapons = blck_SpawnEmplaced_Blue;
#include "\q\addons\custom_server\Compiles\Missions\GMS_fnc_missionSpawner.sqf";
all3DENEntities params ["_objects"];
{
diag_log format [
"classname %1 | position %2 | direction %3 | isSimple = %4",
(_x get3DENAttribute "ItemClass") select 0,
(_x get3DENAttribute "position") select 0,
((_x get3DENAttribute "rotation") select 0) select 2,
(_x get3DENAttribute "objectIsSimple") select 0
];
} forEach _objects;

View File

@ -67,8 +67,8 @@ if (isNil "blck_missionEndCondition") then
Look for an object defined in CfgBlck3DEN \ configs \ that marks the center of the mission
and set the coords of the center if such an object is found
*/
private _centerMarkers = allMissionObjects objectAtMissionCenter;
all3DENEntities params ["_objects","_groups","_triggers","_systems","_waypoints","_markers","_layers","_comments"];
private _centerMarkers = _objects select {(typeOf _x) isEqualTo objectAtMissionCenter};
diag_log format["_centerMarkers = %1",_centerMarkers];
if !(_centerMarkers isEqualTo []) then
{
@ -79,13 +79,6 @@ if !(_centerMarkers isEqualTo []) then
diag_log format["Place such an object or a marker to ensure the mission is accurately stored and spawned"];
};
all3DENEntities params ["_objects","_groups","_triggers","_systems","_waypoints","_markers","_layers","_comments"];
private _units = [];
{
{
if (vehicle _x isEqualTo _x) then {_units pushBack _x};
} forEach (units _x);
} forEach _groups;
private["_m1","_markerPos","_markerType","_markerShape","_markerColor","_markerText","_markerBrush","_markerSize","_markerAlpha"];
/*
@ -141,7 +134,7 @@ private _garisonedStatics = [];
private _garisonedUnits = [];
private _landscape = _objects select{
!(isSimpleObject _x) &&
!((_x get3DENAttribute "objectIsSimple") select 0) &&
((typeOf _x) isKindOf "Static" || ( (typeOf _x) isKindOf "ThingX")) &&
!((typeOf _x) isKindOf "ReammoBox_F") &&
!(_x getVariable["isLootContainer",false]) &&
@ -149,22 +142,24 @@ private _landscape = _objects select{
};
private _garisonedPos = [];
diag_log format["_exportDynamic (174): count _landscape = %1",count _landscape];
diag_log format["_exportDynamic (152): count _landscape = %1",count _landscape];
for "_i" from 1 to (count _landscape) do
{
if (isNull _building) exitWith {};
private _building = _landscape deleteAt 0;
diag_log format ["_garrisonedPos: evaluating _building %1 | ;garrisoned = %2'",_building,_building getVariable["garrisoned",false]];
if (_building getVariable["garrisoned",false]) then
{
_garisonedPos pushBack format[' ["%1",%2,%3,%4,%5,%6,%7,%8,%9]',typeOf _building,(getPosATL _building) vectorDiff CENTER,getDir _building, 'true','true',oddsOfGarrison,maxGarrisonStatics,typesGarrisonStatics,maxGarrisonUnits];
private _allowDamage = (_building get3DENAttribute "allowDamage") select 0;
private _enableSimulation = (_building get3DENAttribute "enableSimulation") select 0;
diag_log format["_exportDynamic-garisonedPos: _building %1 | damage %2 | simulation %3",_building,_allowDamage,_enableSimulation];
_garisonedPos pushBack format[' ["%1",%2,%3,%4,%5,%6,%7,%8,%9]',typeOf _building,(getPosATL _building) vectorDiff CENTER,getDir _building,_allowDamage,_enableSimulation,oddsOfGarrison,maxGarrisonStatics,typesGarrisonStatics,maxGarrisonUnits];
} else {
_landscape pushBack _building;
};
};
private _garrisonATL = [];
diag_log format["_exportDynamic (169): count _landscape = %1",count _landscape];
for "_i" from 1 to (count _landscape) do
{
if (isNull _building) exitWith {};
@ -179,25 +174,34 @@ for "_i" from 1 to (count _landscape) do
_garisonedUnits append (_atl select 2);
};
};
diag_log format["_garrisonATL = %1",_garrisonATL];
diag_log format["_garrisonATL = %1",_garrisonATL];
diag_log format["_exportDynamic (185): count _landscape = %1",count _landscape];
private _missionLandscape = [];
for "_i" from 1 to (count _landscape) do
{
private _building = _landscape deleteAt 0;
if (isNull _building) exitWith {};
diag_log format["typeOf _x = %1 | _x isMarker = %2",typeOf _building,_building getVariable["marker",false]];
if !(_building getVariable["marker",false]) then
{
_missionLandscape pushBack format[' ["%1",%2,%3,%4,%5]',typeOf _building,(getPosATL _building) vectorDiff CENTER,getDir _building, 'true','true'];
private _allowDamage = (_building get3DENAttribute "allowDamage") select 0;
private _enableSimulation = (_building get3DENAttribute "enableSimulation") select 0;
diag_log format["typeOf _x = %1 | damage = %2 | simulation = %3",typeOf _building,_allowDamage,_enableSimulatoin];
_missionLandscape pushBack format[' ["%1",%2,%3,%4,%5]',typeOf _building,(getPosATL _building) vectorDiff CENTER,getDir _building, _allowDamage,_enableSimulation];
};
};
private _simpleObjects = _objects select {isSimpleObject _x};
private _simpleObjects = _objects select {(_x get3DENAttribute "objectIsSimple") select 0};
diag_log format["_simpleObjects = %1",_simpleObjects];
private _missionSimpleObjects = [];
{
_missionSimpleObjects pushBack format[' ["%1",%2,%3,%4,%5]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x, 'true','true'];
private _object = format[' ["%1",%2,%3]',
(_x get3DENAttribute "ItemClass") select 0,
((_x get3DENAttribute "position") select 0) vectorDiff CENTER,
((_x get3DENAttribute "rotation") select 0) select 2
];
diag_log format["_object = %1",_object];
_missionSimpleObjects pushBack _object;
} forEach _simpleObjects;
private _missionLootVehicles = [];
@ -258,6 +262,12 @@ private _infantry = _units select {
};
diag_log format["_garisonedUnits = %1",_garisonedUnits];
diag_log format["_infantry = %1",_infantry];
private _units = [];
{
{
if (vehicle _x isEqualTo _x) then {_units pushBack _x};
} forEach (units _x);
} forEach _groups;
_infantryGroups = [];
{
_infantryGroups pushBack format[' [%1,%2,%3,"%4",%5,%6]',(getPosATL _x) vectorDiff CENTER,blck_minAI,blck_maxAI,blck_MissionDifficulty,minPatrolRadius,maxPatrolRadius];
@ -322,7 +332,7 @@ _lines pushback (_missionLandscape joinString (format [",%1", _lineBreak]));
_lines pushBack "];";
_lines pushBack "";
_lines pushBack "_simpleObjects = [";
_lines pushback (_simpleObjects joinString (format [",%1", _lineBreak]));
_lines pushback (_missionSimpleObjects joinString (format [",%1", _lineBreak]));
_lines pushBack "];";
_lines pushBack "";
_lines pushBack "_missionLootVehicles = [";

View File

@ -116,7 +116,7 @@ private _garisonedStatics = [];
private _garisonedUnits = [];
private _landscape = _objects select{
!(isSimpleObject _x) &&
!((_x get3DENAttribute "objectIsSimple") select 0) &&
((typeOf _x) isKindOf "Static") &&
!((typeOf _x) isKindOf "Helper")
};
@ -124,14 +124,20 @@ private _landscape = _objects select{
diag_log format["CENTER = %1 | _landscape = %2","ignored",_landscape];
private _missionLandscape = [];
{
_missionLandscape pushBack format[' ["%1",%2,%3,%4]',typeOf _x,(getPosATL _x),[vectorDir _x,vectorUp _x], [true,true]];
private _allowDamage = (_x get3DENAttribute "allowDamage") select 0;
private _enableSimulation = (_x get3DENAttribute "enableSimulation") select 0;
_missionLandscape pushBack format[' ["%1",%2,%3,%4]',typeOf _x,(getPosATL _x),[vectorDir _x,vectorUp _x], [_allowDamage,_enableSimulation]];
}forEach _landscape;
private _simpleObjects = _objects select {isSimpleObject _x};
private _simpleObjects = _objects select {(_x get3DENAttribute "objectIsSimple") select 0};
diag_log format["_simpleObjects = %1",_simpleObjects];
private _missionSimpleObjects = [];
{
_missionSimpleObjects pushBack format[' ["%1",%2,%3,%4,%5]',typeOf _x,(getPosATL _x),[vectorDir _x,vectorUp _x], 'true','true'];
_missionSimpleObjects pushBack format[' ["%1",%2,%3]',
(_x get3DENAttribute "ItemClass") select 0,
((_x get3DENAttribute "position") select 0),
((_x get3DENAttribute "rotation") select 0) select 2
];
} forEach _simpleObjects;
private _missionLootVehicles = [];
@ -247,7 +253,7 @@ _lines pushback (_missionLandscape joinString (format [",%1", _lineBreak]));
_lines pushBack "];";
_lines pushBack "";
_lines pushBack "_simpleObjects = [";
_lines pushback (_simpleObjects joinString (format [",%1", _lineBreak]));
_lines pushback (_missionSimpleObjects joinString (format [",%1", _lineBreak]));
_lines pushBack "];";
_lines pushBack "";
_lines pushBack "_missionLootVehicles = [";

View File

@ -52,8 +52,8 @@ class CfgBlck3DEN
class CfgVersion
{
version = 1.0;
build = 5;
date = "09/19/20";
build = 7;
date = "09/21/20";
};
};