diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 497fe0f330..d7a9dbb9fc 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -8,7 +8,7 @@ class ACE_Settings { class GVAR(viewDistanceLimit) { typeName = "SCALAR"; value = 11; // setting the highest number in the array below means no limit. - values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the index values + values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the INDEX values displayName = "Change View Distance Limit"; description = "Sets the top limit for all clients"; }; @@ -16,7 +16,7 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 1; value = 0; // not sure what to set this to. - values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; + values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnViewDistanceValue.sqf displayName = "Change View Distance"; description = "Changes in game view distance"; }; diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 4906edfecf..38ef214c09 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -11,7 +11,7 @@ class CfgVehicles { class Arguments { class moduleViewDistanceLimit { displayName = "View Distance setting limit"; - description = "Sets the limit for how high clients can raise their view distance (< 10,000)"; + description = "Sets the limit for how high clients can raise their view distance (< 10000)"; typeName = "SCALAR"; defaultValue = 10000; }; diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf index 6fffa14cc6..f5a5079273 100644 --- a/addons/viewdistance/XEH_postInit.sqf +++ b/addons/viewdistance/XEH_postInit.sqf @@ -1,4 +1,7 @@ #include "script_component.hpp" -if (!GVAR(changeAllowed)) exitWith {}; // if viewdistance is disabled from config, exit here. +if (!GVAR(changeAllowed)) exitWith { + // if viewdistance module is disabled from config, exit here. + diag_log format["[ACE]: View Distance is disabled from the config.cpp in the pbo"]; +}; [] call FUNC(initViewDistance); \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 4d35974466..8c017ec1eb 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -22,6 +22,7 @@ private ["_text","_new_view_distance","_view_distance_limit"]; // Change the received index number into an actual view distance number as set in the config: _new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue); +// Grab the limit, either from the module OR if the module is not valid, the config. _view_distance_limit = [] call FUNC(returnViewDistanceLimit); if (_new_view_distance > _view_distance_limit) then { diff --git a/addons/viewdistance/functions/fnc_initViewDistance.sqf b/addons/viewdistance/functions/fnc_initViewDistance.sqf index 5372fdedca..75ca076ff6 100644 --- a/addons/viewdistance/functions/fnc_initViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_initViewDistance.sqf @@ -19,6 +19,7 @@ if (!hasInterface) exitWith {}; +// Set the EH which waits for the View Distance setting to be changed ["SettingChanged",{ if (_this select 0 == QGVAR(newViewDistance)) then { [] call FUNC(changeViewDistance); diff --git a/addons/viewdistance/functions/fnc_module.sqf b/addons/viewdistance/functions/fnc_module.sqf index bf336bc88e..66c2aed793 100644 --- a/addons/viewdistance/functions/fnc_module.sqf +++ b/addons/viewdistance/functions/fnc_module.sqf @@ -22,12 +22,12 @@ if (!isServer) exitWith {}; PARAMS_3(_logic,_units,_activated); if (!_activated) exitWith { - diag_log text "[ACE]: View Distance Limit Module is placed but NOT active"; + diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; }; GVAR(modulePresent) = true; [_logic, QGVAR(moduleViewDistanceLimit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); -//hint format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; // only used for debug +hint format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; // only used for debug, GVAR(moduleViewDistanceLimit) keeps returning as ANY. Remember to remove before finalising the module. diag_log format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf index 871ac34e67..8ae9e6538d 100644 --- a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf +++ b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf @@ -19,16 +19,16 @@ private ["_limit"]; -_limit = 20000; // unrealistic amount for debug +_limit = 20000; // unrealistic amount since A3 max is 10000, helps in debug if (!isNil QGVAR(moduleViewDistanceLimit)) then { - _limit = GVAR(moduleViewDistanceLimit); // module always takes priority + _limit = GVAR(moduleViewDistanceLimit); // module value always takes priority over config } else { - // if module is not present, take the value from the config instead + // If the module is not present, take the value from the config instead _limit = [GVAR(viewDistanceLimit)] call FUNC(returnViewDistanceValue); // this function converts the array index in the config to it's relevant scalar value. }; -hint format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; -diag_log format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; +hint format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; // only used for debug, trying to get the module to work. Remember to remove before finalising pbo +diag_log format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; // only used for debug, trying to get the module to work. Remember to remove before finalising pbo _limit; \ No newline at end of file