Skip to content

Commit

Permalink
Tweak sandboxes (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Freddo3000 authored Jul 2, 2020
1 parent 0042f66 commit d618509
Show file tree
Hide file tree
Showing 44 changed files with 8,240 additions and 307,656 deletions.
8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_01.Altis/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_02.Stratis/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_03.Malden/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_04.Tanoa/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_05.Enoch/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_06.VR/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_07.Chernarus/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_08.Chernarus_Summer/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_09.Chernarus_Winter/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_10.CUP_Chernarus_A3/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_11.Woodland_ACR/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_12.Bootcamp_ACR/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_13.Utes/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_14.Takistan/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_15.Zargabad/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_16.Mountains_ACR/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_17.ProvingGrounds_PMC/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_18.Shapur_BAF/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_19.Desert_E/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_20.Sara/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_21.Sara_DBE1/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_22.SaraLite/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_23.Porto/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_24.Intro/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_25.pja307/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_26.WL_Rosche/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_27.FDF_Isle1_a/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_28.Bozcaada/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_29.Tembelan/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_30.tem_kujari/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_31.tem_summa/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_32.Ruha/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_33.tem_vinjesvingenc/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_34.pulau/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_35.Thirsk/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_36.ThirskW/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_37.fata/mission.sqm

Large diffs are not rendered by default.

8,095 changes: 1 addition & 8,094 deletions addons/sandbox/MPMissions/arc_sandbox_38.tem_anizay/mission.sqm

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions addons/sandbox/XEH_clientPostInit.sqf
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "script_component.hpp"
[{!isNil "BIS_fnc_init" && {time > 0.1} && {!([] call BIS_fnc_isLoading)}},{
["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups;

{
[_x,[west,east,resistance]] call BIS_fnc_drawCuratorRespawnMarkers;
[_x] call BIS_fnc_drawCuratorLocations;
[player] call BIS_fnc_drawCuratorDeaths;
} forEach allCurators;

}] call CBA_fnc_waitUntilAndExecute;
96 changes: 19 additions & 77 deletions addons/sandbox/XEH_serverPostInit.sqf
Original file line number Diff line number Diff line change
@@ -1,84 +1,26 @@
#include "script_component.hpp"
[{!isNil "BIS_fnc_init" && time > 0.1},{

private _startPoses = [];

// Find suitable respawn positions
for "_i" from 1 to 5 do {
// https://community.bistudio.com/wiki/selectBestPlaces
private _potentialStartPlaces = selectBestPlaces [
[worldSize / 2, worldSize / 2], // Position
worldSize / 2, // Radius
"meadow + 2*houses - sea", // Expression
75, // Precision
10 // sourcesCount
];

MAP(_potentialStartPlaces,_x # 0);

// Find 4 empty spaces near mentioned places
{
private _pos = _x;
if (count _startPoses < 4 && {_startPoses findIf {_x distance _pos < 150} == -1}) then {
private _emptyPos = _x findEmptyPosition [0, 25];
if !(_emptyPos isEqualTo []) then {
PUSH(_startPoses,_emptyPos);
};
};
} forEach _potentialStartPlaces;
};

if (count _startPoses < 4) exitWith {
"SANDBOX: Unable to find safe places to spawn" remoteExec ["systemChat"];
ERROR("Unable to find safe places to spawn");
};

private _respawnTypes = [
"ModuleRespawnPositionEast_F",
"ModuleRespawnPositionWest_F",
"ModuleRespawnPositionGuer_F",
"ModuleRespawnPositionCiv_F"
];

private _respawnLogics = [];
private _logicGroup = createGroup sideLogic;
private _boxes = [];
{
LOG_1("Creating initial respawn at position", _x);
private _box = createVehicle ["Land_PaperBox_open_full_F", _x, [], 0, "NONE"];
PUSH(_boxes,_box);

private _respawnPosition = _logicGroup createUnit [(_respawnTypes # _forEachIndex), _box, [], 0, "NONE"];
_respawnPosition setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];

PUSH(_respawnLogics,_respawnPosition);
} forEach _startPoses;

// Add Arsenals
[_boxes,{{
if !(isNil "ACE_arsenal_fnc_openBox") then {
_x addAction [
"<t size='2' font='RobotoCondensedBold'>ACE Arsenal</t>",
{[player, player, true] call ACE_arsenal_fnc_openBox;},
0, 102, true, false
];
};
_x addAction [
"<t size='2' font='RobotoCondensedBold'>TMF Loadouts</t>",
{[] call TMF_assignGear_fnc_gearSelector},
0, 101, true, false
];
_x addAction [
"<t size='2' font='RobotoCondensedBold'>Arsenal</t>",
{0 = ["Open", true] spawn BIS_fnc_arsenal;},
0, 102, true, false
];
} forEach _this}] remoteExecCall ["BIS_fnc_call", 0, true];
call COMPILE_FILE(initRespawns);

// Add boxes and respawn logics to Curator
{
_x addcuratoreditableobjects [_respawnLogics + _boxes];
} forEach allCurators;
[
"ModuleCurator_F",
"init",
{
params ['_logic'];

_logic addCuratorEditableObjects [GVAR(boxes) + GVAR(respawnLogics) + GVAR(lanterns)];
[_logic,[west,east,resistance]] call BIS_fnc_drawCuratorRespawnMarkers;
[_logic] call BIS_fnc_drawCuratorLocations;
{
[_x] call BIS_fnc_drawCuratorDeaths;
} forEach ([] call CBA_fnc_players);
},
true,
[],
true
] call CBA_fnc_addClassEventHandler;

["Initialize", [true]] call BIS_fnc_dynamicGroups;

}] call CBA_fnc_waitUntilAndExecute;
87 changes: 87 additions & 0 deletions addons/sandbox/initRespawns.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#include "script_component.hpp"

private _startPoses = [];

private _respawnTypes = [
"ModuleRespawnPositionEast_F",
"ModuleRespawnPositionWest_F",
"ModuleRespawnPositionGuer_F"/*,
"ModuleRespawnPositionCiv_F"*/ // Civ respawn disabled
];

// Find suitable respawn positions
for "_i" from 1 to 5 do {
// https://community.bistudio.com/wiki/selectBestPlaces
private _potentialStartPlaces = selectBestPlaces [
[worldSize / 2, worldSize / 2], // Position
worldSize / 2, // Radius
"meadow + 2*houses - sea", // Expression
75, // Precision
10 // sourcesCount
];

MAP(_potentialStartPlaces,_x # 0);

// Find 4 empty spaces near mentioned places
{
private _pos = _x;
if (count _startPoses < count _respawnTypes && {_startPoses findIf {_x distance _pos < 150} == -1}) then {
private _emptyPos = _x findEmptyPosition [0, 25];
if !(_emptyPos isEqualTo []) then {
PUSH(_startPoses,_emptyPos);
};
};
} forEach _potentialStartPlaces;
};

if (count _startPoses < count _respawnTypes) exitWith {
"SANDBOX: Unable to find safe places to spawn" remoteExec ["systemChat"];
ERROR("Unable to find safe places to spawn");
};

private _respawnLogics = [];
private _logicGroup = createGroup sideLogic;
private _boxes = [];
private _lanterns = [];
{
LOG_1("Creating initial respawn at position", _x);
private _box = createVehicle ["Land_PaperBox_open_full_F", _x, [], 0, "NONE"];
private _lantern = createVehicle ["Land_Camping_Light_F", _x, [], 0, "NONE"];
_lantern attachTo [_box, [-0.422119,0.346191,0.685676]];
_lantern setVectorDirAndUp [vectorDir _box, vectorUp _box];
PUSH(_boxes,_box);
PUSH(_lanterns,_lantern);

private _respawnPosition = _logicGroup createUnit [(_respawnTypes # _forEachIndex), _box, [], 0, "NONE"];
_respawnPosition setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];

PUSH(_respawnLogics,_respawnPosition);
} forEach _startPoses;

// Add Arsenals
[_boxes,{{
if !(isNil "ACE_arsenal_fnc_openBox") then {
_x addAction [
"<t size='2' font='RobotoCondensedBold'>ACE Arsenal</t>",
{[player, player, true] call ACE_arsenal_fnc_openBox;},
0, 102, true, false
];
};
_x addAction [
"<t size='2' font='RobotoCondensedBold'>TMF Loadouts</t>",
{[] call TMF_assignGear_fnc_gearSelector},
0, 101, true, false
];
_x addAction [
"<t size='2' font='RobotoCondensedBold'>Arsenal</t>",
{0 = ["Open", true] spawn BIS_fnc_arsenal;},
0, 102, true, false
];
} forEach _this}] remoteExecCall ["BIS_fnc_call", 0, true];

GVAR(boxes) = _boxes;
GVAR(lanterns) = _lanterns;
GVAR(respawnLogics) = _respawnLogics;
publicVariable QGVAR(boxes);
publicVariable QGVAR(respawnLogics);
publicVariable QGVAR(lanterns);
18 changes: 14 additions & 4 deletions addons/sandbox/sandbox_bootstrap.inc
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
#include "script_component.hpp"
cba_settings_hasSettingsFile = 1;
class Extended_PostInit_EventHandlers {
class arc_postInit {
class GVAR(postInit) {
serverInit = QUOTE(call COMPILE_FILE(XEH_serverPostInit));
clientInit = QUOTE(call COMPILE_FILE(XEH_clientPostInit));
};
};

author = "ARCOMM";
onLoadMission = "Welcome to the sandbox, may Zeus decide your fate.";

respawn = 3;
respawnDelay = 20;
respawnVehicleDelay = 30;
respawnTemplates[] = {"MenuPosition","Spectator","Tickets", "Counter"};
respawnTemplatesVirtual[] = {};

disabledAI = 1;
joinUnassigned = 1;
disabledAI = true;
joinUnassigned = true;

saving = 0;
saving = false;

class Params {
#define DAYTIMEPERIOD_DEFAULT __EVAL(selectRandom [0,6,12,18])
#include "\a3\functions_f\Params\paramDaytimePeriod.hpp"
#include "\a3\functions_f\Params\paramGuerFriendly.hpp"
#define WEATHER_DEFAULT __EVAL(selectRandom [0,25,50,75,100])
#include "\a3\functions_f\Params\paramWeather.hpp"
#include "\a3\Functions_F_MP_Mark\Params\paramTimeAcceleration.hpp"
};
Loading

0 comments on commit d618509

Please sign in to comment.