Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Parameter Options Rework #197

Draft
wants to merge 3 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
720 changes: 306 additions & 414 deletions mission/config/params.hpp

Large diffs are not rendered by default.

25 changes: 19 additions & 6 deletions mission/functions/core/fn_marker_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ vn_mf_markers_supply_officer_initial = [];
vn_mf_markers_wreck_recovery = [];
vn_mf_markers_no_harass = [];

vn_mf_s_markers_zone_alpha_percent = (
(["zones_marker_alpha_percent", 50] call BIS_fnc_getParamValue) / 100
);

vn_mf_s_markers_zone_allow_harass = (
[false, true] select (["ai_harass_inside_zones", 0] call BIS_fnc_getParamValue)
);

{
if (_x find "mf_respawn_" isEqualTo 0) then {
vn_mf_markers_base_respawns pushBack _x;
Expand Down Expand Up @@ -51,11 +59,16 @@ vn_mf_markers_no_harass = [];
//Hide location marker used for mission mockup
_locationMarker setMarkerAlpha 0;

private _noHarassMarker = createMarker [format ["no_harass_%1", _x], getMarkerPos _x];
_noHarassMarker setMarkerShape "ELLIPSE";
_noHarassMarker setMarkerSize [200, 200];
_noHarassMarker setMarkerAlpha 0;
vn_mf_markers_no_harass pushBack _noHarassMarker;
_x setMarkerAlpha vn_mf_s_markers_zone_alpha_percent;

if (!vn_mf_s_markers_zone_allow_harass) then {
private _noHarassMarker = createMarker [format ["no_harass_%1", _x], getMarkerPos _x];
_noHarassMarker setMarkerShape "ELLIPSE";
_noHarassMarker setMarkerSize [200, 200];
_noHarassMarker setMarkerAlpha 0;
vn_mf_markers_no_harass pushBack _noHarassMarker;
};

};
if (_x find "wreck_recovery" isEqualTo 0) then {
vn_mf_markers_wreck_recovery pushBack _x;
Expand All @@ -65,4 +78,4 @@ vn_mf_markers_no_harass = [];
};
} forEach allMapMarkers;

publicVariable "vn_mf_markers_blocked_areas";
publicVariable "vn_mf_markers_blocked_areas";
62 changes: 49 additions & 13 deletions mission/functions/core/init/fn_adv_revive_params.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,52 @@
Example(s): none
*/

private _headshot_kill = ["headshot_kill", 0] call BIS_fnc_getParamValue;
private _bleedout_time = ["bleedout_time", 300] call BIS_fnc_getParamValue;
private _withstand_percentage = ["withstand_percentage", 80] call BIS_fnc_getParamValue;
private _bandage_item_remove = ["remove_bandage_item", 1] call BIS_fnc_getParamValue;
private _revive_item_remove = ["remove_revive_item", 1] call BIS_fnc_getParamValue;
private _revive_requirement = ["revive_requirement", 1] call BIS_fnc_getParamValue;

missionNamespace setVariable ["vn_revive_headshot_kill",[false,true] select _headshot_kill,true];
missionNamespace setVariable ["vn_revive_bleedout_time",_bleedout_time,true];
missionNamespace setVariable ["vn_revive_withstand_percentage",_withstand_percentage,true];
missionNamespace setVariable ["vn_revive_bandage_item_remove",[false,true] select _bandage_item_remove,true];
missionNamespace setVariable ["vn_revive_revive_item_remove",[false,true] select _revive_item_remove,true];
missionNamespace setVariable ["vn_revive_revive_requirement",[false,true] select _revive_requirement,true];

// Toggles

private _headshot_kill = [false, true] select (["revive_headshot_kill", 0] call BIS_fnc_getParamValue);
missionNamespace setVariable ["vn_revive_headshot_kill", _headshot_kill, true];

private _bandage_item_remove = [false, true] select (["revive_remove_bandage_item", 1] call BIS_fnc_getParamValue);
missionNamespace setVariable ["vn_revive_bandage_item_remove", _bandage_item_remove, true];

private _revive_item_remove = [false, true] select (["revive_remove_revive_item", 1] call BIS_fnc_getParamValue);
missionNamespace setVariable ["vn_revive_revive_item_remove", _revive_item_remove, true];

private _revive_requirement = [false, true] select (["revive_revive_requirement", 1] call BIS_fnc_getParamValue);
missionNamespace setVariable ["vn_revive_revive_requirement", _revive_requirement, true];

private _revive_bleedout_affects_actions = [false, true] select (["revive_bleedout_affects_actions", 1] call BIS_fnc_getParamValue);
missionNamespace setVariable ["vn_revive_bleedout_affects_actions", _revive_bleedout_affects_actions, true];

// Real values / selections

private _bleedout_time = ["revive_bleedout_time", 300] call BIS_fnc_getParamValue;
missionNamespace setVariable ["vn_revive_bleedout_time", _bleedout_time, true];

private _withstand_percentage = ["revive_withstand_percentage", 80] call BIS_fnc_getParamValue;
missionNamespace setVariable ["vn_revive_withstand_percentage", _withstand_percentage, true];

private _revive_revive_delay = ["revive_revive_delay", 5] call BIS_fnc_getParamValue;
missionNamespace setVariable ["vn_revive_revive_delay", _revive_revive_delay, true];

private _revive_move_chance = ["revive_move_chance", 75] call BIS_fnc_getParamValue;
missionNamespace setVariable ["vn_revive_move_chance", _revive_move_chance, true];

private _revive_respawn_action_time = ["revive_respawn_action_time", 75] call BIS_fnc_getParamValue;
missionNamespace setVariable ["vn_revive_respawn_action_time", _revive_respawn_action_time, true];

private _revive_icon_distance = ["revive_icon_distance", 50] call BIS_fnc_getParamValue;
missionNamespace setVariable ["vn_revive_icon_distance", _revive_icon_distance, true];

private _medical_items_arr = [
[],
["Medikit","vn_b_item_medikit_01"],
["FirstAidKit","vn_o_item_firstaidkit","vn_b_item_firstaidkit", "vn_b_item_medikit_01", "Medikit"]
];

private _bandage_item_arr = _medical_items_arr select (["revive_bandage_item", 2] call BIS_fnc_getParamValue);
missionNamespace setVariable ["vn_revive_bandage_item", _bandage_item_arr, true];

private _revive_item_arr = _medical_items_arr select (["revive_revive_item", 2] call BIS_fnc_getParamValue);
missionNamespace setVariable ["vn_revive_revive_item", _revive_item_arr, true];
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ _potentialZonesToOpen = _potentialZonesToOpen arrayIntersect _potentialZonesToOp

private _zonesToOpen = _potentialZonesToOpen - _capturedZones - _activeZones;

private _concurrent_zones_limit = ["zones_concurrent_active_limit", -1] call BIS_fnc_getParamValue;

if (_concurrent_zones_limit > 0) then {
_zonesToOpen resize _concurrent_zones_limit;
_zonesToOpen = _zonesToOpen select {_x isEqualType ""};
};

{
[_x] call vn_mf_fnc_director_open_zone;
} forEach _zonesToOpen;
Expand Down
9 changes: 7 additions & 2 deletions mission/functions/systems/sites/fn_sites_create_aa_site.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ params ["_pos"];

//Create an AA warning marker.
private _markerPos = _spawnPos getPos [5 + random 10, random 360];

private _mainMarkers = [];

private _aaZoneMarker = createMarker [format ["AA_zone_%1", _siteId], _markerPos];
_aaZoneMarker setMarkerSize [1000, 1000];
_aaZoneMarker setMarkerShape "ELLIPSE";
Expand All @@ -41,6 +44,8 @@ params ["_pos"];
// hiden at spawn 0.3
_aaZoneMarker setMarkerAlpha 0;

// special mission parameterisation case, toggles display of AA 'area of effect' markers
if (vn_mf_s_sites_discovery_aa_marker_enabled) then {_mainMarkers pushBack _aaZoneMarker};

// create partially discovered marker
private _partialPos = _spawnPos getPos [10 + random 40, random 360];
Expand All @@ -56,6 +61,7 @@ params ["_pos"];
_aaMarker setMarkerText "AA";
// hiden at spawn 0.5
_aaMarker setMarkerAlpha 0;
_mainMarkers pushBack _aaMarker;

private _vehicles = _createdThings select 0;
private _groups = _createdThings select 1;
Expand All @@ -76,8 +82,7 @@ params ["_pos"];
_siteStore setVariable ["units", (_createdThings select 1)];
_siteStore setVariable ["groups", _groups];


_siteStore setVariable ["markers", [_aaZoneMarker, _aaMarker], true];
_siteStore setVariable ["markers", _mainMarkers, true];
_siteStore setVariable ["partialMarkers", [_partialMarker], true];
},
//Teardown condition check code
Expand Down
4 changes: 2 additions & 2 deletions mission/functions/systems/sites/fn_sites_discovery_job.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ private _nearbyUndiscoveredSites =
_siteRef setVariable ["partiallyDiscovered", true, true];

if (_distance <= vn_mf_g_sites_discovery_radius) then {
_siteRef getVariable ["markers", []] apply {_x setMarkerAlpha 0.5};
_siteRef getVariable ["markers", []] apply {_x setMarkerAlpha vn_mf_c_sites_discovery_marker_alpha_percent};
_siteRef getVariable ["partialMarkers", []] apply {_x setMarkerAlpha 0};
_siteRef setVariable ["discovered", true, true];
continue;
};

// Only set partial markers if we're not close enough to fully reveal
_siteRef getVariable ["partialMarkers", []] apply {_x setMarkerAlpha 0.3};
_siteRef getVariable ["partialMarkers", []] apply {_x setMarkerAlpha vn_mf_c_sites_partial_discovery_marker_alpha_percent};
} forEach _nearbyUndiscoveredSites;

true
11 changes: 8 additions & 3 deletions mission/functions/systems/sites/fn_sites_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ vn_mf_s_max_fortifications_per_zone = getNumber (missionConfigFile >> "map_confi
vn_mf_s_max_tunnels_per_zone = getNumber (missionConfigFile >> "map_config" >> "max_tunnels_per_zone");
vn_mf_s_max_vehicle_depots_per_zone = getNumber (missionConfigFile >> "map_config" >> "max_vehicle_depots_per_zone");

vn_mf_g_sites_partial_discovery_radius = 300;

vn_mf_g_sites_partial_discovery_radius = ["sites_partial_discovery_radius_meters", 300] call BIS_fnc_getParamValue;
publicVariable "vn_mf_g_sites_partial_discovery_radius";
vn_mf_g_sites_discovery_radius = 50;

vn_mf_g_sites_discovery_radius = ["sites_discovery_radius_meters", 50] call BIS_fnc_getParamValue;
publicVariable "vn_mf_g_sites_discovery_radius";
vn_mf_g_sites_scout_action_cooldown = 30;

vn_mf_g_sites_scout_action_cooldown = ["sites_scout_action_cooldown_seconds", 30] call BIS_fnc_getParamValue;
publicVariable "vn_mf_g_sites_scout_action_cooldown";

vn_mf_s_sites_discovery_aa_marker_enabled = [false, true] select (["sites_discovery_aa_marker_toggle", 1] call BIS_fnc_getParamValue);

missionNamespace setVariable ["sites", []];
publicVariable "sites";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
[] call vn_mf_fnc_sites_client_init
*/

vn_mf_c_sites_partial_discovery_marker_alpha_percent = (["sites_partial_discovery_marker_alpha_percent", 30] call BIS_fnc_getParamValue) / 100;
vn_mf_c_sites_discovery_marker_alpha_percent = (["sites_discovery_marker_alpha_percent", 50] call BIS_fnc_getParamValue) / 100;

private _toggle_site_discovery = [false, true] select (["sites_passive_discovery_toggle", 1] call BIS_fnc_getParamValue);
if (!_toggle_site_discovery) exitWith {true};

/*
The marker discovery system allows site markers to be discovered thru passive exploration of the map
as well as thru active scouting.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
*/

private _tutorialEnabled = ["para_enableTutorial"] call para_c_fnc_optionsMenu_getValue;
private _tutorialGlobalEnabled = ["toggle_global_tutorials", 0] call BIS_fnc_getParamValue > 0;

// Early exit if the tutorial is disabled
if (!_tutorialEnabled) exitWith {
if (!_tutorialEnabled || !_tutorialGlobalEnabled) exitWith {
//systemChat "Tutorial Disabled";
false;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ if (isNil "vn_mf_veh_asset_spawn_points") then {
};

//Vehicles are marked as abandoned after 5 minutes.
vn_mf_veh_asset_abandonedTimer = 300;
vn_mf_veh_asset_abandonedTimer = ["veh_asset_abandoned_timer_seconds", 300] call BIS_fnc_getParamValue;
//Vehicles must be X distance from spawn to be marked as abandoned
vn_mf_veh_asset_abandonedMinDistance = 20;
vn_mf_veh_asset_abandonedMinDistance = ["veh_asset_abandoned_min_distance", 300] call BIS_fnc_getParamValue;
//Marker positions are updated every X seconds
vn_mf_veh_asset_markerUpdateDelay = 60;
vn_mf_veh_asset_markerUpdateDelay = ["veh_asset_marker_update_delay_seconds", 10] call BIS_fnc_getParamValue;
vn_mf_veh_asset_markerLastUpdate = 0;
//Lock all vehicles that go idle
vn_mf_veh_asset_lock_all_idle_vehicles = true;
vn_mf_veh_asset_lock_all_idle_vehicles = [false, true] select (["veh_asset_lock_idle_vehicles", 1] call BIS_fnc_getParamValue);
//Vehicles that go idle in one of these areas are locked (simulation disabled)
vn_mf_veh_asset_lock_idle_vehicle_markers = _lockIdleVehicleMarkers;
//Time to re-lock a vehicle
vn_mf_veh_asset_relock_time = 30;
vn_mf_veh_asset_relock_time = ["veh_asset_relock_time_seconds", 30] call BIS_fnc_getParamValue;
//The maximum distance from the spawn point at which a vehicle can be changed for another vehicle type.
vn_mf_veh_asset_vehicle_change_max_distance = 10;
publicVariable "vn_mf_veh_asset_vehicle_change_max_distance";
Expand Down
34 changes: 31 additions & 3 deletions mission/para_server_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,36 @@ publicVariable "vn_mf_traits_map";
//Set whether the building system needs vehicles (fuel/repair/rearm, etc) nearby to build certain structures.
para_l_buildables_require_vehicles = [false, true] select (["buildables_require_vehicles", 1] call BIS_fnc_getParamValue);
publicVariable "para_l_buildables_require_vehicles";

// @dijksterhuis: PR TODO: para_l tag?
// am following the convention above, but probably should be para_g tag.
para_l_basebuilding_enabled = [false, true] select (["toggle_building_systems", 1] call BIS_fnc_getParamValue);
publicVariable "para_l_basebuilding_enabled";

para_s_harass_enabled = [false, true] select (["ai_harass_enabled", 1] call BIS_fnc_getParamValue);
// @dijksterhuis: PR TODO: requires paradigm changes, will have no effect if merged before changes made
para_s_harassMinDelay = ["ai_harass_minimum_delay", 240] call BIS_fnc_getParamValue;

vn_mf_dawnLength = ["dawn_length", 1200] call BIS_fnc_getParamValue;
vn_mf_dayLength = ["day_length", 9000] call BIS_fnc_getParamValue;
vn_mf_duskLength = ["dusk_length", 1200] call BIS_fnc_getParamValue;
vn_mf_nightLength = ["night_length", 1800] call BIS_fnc_getParamValue;

//Set whether stamia is enabled
vn_mf_param_enable_stamina = (["enable_stamina", 1] call BIS_fnc_getParamValue) > 0;
vn_mf_param_set_stamina = (["set_stamina", 1] call BIS_fnc_getParamValue);
publicVariable "vn_mf_param_enable_stamina";

vn_mf_param_set_stamina = (["set_stamina", 1] call BIS_fnc_getParamValue);
publicVariable "vn_mf_param_set_stamina";

//Set whether withstand is always available.
vn_revive_withstand_allow = (["always_allow_withstand", 1] call BIS_fnc_getParamValue) > 0;
publicVariable "vn_revive_withstand_allow";

//Set number of bandages needed to withstand.
vn_revive_withstand_amount = 4;
publicVariable "vn_revive_withstand_amount";

//Set number of max players per team
vn_mf_max_players_acav = ["max_players_acav", 99] call BIS_fnc_getParamValue;
vn_mf_max_players_greenhornets = ["max_players_greenhornets", 99] call BIS_fnc_getParamValue;;
Expand Down Expand Up @@ -179,6 +192,10 @@ diag_log format ["VN MikeForce: Total Game Time - %1", para_g_totalgametime];
["save_time_elapsed", {call vn_mf_fnc_save_time_elapsed}, [], 5] call para_g_fnc_scheduler_add_job;

// spawn buildables and init vars

// WARNING: We need to enable the building system even if the `para_l_basebuilding_enabled`
// variable (from the "basebuilding_system_enabled" parameter option) is set to FALSE,
// otherwise systems like AI Harassment cannot find the para_g_bases variable.
diag_log "VN MikeForce: Initialising building system";
call para_s_fnc_building_system_init;

Expand All @@ -188,6 +205,15 @@ diag_log "VN MikeForce: Creating supply officers";
[_x] call vn_mf_fnc_create_supply_officer;
} forEach vn_mf_markers_supply_officer_initial;

/*
@dijksterhuis: PR TODO: disabling config flag until paradigm PR created
if (para_l_basebuilding_enabled) then {
diag_log "VN MikeForce: Starting building state tracker";
// building state tracking
["building_state_tracker", {call para_s_fnc_building_state_tracker}, [], 60] call para_g_fnc_scheduler_add_job;
};
*/

diag_log "VN MikeForce: Starting building state tracker";
// building state tracking
["building_state_tracker", {call para_s_fnc_building_state_tracker}, [], 60] call para_g_fnc_scheduler_add_job;
Expand Down Expand Up @@ -272,9 +298,11 @@ diag_log "VN MikeForce: Initialising AI Objectives";
["hardAiLimit", ["hard_ai_limit", 80] call BIS_fnc_getParamValue]
] call para_s_fnc_ai_obj_subsystem_init;

diag_log "VN MikeForce: Initialising Harass";
// Start harassment subsystem. Depends on the AI subsystem.
[] call para_s_fnc_harass_subsystem_init;
if (para_s_harass_enabled) then {
diag_log "VN MikeForce: Initialising Harass";
[] call para_s_fnc_harass_subsystem_init;
};

diag_log "VN MikeForce: Initialising Vehicle Manager";
// start vehicle asset management subsystem
Expand Down
Loading