mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added wind deflection module settings:
*simulationInterval *simulationRadius
This commit is contained in:
parent
a993f2d5f1
commit
85a7bea42b
@ -1,8 +1,8 @@
|
||||
class CfgVehicles {
|
||||
class ACE_Module;
|
||||
class GVAR(Module): ACE_Module {
|
||||
class GVAR(ModuleSettings): ACE_Module {
|
||||
scope = 2;
|
||||
displayName = "Advanced Ballistics [ACE]";
|
||||
displayName = "Advanced Ballistics";
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa));
|
||||
category = "ACE";
|
||||
function = QUOTE(DFUNC(initModuleSettings));
|
||||
|
14
addons/winddeflection/ACE_Settings.hpp
Normal file
14
addons/winddeflection/ACE_Settings.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(simulationInterval) {
|
||||
displayName = "Simulation Interval";
|
||||
description = "Defines the interval between every calculation step";
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 0;
|
||||
};
|
||||
class GVAR(simulationRadius) {
|
||||
displayName = "Simulation Radius";
|
||||
description = "Defines the radius (in meters) in which advanced ballistics are applied";
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 3000;
|
||||
};
|
||||
};
|
@ -1,11 +1,28 @@
|
||||
class CfgVehicles {
|
||||
class Module_F;
|
||||
class GVAR(Module): Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "Wind Deflection";
|
||||
class ACE_Module;
|
||||
class GVAR(ModuleSettings): ACE_Module {
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
displayName = "Wind Deflection";
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa));
|
||||
category = "ACE";
|
||||
function = QUOTE(DFUNC(initModuleSettings));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
class Arguments {
|
||||
class simulationInterval {
|
||||
displayName = "Simulation Interval";
|
||||
description = "Defines the interval between every calculation step";
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 0;
|
||||
};
|
||||
class simulationRadius {
|
||||
displayName = "Simulation Radius";
|
||||
description = "Defines the radius (in meters) in which advanced ballistics are applied";
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 3000;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -14,5 +14,6 @@ ADDON = false;
|
||||
|
||||
PREP(handleFired);
|
||||
PREP(updateTrajectoryPFH);
|
||||
PREP(initModuleSettings);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -21,13 +21,6 @@ class CfgAddons {
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Settings {
|
||||
class GVAR(EnableForAI) {
|
||||
value = 0;
|
||||
typeName = "BOOL";
|
||||
isClientSetable = 0;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "ACE_Settings.hpp"
|
@ -29,7 +29,7 @@ _bullet = _this select 6;
|
||||
|
||||
if (!hasInterface) exitWith {false};
|
||||
if (!(_bullet isKindOf "BulletBase")) exitWith {false};
|
||||
if (_unit distanceSqr ACE_player > 9000000) exitWith {false};
|
||||
if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false};
|
||||
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false};
|
||||
|
||||
[_bullet, getNumber(configFile >> "cfgAmmo" >> (_this select 4) >> "airFriction")] call FUNC(updateTrajectoryPFH);
|
||||
|
26
addons/winddeflection/functions/fnc_initModuleSettings.sqf
Normal file
26
addons/winddeflection/functions/fnc_initModuleSettings.sqf
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Author: Glowbal, Ruthberg
|
||||
* Module for adjusting the wind deflection settings
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_logic", "_units", "_activated"];
|
||||
_logic = _this select 0;
|
||||
_units = _this select 1;
|
||||
_activated = _this select 2;
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(simulationInterval), "simulationInterval"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(simulationRadius), "simulationRadius"] call EFUNC(common,readSettingFromModule);
|
@ -47,4 +47,4 @@
|
||||
};
|
||||
_bullet setVelocity _bulletVelocity;
|
||||
|
||||
}, 0, [_this select 0, _this select 1, time]] call CBA_fnc_addPerFrameHandler;
|
||||
}, GVAR(simulationInterval), [_this select 0, _this select 1, time]] call CBA_fnc_addPerFrameHandler;
|
Loading…
Reference in New Issue
Block a user