Merge branch 'master' of github.com:acemod/ACE3

This commit is contained in:
jaynus 2015-04-16 09:22:16 -07:00
commit cdb460d36d
22 changed files with 155 additions and 125 deletions

View File

@ -19,7 +19,7 @@
*/
#include "script_component.hpp"
private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_bulletTranslation", "_airFriction", "_dragModel", "_velocityBoundaryData", "_muzzleVelocity", "_muzzleVelocityCoef", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_bulletWeight", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ACE_Elevation", "_ACE_Windage", "_ID"];
private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityCoef", "_muzzleAccessory", "_initSpeedCoef", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_bulletWeight", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef"];
_unit = _this select 0;
_weapon = _this select 1;
_mode = _this select 3;
@ -95,12 +95,11 @@ if (GVAR(ammoTemperatureEnabled)) then {
};
};
// TODO: Make _bulletTraceVisible global and toggle it with events
_bulletTraceVisible = false;
if (GVAR(bulletTraceEnabled) && currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then {
if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER" && currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then {
_opticsName = (primaryWeaponItems ACE_player) select 2;
_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
_bulletTraceVisible = (_opticType == 2 || currentWeapon ACE_player in ["ACE_Vector", "Binocular", "Rangefinder", "Laserdesignator"]) && cameraView == "GUNNER";
_bulletTraceVisible = (_opticType == 2 || currentWeapon ACE_player in ["ACE_Vector", "Binocular", "Rangefinder", "Laserdesignator"]);
};
_caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_caliber");
@ -158,15 +157,17 @@ if (GVAR(AdvancedAirDragEnabled)) then {
[{
private ["_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"];
EXPLODE_4_PVT(_this select 0,_bullet,_caliber,_bulletTraceVisible,_index);
if (!alive _bullet) exitWith {
[_this select 1] call cba_fnc_removePerFrameHandler;
};
_bulletVelocity = velocity _bullet;
_bulletPosition = getPosASL _bullet;
if (_bulletTraceVisible && vectorMagnitude _bulletVelocity > 600) then {
_bulletSpeed = vectorMagnitude _bulletVelocity;
if (!alive _bullet || _bulletSpeed < 100) exitWith {
[_this select 1] call cba_fnc_removePerFrameHandler;
};
if (_bulletTraceVisible && _bulletSpeed > 600) then {
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""];
};
@ -190,7 +191,7 @@ if (GVAR(AdvancedAirDragEnabled)) then {
if ((GVAR(bulletDatabaseOccupiedIndices) pushBack _index) == 0) then {
[{
private ["_bulletDatabaseEntry", "_bullet", "_caliber", "_muzzleVelocity", "_frames", "_speed", "_airFriction", "_airFrictionRef", "_dragModel", "_atmosphereModel", "_ballisticCoefficient", "_ballisticCoefficients", "_velocityBoundaries", "_airDensity", "_stabilityFactor", "_transonicStabilityCoef", "_twistDirection", "_unit", "_bulletTraceVisible", "_index", "_temperature", "_humidity", "_deltaT", "_TOF", "_bulletPosition", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_bulletSpeedAvg", "_wind", "_drag", "_dragRef", "_vect", "_accel", "_accelRef", "_centripetalAccel", "_pressure", "_pressureDeviation", "_windSourceObstacle", "_windSourceTerrain", "_height", "_roughnessLength"];
private ["_bulletDatabaseEntry", "_bullet", "_caliber", "_muzzleVelocity", "_frames", "_speed", "_airFriction", "_airFrictionRef", "_dragModel", "_atmosphereModel", "_ballisticCoefficient", "_ballisticCoefficients", "_velocityBoundaries", "_airDensity", "_stabilityFactor", "_transonicStabilityCoef", "_twistDirection", "_unit", "_bulletTraceVisible", "_index", "_temperature", "_humidity", "_deltaT", "_TOF", "_bulletPosition", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_bulletSpeedAvg", "_wind", "_drag", "_dragRef", "_vect", "_accel", "_accelRef", "_centripetalAccel", "_pressure", "_pressureDeviation", "_windSourceObstacle", "_windSourceTerrain", "_height", "_roughnessLength", "_bulletDir", "_horizontalDeflection", "_horizontalDeflectionPartial", "_spinDrift", "_spinDriftPartial"];
{
_bulletDatabaseEntry = (GVAR(bulletDatabase) select _x);

View File

@ -230,12 +230,12 @@ class ATragMX_Display {
w=0.03;
h=0.03;
colorBackground[]={0,0,0,0.0};
action=QUOTE(((GVAR(currentGun) select GVAR(currentTarget)) + (count GVAR(gunList)) - 1) % (count GVAR(gunList)) call FUNC(change_gun));
action=QUOTE((GVAR(currentGun) + (count GVAR(gunList)) - 1) % (count GVAR(gunList)) call FUNC(change_gun));
};
class BOTTOM: TOP {
idc=-1;
y=0.265*safezoneH+safezoneY+0.955;
action=QUOTE(((GVAR(currentGun) select GVAR(currentTarget)) + (count GVAR(gunList)) + 1) % (count GVAR(gunList)) call FUNC(change_gun));
action=QUOTE((GVAR(currentGun) + (count GVAR(gunList)) + 1) % (count GVAR(gunList)) call FUNC(change_gun));
};
class LEFT: ATragMX_RscButton {
idc=-1;
@ -244,12 +244,12 @@ class ATragMX_Display {
w=0.05;
h=0.03;
colorBackground[]={0,0,0,0};
action=QUOTE(call FUNC(parse_input); GVAR(currentTarget) = (4 + GVAR(currentTarget) - 1) % 4; call FUNC(update_target_selection));
action=QUOTE(((4 + GVAR(currentTarget) - 1) % 4) call FUNC(change_target_slot));
};
class RIGHT: LEFT {
idc=-1;
x=0.55*safezoneW+safezoneX+0.2725;
action=QUOTE(call FUNC(parse_input); GVAR(currentTarget) = (4 + GVAR(currentTarget) + 1) % 4; call FUNC(update_target_selection));
action=QUOTE(((4 + GVAR(currentTarget) + 1) % 4) call FUNC(change_target_slot));
};
class TOP_LEFT: ATragMX_RscButton {
idc=-1;
@ -420,25 +420,25 @@ class ATragMX_Display {
colorBackgroundDisabled[]={0,0,0,1};
colorBackgroundActive[]={0,0,0,0};
text="A";
action=QUOTE(call FUNC(parse_input); GVAR(currentTarget)=0; call FUNC(update_target_selection));
action=QUOTE(0 call FUNC(change_target_slot));
};
class TEXT_TARGET_B: TEXT_TARGET_A {
idc=501;
x=0.550*safezoneW+safezoneX+0.2281;
text="B";
action=QUOTE(call FUNC(parse_input); GVAR(currentTarget)=1; call FUNC(update_target_selection));
action=QUOTE(1 call FUNC(change_target_slot));
};
class TEXT_TARGET_C: TEXT_TARGET_B {
idc=502;
x=0.550*safezoneW+safezoneX+0.2512;
text="C";
action=QUOTE(call FUNC(parse_input); GVAR(currentTarget)=2; call FUNC(update_target_selection));
action=QUOTE(2 call FUNC(change_target_slot));
};
class TEXT_TARGET_D: TEXT_TARGET_B {
idc=503;
x=0.550*safezoneW+safezoneX+0.2743;
text="D";
action=QUOTE(call FUNC(parse_input); GVAR(currentTarget)=3; call FUNC(update_target_selection));
action=QUOTE(3 call FUNC(change_target_slot));
};
class TEXT_TARGET: TEXT_GUN {

View File

@ -11,6 +11,7 @@ PREP(calculate_target_solution);
PREP(calculate_target_speed_assist);
PREP(can_show);
PREP(change_gun);
PREP(change_target_slot);
PREP(create_dialog);
PREP(cycle_range_card_columns);
PREP(cycle_scope_unit);

View File

@ -18,21 +18,21 @@
[] call FUNC(parse_input);
private ["_scopeBaseAngle"];
_scopeBaseAngle = ((GVAR(workingMemory) select GVAR(currentTarget)) select 3);
_scopeBaseAngle = (GVAR(workingMemory) select 3);
private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"];
_bulletMass = (GVAR(workingMemory) select GVAR(currentTarget)) select 12;
_boreHeight = (GVAR(workingMemory) select GVAR(currentTarget)) select 5;
_airFriction = (GVAR(workingMemory) select GVAR(currentTarget)) select 4;
_muzzleVelocity = (GVAR(workingMemory) select GVAR(currentTarget)) select 1;
_bc = (GVAR(workingMemory) select GVAR(currentTarget)) select 15;
_dragModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 16;
_atmosphereModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 17;
_bulletMass = GVAR(workingMemory) select 12;
_boreHeight = GVAR(workingMemory) select 5;
_airFriction = GVAR(workingMemory) select 4;
_muzzleVelocity = GVAR(workingMemory) select 1;
_bc = GVAR(workingMemory) select 15;
_dragModel = GVAR(workingMemory) select 16;
_atmosphereModel = GVAR(workingMemory) select 17;
private ["_temperature", "_barometricPressure", "_relativeHumidity"];
_temperature = (GVAR(temperature) select GVAR(currentTarget));
_barometricPressure = (GVAR(barometricPressure) select GVAR(currentTarget));
_relativeHumidity = (GVAR(relativeHumidity) select GVAR(currentTarget));
_temperature = GVAR(temperature);
_barometricPressure = GVAR(barometricPressure);
_relativeHumidity = GVAR(relativeHumidity);
if (GVAR(currentUnit) == 1) then
{
_temperature = (_temperature - 32) / 1.8;

View File

@ -34,6 +34,7 @@ _temperature = 15;
_barometricPressure = 1013.25;
_relativeHumidity = 0;
private ["_result"];
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false] call FUNC(calculate_solution);
_scopeBaseAngle + (_result select 0) / 60

View File

@ -18,21 +18,21 @@
[] call FUNC(parse_input);
private ["_scopeBaseAngle"];
_scopeBaseAngle = ((GVAR(workingMemory) select GVAR(currentTarget)) select 3);
_scopeBaseAngle = (GVAR(workingMemory) select 3);
private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"];
_bulletMass = (GVAR(workingMemory) select GVAR(currentTarget)) select 12;
_boreHeight = (GVAR(workingMemory) select GVAR(currentTarget)) select 5;
_airFriction = (GVAR(workingMemory) select GVAR(currentTarget)) select 4;
_muzzleVelocity = (GVAR(workingMemory) select GVAR(currentTarget)) select 1;
_bc = (GVAR(workingMemory) select GVAR(currentTarget)) select 15;
_dragModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 16;
_atmosphereModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 17;
_bulletMass = GVAR(workingMemory) select 12;
_boreHeight = GVAR(workingMemory) select 5;
_airFriction = GVAR(workingMemory) select 4;
_muzzleVelocity = GVAR(workingMemory) select 1;
_bc = GVAR(workingMemory) select 15;
_dragModel = GVAR(workingMemory) select 16;
_atmosphereModel = GVAR(workingMemory) select 17;
private ["_temperature", "_barometricPressure", "_relativeHumidity"];
_temperature = (GVAR(temperature) select GVAR(currentTarget));
_barometricPressure = (GVAR(barometricPressure) select GVAR(currentTarget));
_relativeHumidity = (GVAR(relativeHumidity) select GVAR(currentTarget));
_temperature = GVAR(temperature);
_barometricPressure = GVAR(barometricPressure);
_relativeHumidity = GVAR(relativeHumidity);
if (GVAR(currentUnit) == 1) then
{
_temperature = (_temperature - 32) / 1.8;
@ -55,6 +55,7 @@ if (GVAR(currentUnit) == 1) then
_targetSpeed = _targetSpeed / 2.23693629;
};
private ["_result"];
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000,
_windSpeed, _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false] call FUNC(calculate_solution);

View File

@ -17,14 +17,14 @@
if (_this < 0 || _this > (count GVAR(gunList)) - 1) exitWith {};
GVAR(workingMemory) set [GVAR(currentTarget), +(GVAR(gunList) select _this)];
GVAR(currentGun) set [GVAR(currentTarget), _this];
GVAR(workingMemory) = +(GVAR(gunList) select _this);
GVAR(currentGun) = _this;
lbSetCurSel [6000, (GVAR(currentGun) select GVAR(currentTarget))];
lbSetCurSel [6000, GVAR(currentGun)];
if ((GVAR(scopeUnits) select (GVAR(currentScopeUnit) select GVAR(currentTarget))) != "Clicks") then
if ((GVAR(scopeUnits) select GVAR(currentScopeUnit)) != "Clicks") then
{
GVAR(currentScopeUnit) set [GVAR(currentTarget), (GVAR(workingMemory) select GVAR(currentTarget)) select 6];
GVAR(currentScopeUnit) = GVAR(workingMemory) select 6;
};
[] call FUNC(update_gun);
@ -35,4 +35,4 @@ GVAR(leadOutput) set [GVAR(currentTarget), 0];
GVAR(tofOutput) set [GVAR(currentTarget), 0];
GVAR(velocityOutput) set [GVAR(currentTarget), 0];
[] call FUNC(update_result);
[] call FUNC(calculate_target_solution);

View File

@ -0,0 +1,26 @@
/*
* Author: Ruthberg
* Selects a target slot (A, B, C or D)
*
* Arguments:
* target <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* 2 call ace_atragmx_fnc_change_target_slot
*
* Public: No
*/
#include "script_component.hpp"
private ["_target"];
_target = 0 max _this min 3;
call FUNC(parse_input);
GVAR(currentTarget) = _target;
call FUNC(update_target_selection);
call FUNC(calculate_target_solution);

View File

@ -17,7 +17,7 @@
[] call FUNC(parse_input);
GVAR(currentScopeUnit) set [GVAR(currentTarget), ((GVAR(currentScopeUnit) select GVAR(currentTarget)) + 1) % (count GVAR(scopeUnits))];
GVAR(currentScopeUnit) = (GVAR(currentScopeUnit) + 1) % (count GVAR(scopeUnits));
[] call FUNC(update_scope_unit);
[] call FUNC(update_result);

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
GVAR(workingMemory) = [+(GVAR(gunList) select 0), +(GVAR(gunList) select 0), +(GVAR(gunList) select 0), +(GVAR(gunList) select 0)];
GVAR(workingMemory) = +(GVAR(gunList) select 0);
GVAR(scopeUnits) = ["MILs", "TMOA", "SMOA", "Clicks"];
@ -37,13 +37,13 @@ GVAR(speedAssistNumTicksUnit) = 0;
GVAR(speedAssistTimer) = true;
GVAR(currentUnit) = 2;
GVAR(currentGun) = [0, 0, 0, 0];
GVAR(currentGun) = 0;
GVAR(currentTarget) = 0;
GVAR(currentScopeUnit) = [0, 0, 0, 0];
GVAR(currentScopeUnit) = 0;
GVAR(temperature) = [15, 15, 15, 15];
GVAR(barometricPressure) = [1013.25, 1013.25, 1013.25, 1013.25];
GVAR(relativeHumidity) = [0.5, 0.5, 0.5, 0.5];
GVAR(temperature) = 15;
GVAR(barometricPressure) = 1013.25;
GVAR(relativeHumidity) = 0.5;
GVAR(windSpeed) = [0, 0, 0, 0];
GVAR(windDirection) = [12, 12, 12, 12];

View File

@ -15,9 +15,9 @@
*/
#include "script_component.hpp"
GVAR(temperature) set [GVAR(currentTarget), parseNumber(ctrlText 200)];
GVAR(barometricPressure) set [GVAR(currentTarget), 0 max parseNumber(ctrlText 210)];
GVAR(relativeHumidity) set [GVAR(currentTarget), (0 max parseNumber(ctrlText 220) min 100) / 100];
GVAR(temperature) = parseNumber(ctrlText 200);
GVAR(barometricPressure) = 0 max parseNumber(ctrlText 210);
GVAR(relativeHumidity) = (0 max parseNumber(ctrlText 220) min 100) / 100;
GVAR(windSpeed) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 300)) min 50];
GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 310)) min 12];
@ -44,20 +44,20 @@ _boreHeight = 0.1 max _boreHeight min 10;
_bulletMass = 1 max _bulletMass min 100;
_muzzleVelocity = 100 max _muzzleVelocity min 1400;
(GVAR(workingMemory) select GVAR(currentTarget)) set [5, _boreHeight];
(GVAR(workingMemory) select GVAR(currentTarget)) set [12, _bulletMass];
GVAR(workingMemory) set [5, _boreHeight];
GVAR(workingMemory) set [12, _bulletMass];
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then {
(GVAR(workingMemory) select GVAR(currentTarget)) set [15, _airFriction];
GVAR(workingMemory) set [15, _airFriction];
} else {
(GVAR(workingMemory) select GVAR(currentTarget)) set [4, _airFriction];
GVAR(workingMemory) set [4, _airFriction];
};
(GVAR(workingMemory) select GVAR(currentTarget)) set [1, _muzzleVelocity];
GVAR(workingMemory) set [1, _muzzleVelocity];
private ["_elevationCur", "_elevationCur", "_elevationScopeStep", "_windageScopeStep"];
private ["_elevationCur", "_windageCur", "_elevationScopeStep", "_windageScopeStep"];
_elevationCur = parseNumber(ctrlText 402);
_windageCur = parseNumber(ctrlText 412);
switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do
switch (GVAR(currentScopeUnit)) do
{
case 0:
{
@ -73,16 +73,16 @@ switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do
case 3:
{
_elevationScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 7);
_windageScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 8);
_elevationScopeStep = (GVAR(workingMemory) select 7);
_windageScopeStep = (GVAR(workingMemory) select 8);
_elevationCur = _elevationCur * _elevationScopeStep;
_windageCur = _windageCur * _windageScopeStep;
};
};
(GVAR(workingMemory) select GVAR(currentTarget)) set [10, _elevationCur];
(GVAR(workingMemory) select GVAR(currentTarget)) set [11, _windageCur];
GVAR(workingMemory) set [10, _elevationCur];
GVAR(workingMemory) set [11, _windageCur];
[] call FUNC(update_gun);
[] call FUNC(update_atmosphere);

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
(GVAR(workingMemory) select GVAR(currentTarget)) set [10, 0];
(GVAR(workingMemory) select GVAR(currentTarget)) set [11, 0];
GVAR(workingMemory) set [10, 0];
GVAR(workingMemory) set [11, 0];
[] call FUNC(update_result);

View File

@ -18,7 +18,7 @@
private ["_index"];
_index = 0 max (lbCurSel 6000);
GVAR(gunList) set [_index, +(GVAR(workingMemory) select GVAR(currentTarget))];
GVAR(gunList) set [_index, +GVAR(workingMemory)];
lbClear 6000;
{

View File

@ -22,5 +22,5 @@ GVAR(showGunList) = _this;
if (_this) then {
ctrlSetFocus (_dsp displayCtrl 6002);
lbSetCurSel [6000, (GVAR(currentGun) select GVAR(currentTarget))];
lbSetCurSel [6000, GVAR(currentGun)];
};

View File

@ -15,10 +15,10 @@
*/
#include "script_component.hpp"
ctrlSetText [200, Str(Round((GVAR(temperature) select GVAR(currentTarget)) * 10) / 10)];
ctrlSetText [200, Str(Round(GVAR(temperature) * 10) / 10)];
if (GVAR(currentUnit) == 1) then {
ctrlSetText [210, Str(Round((GVAR(barometricPressure) select GVAR(currentTarget)) * 100) / 100)];
ctrlSetText [210, Str(Round(GVAR(barometricPressure) * 100) / 100)];
} else {
ctrlSetText [210, Str(Round(GVAR(barometricPressure) select GVAR(currentTarget)))];
ctrlSetText [210, Str(Round(GVAR(barometricPressure)))];
};
ctrlSetText [220, Str(Round((GVAR(relativeHumidity) select GVAR(currentTarget)) * 100 * 10) / 10)];
ctrlSetText [220, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)];

View File

@ -15,39 +15,39 @@
*/
#include "script_component.hpp"
ctrlSetText [1000, (GVAR(workingMemory) select GVAR(currentTarget)) select 0];
ctrlSetText [1000, GVAR(workingMemory) select 0];
if (GVAR(currentUnit) == 1) then
{
ctrlSetText [ 100, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 5) / 2.54 * 100) / 100)];
ctrlSetText [ 100, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)];
} else
{
ctrlSetText [ 100, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 5) * 100) / 100)];
ctrlSetText [ 100, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)];
};
if (GVAR(currentUnit) == 1) then
{
ctrlSetText [ 110, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 12) * 15.4323584))];
ctrlSetText [ 110, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))];
} else
{
ctrlSetText [ 110, Str(Round((GVAR(workingMemory) select GVAR(currentTarget)) select 12))];
ctrlSetText [ 110, Str(Round(GVAR(workingMemory) select 12))];
};
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then {
ctrlSetText [ 120, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 15) * 1000) / 1000)];
ctrlSetText [ 120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)];
} else {
ctrlSetText [ 120, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 4) * -1000 * 1000) / 1000)];
ctrlSetText [ 120, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)];
};
if (GVAR(currentUnit) == 1) then
{
ctrlSetText [130, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 1) * 3.2808399))];
ctrlSetText [130, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))];
} else
{
ctrlSetText [130, Str(Round((GVAR(workingMemory) select GVAR(currentTarget)) select 1))];
ctrlSetText [130, Str(Round(GVAR(workingMemory) select 1))];
};
if (GVAR(currentUnit) == 2) then
{
ctrlSetText [140, Str(Round((GVAR(workingMemory) select GVAR(currentTarget)) select 2))];
ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))];
} else
{
ctrlSetText [140, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 2) * 1.0936133))];
ctrlSetText [140, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))];
};
[] call FUNC(update_scope_unit);

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
private ["_range", "_elevation", "_windage", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"];
private ["_range", "_elevation", "_windage", "_elevationScopeStep", "_windageScopeStep", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"];
_lastColumnOutput = "";
ctrlSetText [5006, (GVAR(rangeCardLastColumns) select GVAR(rangeCardCurrentColumn))];
@ -39,7 +39,7 @@ lnbClear 5007;
_velocity = _x select 5;
_kineticEnergy = _x select 6;
switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do
switch (GVAR(currentScopeUnit)) do
{
case 0:
{
@ -55,8 +55,8 @@ lnbClear 5007;
case 3:
{
_elevationScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 7);
_windageScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 8);
_elevationScopeStep = (GVAR(workingMemory) select 7);
_windageScopeStep = (GVAR(workingMemory) select 8);
_elevation = Round(_elevation / _elevationScopeStep);
_windage = Round(_windage / _windageScopeStep);

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
(GVAR(workingMemory) select GVAR(currentTarget)) set [10, (GVAR(elevationOutput) select GVAR(currentTarget))];
(GVAR(workingMemory) select GVAR(currentTarget)) set [11, (GVAR(windageOutput) select GVAR(currentTarget))];
GVAR(workingMemory) set [10, (GVAR(elevationOutput) select GVAR(currentTarget))];
GVAR(workingMemory) set [11, (GVAR(windageOutput) select GVAR(currentTarget))];
[] call FUNC(update_result);

View File

@ -19,15 +19,15 @@ private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_win
_elevationAbs = (GVAR(elevationOutput) select GVAR(currentTarget));
_windageAbs = (GVAR(windageOutput) select GVAR(currentTarget));
_elevationCur = (GVAR(workingMemory) select GVAR(currentTarget)) select 10;
_windageCur = (GVAR(workingMemory) select GVAR(currentTarget)) select 11;
_elevationCur = GVAR(workingMemory) select 10;
_windageCur = GVAR(workingMemory) select 11;
_elevationRel = _elevationAbs - _elevationCur;
_windageRel = _windageAbs - _windageCur;
_lead = (GVAR(leadOutput) select GVAR(currentTarget));
switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do
switch (GVAR(currentScopeUnit)) do
{
case 0:
{
@ -55,8 +55,8 @@ switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do
case 3:
{
_elevationScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 7);
_windageScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 8);
_elevationScopeStep = (GVAR(workingMemory) select 7);
_windageScopeStep = (GVAR(workingMemory) select 8);
_elevationAbs = Round(_elevationAbs / _elevationScopeStep);
_windageAbs = Round(_windageAbs / _windageScopeStep);

View File

@ -15,5 +15,5 @@
*/
#include "script_component.hpp"
ctrlSetText [2000, GVAR(scopeUnits) select (GVAR(currentScopeUnit) select GVAR(currentTarget))];
ctrlSetText [5000, GVAR(scopeUnits) select (GVAR(currentScopeUnit) select GVAR(currentTarget))];
ctrlSetText [2000, GVAR(scopeUnits) select GVAR(currentScopeUnit)];
ctrlSetText [5000, GVAR(scopeUnits) select GVAR(currentScopeUnit)];

View File

@ -16,16 +16,16 @@
#include "script_component.hpp"
private ["_scopeBaseAngle"];
_scopeBaseAngle = ((GVAR(workingMemory) select GVAR(currentTarget)) select 3);
_scopeBaseAngle = (GVAR(workingMemory) select 3);
private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"];
_bulletMass = (GVAR(workingMemory) select GVAR(currentTarget)) select 12;
_boreHeight = (GVAR(workingMemory) select GVAR(currentTarget)) select 5;
_airFriction = (GVAR(workingMemory) select GVAR(currentTarget)) select 4;
_muzzleVelocity = (GVAR(workingMemory) select GVAR(currentTarget)) select 1;
_bc = (GVAR(workingMemory) select GVAR(currentTarget)) select 15;
_dragModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 16;
_atmosphereModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 17;
_bulletMass = GVAR(workingMemory) select 12;
_boreHeight = GVAR(workingMemory) select 5;
_airFriction = GVAR(workingMemory) select 4;
_muzzleVelocity = GVAR(workingMemory) select 1;
_bc = GVAR(workingMemory) select 15;
_dragModel = GVAR(workingMemory) select 16;
_atmosphereModel = GVAR(workingMemory) select 17;
private ["_zeroRange"];
_zeroRange = Round(parseNumber(ctrlText 140));
@ -34,14 +34,14 @@ if (GVAR(currentUnit) != 2) then
_zeroRange = _zeroRange / 1.0936133;
};
if (_zeroRange < 10) exitWith {
(GVAR(workingMemory) select GVAR(currentTarget)) set [2, _zeroRange];
(GVAR(workingMemory) select GVAR(currentTarget)) set [3, 0];
GVAR(workingMemory) set [2, _zeroRange];
GVAR(workingMemory) set [3, 0];
};
private ["_temperature", "_barometricPressure", "_relativeHumidity"];
_temperature = (GVAR(temperature) select GVAR(currentTarget));
_barometricPressure = (GVAR(barometricPressure) select GVAR(currentTarget));
_relativeHumidity = (GVAR(relativeHumidity) select GVAR(currentTarget));
_temperature = GVAR(temperature);
_barometricPressure = GVAR(barometricPressure);
_relativeHumidity = GVAR(relativeHumidity);
if (GVAR(currentUnit) == 1) then
{
_temperature = (_temperature - 32) / 1.8;
@ -51,5 +51,5 @@ if (GVAR(currentUnit) == 1) then
private ["_result"];
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false] call FUNC(calculate_solution);
(GVAR(workingMemory) select GVAR(currentTarget)) set [2, _zeroRange];
(GVAR(workingMemory) select GVAR(currentTarget)) set [3, _scopeBaseAngle + (_result select 0) / 60];
GVAR(workingMemory) set [2, _zeroRange];
GVAR(workingMemory) set [3, _scopeBaseAngle + (_result select 0) / 60];

View File

@ -22,17 +22,17 @@
_bullet = _args select 0;
_airFriction = _args select 1;
_time = _args select 2;
if (!alive _bullet) exitwith {
[_this select 1] call cba_fnc_removePerFrameHandler;
};
_deltaT = time - _time;
_args set[2, time];
_bulletVelocity = velocity _bullet;
_bulletSpeed = vectorMagnitude _bulletVelocity;
if (!alive _bullet || _bulletSpeed < 100) exitwith {
[_this select 1] call cba_fnc_removePerFrameHandler;
};
_deltaT = time - _time;
_args set[2, time];
if (vectorMagnitude ACE_wind > 0) then {
_trueVelocity = _bulletVelocity vectorDiff ACE_wind;
_trueSpeed = vectorMagnitude _trueVelocity;