mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cleanup and debug
Fix missing weapon configs Fix Dispersion (Radians / Degrees) Fix comment
This commit is contained in:
parent
42b350a40c
commit
415402b5ad
@ -1,7 +1,7 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||
};
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
@ -13,7 +13,7 @@ class Extended_PostInit_EventHandlers {
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class CAManBase {
|
||||
class GVAR(Overheat) {
|
||||
firedBIS = QUOTE(_this call FUNC(firedEH));
|
||||
clientFiredBIS = QUOTE(_this call FUNC(firedEH));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -16,12 +16,37 @@ class CfgWeapons {
|
||||
class RifleCore;
|
||||
class Rifle: RifleCore {
|
||||
//Mean Rounds Between Stoppages (this will be scaled based on the barrel temp)
|
||||
ACE_MRBS = 3000;
|
||||
|
||||
ACE_MRBS = 3000;
|
||||
|
||||
//Dispersion Factor (this will be scaled based on the barrel temp)
|
||||
ACE_Dispersion = 1;
|
||||
|
||||
|
||||
//Slowdown Factor (this will be scaled based on the barrel temp)
|
||||
ACE_SlowdownFactor = 1;
|
||||
};
|
||||
class Rifle_Base_F : Rifle {};
|
||||
class Rifle_Long_Base_F : Rifle_Base_F {
|
||||
ACE_Dispersion = 0.75;
|
||||
};
|
||||
|
||||
class arifle_MX_Base_F : Rifle_Base_F {
|
||||
ACE_clearJamAction = "GestureReloadMX"; // Custom jam clearing action. Default uses reload animation.
|
||||
};
|
||||
class arifle_MX_SW_F : arifle_MX_Base_F {
|
||||
ACE_clearJamAction = ""; // Custom jam clearing action. Use empty string to undefine.
|
||||
ACE_Overheating_allowSwapBarrel = 1; // 1 to enable barrel swap. 0 to disable. Meant for machine guns where you can easily swap the barrel without dismantling the whole weapon.
|
||||
ACE_Dispersion = 0.75;
|
||||
};
|
||||
class MMG_01_base_F: Rifle_Long_Base_F {
|
||||
ACE_Overheating_allowSwapBarrel = 1;
|
||||
};
|
||||
class MMG_02_base_F: Rifle_Long_Base_F {
|
||||
ACE_Overheating_allowSwapBarrel = 1;
|
||||
};
|
||||
class LMG_Zafir_F : Rifle_Long_Base_F {
|
||||
ACE_Overheating_allowSwapBarrel = 1;
|
||||
};
|
||||
class LMG_Mk200_F : Rifle_Long_Base_F {
|
||||
ACE_Overheating_allowSwapBarrel = 1;
|
||||
};
|
||||
};
|
||||
|
@ -43,7 +43,7 @@ private _scaledTemperature = linearConversion [0, 1000, _temperature, 0, 1, true
|
||||
TRACE_3("",_variableName,_temperature,_scaledTemperature);
|
||||
|
||||
//Get weapon data from cache:
|
||||
_weaponData = GVAR(weaponInfoCache) getVariable _weapon;
|
||||
private _weaponData = GVAR(weaponInfoCache) getVariable _weapon;
|
||||
if (isNil "_weaponData") then {
|
||||
private _dispersion = if (isNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_Dispersion")) then {
|
||||
getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_Dispersion");
|
||||
@ -74,7 +74,9 @@ if (GVAR(overheatingDispersion)) then {
|
||||
// Exit if GVAR(pseudoRandomList) isn't synced yet
|
||||
if (isNil QGVAR(pseudoRandomList)) exitWith {ACE_LOGERROR("No pseudoRandomList sync");};
|
||||
|
||||
_dispersion = (_dispersion * ([[0,1,2,4], 3 * _scaledTemperature] call EFUNC(common,interpolateFromArray))) max 0;
|
||||
//Dispersion: 0 mils @ 0°C, 0.5 mils @ 333°C, 2.2 mils @ 666°C, 5 mils at 1000°C
|
||||
_dispersion = _dispersion * 0.28125 * (_scaledTemperature^2);
|
||||
|
||||
_slowdownFactor = _slowdownFactor * linearConversion [0.666, 1, _scaledTemperature, 0, -0.1, true];
|
||||
|
||||
// Get the pseudo random values for dispersion from the remaining ammo count
|
||||
@ -82,7 +84,9 @@ if (GVAR(overheatingDispersion)) then {
|
||||
|
||||
TRACE_4("change",_dispersion,_slowdownFactor,_dispersionX,_dispersionY);
|
||||
|
||||
TRACE_PROJECTILE_INFO(_projectile);
|
||||
[_projectile, _dispersionX * _dispersion, _dispersionY * _dispersion, _slowdownFactor * vectorMagnitude (velocity _projectile)] call EFUNC(common,changeProjectileDirection);
|
||||
TRACE_PROJECTILE_INFO(_projectile);
|
||||
};
|
||||
|
||||
// ------ LOCAL PLAYER ONLY ------------
|
||||
@ -112,7 +116,7 @@ if (GVAR(showParticleEffects) && {(ACE_time > ((_unit getVariable [QGVAR(lastDro
|
||||
private _direction = (_unit weaponDirection _weapon) vectorMultiply 0.25;
|
||||
private _position = (position _projectile) vectorAdd (_direction vectorMultiply (4*(random 0.30)));
|
||||
|
||||
// Refract SFX, beginning at temp 100º and maxs out at 500º
|
||||
// Refract SFX, beginning at temp 100°C and maxs out at 500°C
|
||||
private _intensity = linearConversion [0.1, 0.5, _scaledTemperature, 0, 1, true];
|
||||
TRACE_3("refract",_direction,_position,_intensity);
|
||||
if (_intensity > 0) then {
|
||||
@ -120,7 +124,7 @@ if (GVAR(showParticleEffects) && {(ACE_time > ((_unit getVariable [QGVAR(lastDro
|
||||
"\A3\data_f\ParticleEffects\Universal\Refract", "", "Billboard", 10, 2, _position, _direction, 0, 1.2, 1.0,
|
||||
0.1, [0.10,0.25], [[0.6,0.6,0.6,0.3*_intensity],[0.2,0.2,0.2,0.05*_intensity]], [0,1], 0.1, 0.05, "", "", ""];
|
||||
};
|
||||
// Smoke SFX, beginning at temp 150º
|
||||
// Smoke SFX, beginning at temp 150°C
|
||||
private _intensity = linearConversion [0.15, 1, _scaledTemperature, 0, 1, true];
|
||||
TRACE_3("smoke",_direction,_position,_intensity);
|
||||
if (_intensity > 0) then {
|
||||
|
@ -12,4 +12,11 @@
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_OVERHEATING
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
#define TRACE_PROJECTILE_INFO(BULLET) _vdir = vectorNormalized velocity BULLET; _dir = (_vdir select 0) atan2 (_vdir select 1); _up = asin (_vdir select 2); _mv = vectorMagnitude velocity BULLET; TRACE_3("adjusted projectile",_dir,_up,_mv);
|
||||
#else
|
||||
#define TRACE_PROJECTILE_INFO(BULLET) /* noDebug */
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user