make debug box config based

lightPos: controls the positions of light props inside the box (uses
modelToWorld offset), set to {} to disable.
debugBoxClass: Controls the class that is used for the debug box, "" to
disable debug box.
cloneClasses: What classes to use for clone vat props, set to {} to
disable
This commit is contained in:
vbawol 2017-09-17 09:47:48 -05:00
parent 6387f32f8b
commit faf82b97b2
3 changed files with 45 additions and 31 deletions

View File

@ -13,7 +13,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_server/EPOCH_server_createTeleport.sqf https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_server/EPOCH_server_createTeleport.sqf
*/ */
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_array","_center","_class","_cloneClasses","_config","_deSimulate","_debug","_debug1","_debugLocation","_dir","_dir1","_dir2","_enterClass","_ep","_exitClass","_light","_lightLocation","_loadBaseTemplateConfig","_markerName","_part","_partPos","_pos","_pos1","_pro1","_pro2","_protection","_useWorldPos","_veh1","_veh2"]; private ["_array","_center","_class","_cloneClasses","_config","_configWorld","_deSimulate","_debug","_debug1","_debugBox","_debugLocation","_dir","_dir1","_dir2","_enterClass","_ep","_exitClass","_light","_lightLocation","_loadBaseTemplateConfig","_markerName","_part","_partPos","_pos","_pos1","_pro1","_pro2","_protection","_useWorldPos","_veh1","_veh2"];
//[[[end]]] //[[[end]]]
_loadBaseTemplateConfig = { _loadBaseTemplateConfig = {
private ["_partPos","_part","_array","_center","_deSimulate"]; private ["_partPos","_part","_array","_center","_deSimulate"];
@ -44,35 +44,40 @@ _loadBaseTemplateConfig = {
} forEach _array; } forEach _array;
}; };
_debugLocation = getMarkerPos "respawn_west"; // load map config
_debugLocation set[2, 0];
_debug = createVehicle["Debug_static_F", _debugLocation, [], 0, "CAN_COLLIDE"];
_debug setposATL _debugLocation;
_protection = createVehicle["ProtectionZone_Invisible_F", _debugLocation, [], 0, "CAN_COLLIDE"];
_protection setposATL _debugLocation;
_cloneClasses = ["clone_empty_static_F", "clone_male_static_F", "clone_female_static_F"];
for "_i" from 1 to 4 do {
_class = selectRandom _cloneClasses;
_debug1 = createVehicle[_class, (_debug modelToWorld(_debug selectionPosition(str _i))), [], 0, "CAN_COLLIDE"];
_debug1 setDir-90;
};
for "_i" from 5 to 8 do {
_class = selectRandom _cloneClasses;
_debug1 = createVehicle[_class, (_debug modelToWorld(_debug selectionPosition(str _i))), [], 0, "CAN_COLLIDE"];
_debug1 setDir 90;
};
// spawn lights
{
_lightLocation = _debug modelToWorld _x;
_light = createVehicle["Land_PortableLight_double_F", _lightLocation, [], 0, "CAN_COLLIDE"];
_light setDir (_debugLocation getDir _lightLocation);
_light setpos _lightLocation;
} forEach [[-16.623,-8.50195,-10.5417],[15.0352,-9.08594,-10.5417]];
_config = configFile >> "CfgEpoch"; _config = configFile >> "CfgEpoch";
_configWorld = _config >> worldname;
_debugBox = getArray(_configWorld >> "debugBoxClass"); // debugBoxClass = "" to disable
if !(_debugBox isEqualTo "") then {
_debugLocation = getMarkerPos "respawn_west";
_debugLocation set[2, 0];
_debug = createVehicle[_debugBox, _debugLocation, [], 0, "CAN_COLLIDE"];
_debug setposATL _debugLocation;
_protection = createVehicle["ProtectionZone_Invisible_F", _debugLocation, [], 0, "CAN_COLLIDE"];
_protection setposATL _debugLocation;
_cloneClasses = getArray(_configWorld >> "cloneClasses");
if !(_cloneClasses isEqualTo []) then {
for "_i" from 1 to 4 do {
_class = selectRandom _cloneClasses;
_debug1 = createVehicle[_class, (_debug modelToWorld(_debug selectionPosition(str _i))), [], 0, "CAN_COLLIDE"];
_debug1 setDir-90;
};
for "_i" from 5 to 8 do {
_class = selectRandom _cloneClasses;
_debug1 = createVehicle[_class, (_debug modelToWorld(_debug selectionPosition(str _i))), [], 0, "CAN_COLLIDE"];
_debug1 setDir 90;
};
};
// spawn lights
{
_lightLocation = _debug modelToWorld _x;
_light = createVehicle["Land_PortableLight_double_F", _lightLocation, [], 0, "CAN_COLLIDE"];
_light setDir (_debugLocation getDir _lightLocation);
_light setpos _lightLocation;
} forEach (getArray(_configWorld >> "lightPos"));
};
// spawn area props // spawn area props
{ {
@ -100,7 +105,7 @@ _config = configFile >> "CfgEpoch";
_ep enableSimulationGlobal false; _ep enableSimulationGlobal false;
}; };
} forEach(getArray(_config >> worldname >> "propsPos")); } forEach(getArray(_configWorld >> "propsPos"));
{ {
_enterClass = _x select 0; _enterClass = _x select 0;
@ -166,4 +171,4 @@ _config = configFile >> "CfgEpoch";
}; };
EPOCH_staticTraderLocations pushBack _pos; EPOCH_staticTraderLocations pushBack _pos;
} foreach (getArray(_config >> worldname >> "telePos")); } foreach (getArray(_configWorld >> "telePos"));

View File

@ -66,6 +66,12 @@ class CfgEpoch
traderUniforms[] = {"U_OG_leader", "U_C_Poloshirt_stripped", "U_C_Poloshirt_blue", "U_C_Poloshirt_burgundy", "U_C_Poloshirt_tricolour", "U_C_Poloshirt_salmon", "U_C_Poloshirt_redwhite", "U_C_Poor_1", "U_C_WorkerCoveralls", "U_C_Journalist", "U_C_Scientist", "U_OrestesBody"}; traderUniforms[] = {"U_OG_leader", "U_C_Poloshirt_stripped", "U_C_Poloshirt_blue", "U_C_Poloshirt_burgundy", "U_C_Poloshirt_tricolour", "U_C_Poloshirt_salmon", "U_C_Poloshirt_redwhite", "U_C_Poor_1", "U_C_WorkerCoveralls", "U_C_Journalist", "U_C_Scientist", "U_OrestesBody"};
containerPos[] = {}; containerPos[] = {};
telePos[] = {}; telePos[] = {};
lightPos[] = {
{-16.623,-8.50195,-10.5417},
{15.0352,-9.08594,-10.5417}
};
debugBoxClass = "Debug_static_F";
cloneClasses[] = {"clone_empty_static_F", "clone_male_static_F", "clone_female_static_F"};
propsPos[] = {}; propsPos[] = {};
staticNpcPos[] = {}; staticNpcPos[] = {};
forcedVehicleSpawnTable = ""; forcedVehicleSpawnTable = "";

View File

@ -34,6 +34,9 @@ class VR : Default
// W [-14.4316,0.112793,-10.3098] // W [-14.4316,0.112793,-10.3098]
{ "Transport_C_EPOCH", { -0.286865, 8.17383, -10.3098 }, "", { 4089.82, 4597.71, 0.00143433 } } { "Transport_C_EPOCH", { -0.286865, 8.17383, -10.3098 }, "", { 4089.82, 4597.71, 0.00143433 } }
}; };
lightPos[] = {};
debugBoxClass = "";
cloneClasses[] = {};
propsPos[] = {}; propsPos[] = {};
staticNpcPos[] = {}; staticNpcPos[] = {};
}; };