mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
delete old resting, farewell
This commit is contained in:
parent
86e5896c73
commit
6c8064097f
@ -1 +0,0 @@
|
||||
z\ace\addons\resting
|
@ -1,12 +0,0 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
};
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -1,14 +0,0 @@
|
||||
class CfgSounds {
|
||||
class GVAR(rest)
|
||||
{
|
||||
name=QGVAR(rest);
|
||||
sound[]={QUOTE(PATHTOF(sounds\weaponrest_rest.wav)),1,1};
|
||||
titles[]={};
|
||||
};
|
||||
class GVAR(unrest)
|
||||
{
|
||||
name=QGVAR(unrest);
|
||||
sound[]={QUOTE(PATHTOF(sounds\weaponrest_unrest.wav)),1,1};
|
||||
titles[]={};
|
||||
};
|
||||
};
|
@ -1,22 +0,0 @@
|
||||
class CfgWeapons {
|
||||
class Rifle_Long_Base_F;
|
||||
class arifle_MX_Base_F;
|
||||
|
||||
class arifle_MX_SW_F : arifle_MX_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
|
||||
class LMG_Mk200_F : Rifle_Long_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
class LMG_Zafir_F: Rifle_Long_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
|
||||
class LRR_base_F : Rifle_Long_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
class GM6_base_F : Rifle_Long_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
};
|
@ -1,12 +0,0 @@
|
||||
ace_resting
|
||||
===========
|
||||
|
||||
Introduces weapon resting and bipod deployment, allowing the player to increase the stability of his weapon.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [KoffeinFlummi](https://github.com/KoffeinFlummi)
|
||||
- [commy2](https://github.com/commy2)
|
@ -1,23 +0,0 @@
|
||||
// by esteldunedain
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(hasInterface) exitWith {};
|
||||
|
||||
// Add keybinds
|
||||
["ACE3", QGVAR(RestWeapon), localize "STR_ACE_Resting_RestWeapon",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
|
||||
{inputAction 'reloadMagazine' == 0} &&
|
||||
{!weaponLowered ACE_player} &&
|
||||
{speed ACE_player < 1}) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon);
|
||||
// Return false so it doesn't block other actions
|
||||
false
|
||||
},
|
||||
{false},
|
||||
[15, [false, false, false]], false] call cba_fnc_addKeybind;
|
@ -1,11 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(getIntersection);
|
||||
PREP(hasBipod);
|
||||
PREP(pfhCheckRest);
|
||||
PREP(restWeapon);
|
||||
PREP(unRestWeapon);
|
||||
|
||||
ADDON = true;
|
@ -1,21 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"KoffeinFlummi", "TaoSensai", "esteldunedain"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
#include "CfgMoves.hpp"
|
||||
|
||||
#include "CfgSounds.hpp"
|
Binary file not shown.
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, edited by commy2 and esteldunedain
|
||||
*
|
||||
* Prepares intersects
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit
|
||||
* 1: vehicle
|
||||
* 2: weapon
|
||||
*
|
||||
* Return Values:
|
||||
* [_intersectsMiddle, _intersectsLeft, _intersectsRight, _intersectsDown]
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
|
||||
|
||||
private ["_weaponPos", "_weaponDir", "_weaponPosDown"];
|
||||
|
||||
_weaponPos = ATLtoASL (_unit modelToWorld (_unit selectionPosition "RightHand"));
|
||||
_weaponDir = _unit weaponDirection _weapon;
|
||||
_weaponPosDown = _weaponPos vectorAdd [0,0,-MAXHEIGHT];
|
||||
|
||||
private ["_checkPosMiddle", "_checkPosLeft", "_checkPosRight", "_checkPosDown"];
|
||||
|
||||
_checkPosMiddle = [
|
||||
(_weaponPos select 0) + MAXDISTANCE * (_weaponDir select 0),
|
||||
(_weaponPos select 1) + MAXDISTANCE * (_weaponDir select 1),
|
||||
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
|
||||
];
|
||||
_checkPosLeft = [
|
||||
(_weaponPos select 0) + MAXDISTANCE * sin (((_weaponDir select 0) atan2 (_weaponDir select 1)) + 360 - MAXANGLE),
|
||||
(_weaponPos select 1) + MAXDISTANCE * cos (((_weaponDir select 0) atan2 (_weaponDir select 1)) + 360 - MAXANGLE),
|
||||
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
|
||||
];
|
||||
_checkPosRight = [
|
||||
(_weaponPos select 0) + MAXDISTANCE * sin (((_weaponDir select 0) atan2 (_weaponDir select 1)) + MAXANGLE),
|
||||
(_weaponPos select 1) + MAXDISTANCE * cos (((_weaponDir select 0) atan2 (_weaponDir select 1)) + MAXANGLE),
|
||||
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
|
||||
];
|
||||
_checkPosDown = [
|
||||
(_weaponPos select 0) + MAXDISTANCE * (_weaponDir select 0),
|
||||
(_weaponPos select 1) + MAXDISTANCE * (_weaponDir select 1),
|
||||
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2) - MAXHEIGHT
|
||||
];
|
||||
|
||||
/* UNCOMMENT THIS FOR DEBUGGING
|
||||
weaponPos = ASLtoATL _weaponPos;
|
||||
weaponPosDown = ASLtoATL _weaponPosDown;
|
||||
checkPosMiddle = ASLtoATL _checkPosMiddle;
|
||||
checkPosLeft = ASLtoATL _checkPosLeft;
|
||||
checkPosRight = ASLtoATL _checkPosRight;
|
||||
checkPosDown = ASLtoATL _checkPosDown;
|
||||
|
||||
onEachFrame {
|
||||
drawLine3D [weaponPos, checkPosMiddle, [1,0,0,1]];
|
||||
drawLine3D [weaponPos, checkPosLeft, [1,0,0,1]];
|
||||
drawLine3D [weaponPos, checkPosRight, [1,0,0,1]];
|
||||
drawLine3D [weaponPosDown, checkPosDown, [1,0,0,1]];
|
||||
};*/
|
||||
|
||||
private ["_intersectsMiddle", "_intersectsLeft", "_intersectsRight", "_intersectsDown"];
|
||||
|
||||
_intersectsMiddle = lineIntersects [_weaponPos, _checkPosMiddle];
|
||||
_intersectsLeft = lineIntersects [_weaponPos, _checkPosLeft];
|
||||
_intersectsRight = lineIntersects [_weaponPos, _checkPosRight];
|
||||
_intersectsDown = lineIntersects [_weaponPos, _checkPosDown] || {terrainIntersectASL [_weaponPosDown, _checkPosDown]};
|
||||
|
||||
[_intersectsMiddle, _intersectsLeft, _intersectsRight, _intersectsDown]
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Author: Commy2
|
||||
*
|
||||
* Check if the weapon has a bipod
|
||||
*
|
||||
* Arguments:
|
||||
* 0: weapon
|
||||
*
|
||||
* Return Values:
|
||||
* Boolean
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_1_PVT(_this,_weapon);
|
||||
|
||||
private ["_config"];
|
||||
_config = configFile >> "CfgWeapons" >> _weapon;
|
||||
|
||||
getNumber (_config >> "ACE_Bipod") == 1 ||
|
||||
getNumber (_config >> "AGM_Bipod") == 1 ||
|
||||
{getNumber (_config >> "tmr_autorest_deployable") == 1}
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, edited by commy2 and esteldunedain
|
||||
*
|
||||
* PFH that check for player moving away, changing weapon, etc
|
||||
* and unrests the weapon if necessary
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit
|
||||
* 1: vehicle
|
||||
* 2: weapon
|
||||
* 3: rested position
|
||||
*
|
||||
* Return Values:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_4_PVT(_params,_unit,_vehicle,_weapon,_restedPosition);
|
||||
|
||||
if !(_unit getVariable ["ACE_weaponRested", false]) exitWith {
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
private ["_intersects"];
|
||||
_intersects = _params call FUNC(getIntersection);
|
||||
|
||||
if (
|
||||
_unit != ACE_player
|
||||
|| {_vehicle != vehicle _unit}
|
||||
|| {inputAction "reloadMagazine" != 0}
|
||||
|| {weaponLowered _unit}
|
||||
|| {speed _unit > 1}
|
||||
|| {currentWeapon _unit != _weapon}
|
||||
|| {getPosASL _unit distanceSqr _restedPosition > 1}
|
||||
|| {!(true in _intersects)}
|
||||
) exitWith {
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
[_unit, _vehicle, _weapon] call FUNC(unRestWeapon);
|
||||
};
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, edited by commy2 and esteldunedain
|
||||
*
|
||||
* Rests the player's weapon if possible.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Values:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
|
||||
|
||||
if (_weapon != primaryWeapon _unit) exitWith {};
|
||||
|
||||
if (_unit getVariable ["ACE_weaponRested", false]) exitWith {_this call FUNC(unRestWeapon)};
|
||||
|
||||
// exit if this is not an available animation
|
||||
if (!isClass (configFile >> "CfgMovesMaleSdr" >> "States" >> format ["%1_ace_deploy", animationState _unit])) exitWith {};
|
||||
|
||||
// CHECK FOR APPROPRIATE SURFACE
|
||||
private "_intersects";
|
||||
_intersects = _this call FUNC(getIntersection);
|
||||
|
||||
if (true in _intersects) then {
|
||||
_unit setVariable ["ACE_weaponRested", true];
|
||||
if (_unit == ACE_PLAYER) then {
|
||||
[QGVAR(bipodDeployed), true, QUOTE(PATHTOF(data\icons\icon_bipod.paa)), [1,1,1,1], -1] call EFUNC(common,displayIcon);
|
||||
};
|
||||
|
||||
private "_restedPosition";
|
||||
_restedPosition = getPosASL _unit;
|
||||
|
||||
// REST THE WEAPON
|
||||
addCamShake CAMSHAKE;
|
||||
playSound QGVAR(rest);
|
||||
|
||||
if ([_weapon] call FUNC(hasBipod) && {_intersects select 3}) then {
|
||||
_unit setVariable ["ACE_bipodDeployed", true];
|
||||
|
||||
_unit setUnitRecoilCoefficient (BIPODRECOIL * unitRecoilCoefficient _unit);
|
||||
//[_unit, format ["%1_ace_deploy", animationState _unit], 2] call EFUNC(common,doAnimation);
|
||||
_unit switchMove format ["%1_ace_deploy", animationState _unit];
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_ACE_Resting_BipodDeployed", _picture] call EFUNC(common,displayTextPicture);
|
||||
|
||||
} else {
|
||||
_unit setVariable ["ACE_bipodDeployed", false];
|
||||
|
||||
_unit setUnitRecoilCoefficient (RESTEDRECOIL * unitRecoilCoefficient _unit);
|
||||
//[_unit, format ["%1_ace_rested", animationState _unit], 2] call EFUNC(common,doAnimation);
|
||||
_unit switchMove format ["%1_ace_rested", animationState _unit];
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_ACE_Resting_WeaponRested", _picture] call EFUNC(common,displayTextPicture);
|
||||
};
|
||||
|
||||
// Launch a PFH to check for player moving away, changing weapon, etc
|
||||
[FUNC(pfhCheckRest), 0.2, [_unit, _vehicle, _weapon, _restedPosition] ] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, edited by commy2 and esteldunedain
|
||||
*
|
||||
* Un Rests the player's weapon
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit
|
||||
* 1: vehicle
|
||||
* 2: weapon
|
||||
*
|
||||
* Return Values:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
|
||||
|
||||
addCamShake CAMSHAKE;
|
||||
|
||||
private "_animation";
|
||||
_animation = animationState _unit;
|
||||
|
||||
if (_unit getVariable ["ACE_bipodDeployed", false]) then {
|
||||
_unit setUnitRecoilCoefficient (unitRecoilCoefficient _unit / BIPODRECOIL);
|
||||
if (_animation find "_ace_deploy" != -1) then {
|
||||
//[_unit, [_animation, "_ace_deploy", ""] call CBA_fnc_replace, 2] call EFUNC(common,doAnimation);
|
||||
_unit switchMove ([_animation, "_ace_deploy", ""] call CBA_fnc_replace);
|
||||
};
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_ACE_Resting_BipodUndeployed", _picture] call EFUNC(common,displayTextPicture);
|
||||
|
||||
} else {
|
||||
_unit setUnitRecoilCoefficient (unitRecoilCoefficient _unit / RESTEDRECOIL);
|
||||
if (_animation find "_ace_rested" != -1) then {
|
||||
//[_unit, [_animation, "_ace_rested", ""] call CBA_fnc_replace, 2] call EFUNC(common,doAnimation);
|
||||
_unit switchMove ([_animation, "_ace_rested", ""] call CBA_fnc_replace);
|
||||
};
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_ACE_Resting_WeaponLifted", _picture] call EFUNC(common,displayTextPicture);
|
||||
};
|
||||
playSound QGVAR(unrest);
|
||||
|
||||
_unit setVariable ["ACE_weaponRested", false];
|
||||
_unit setVariable ["ACE_bipodDeployed", false];
|
||||
|
||||
if (_unit == ACE_PLAYER) then {
|
||||
[QGVAR(bipodDeployed), false, "", [1,1,1,1], -1] call EFUNC(common,displayIcon);
|
||||
};
|
@ -1 +0,0 @@
|
||||
#include "\z\ace\addons\resting\script_component.hpp"
|
@ -1,19 +0,0 @@
|
||||
#define COMPONENT resting
|
||||
#include "\z\ace\Addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_RESTING
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_RESTING
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_RESTING
|
||||
#endif
|
||||
|
||||
#include "\z\ace\Addons\main\script_macros.hpp"
|
||||
|
||||
#define RESTEDRECOIL 0.6
|
||||
#define BIPODRECOIL 0.3
|
||||
#define MAXDISTANCE 1
|
||||
#define MAXANGLE 15
|
||||
#define MAXHEIGHT 0.45
|
||||
#define CAMSHAKE [1,0.5,5]
|
Binary file not shown.
Binary file not shown.
@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Resting">
|
||||
|
||||
<Key ID="STR_ACE_Resting_RestWeapon">
|
||||
<English>Rest Weapon</English>
|
||||
<German>Waffe auflegen</German>
|
||||
<Spanish>Apoyar el arma</Spanish>
|
||||
<Polish>Oprzyj broń</Polish>
|
||||
<Czech>Zapřít zbraň</Czech>
|
||||
<French>Appuyer l'arme</French>
|
||||
<Russian>Зафиксировать оружие</Russian>
|
||||
<Hungarian>Fegyver kitámasztása</Hungarian>
|
||||
<Portuguese>Apoiar Arma</Portuguese>
|
||||
<Italian>Appoggia l'arma</Italian>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_ACE_Resting_BipodDeployed">
|
||||
<English>Bipod deployed</English>
|
||||
<German>Zweibein ausgeklappt</German>
|
||||
<Spanish>Bípode desplegado</Spanish>
|
||||
<Polish>Dwójnóg rozstawiony</Polish>
|
||||
<Czech>Dvojnožka rozložena</Czech>
|
||||
<French>Bipied déployé</French>
|
||||
<Russian>Сошки установлены</Russian>
|
||||
<Hungarian>Állványon</Hungarian>
|
||||
<Portuguese>Bipé apoiado</Portuguese>
|
||||
<Italian>Bipiede appoggiato</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Resting_WeaponRested">
|
||||
<English>Weapon rested</English>
|
||||
<German>Waffe aufgelegt</German>
|
||||
<Spanish>Arma apoyada</Spanish>
|
||||
<Polish>Broń oparta</Polish>
|
||||
<Czech>Zbraň zapřena</Czech>
|
||||
<French>Arme appuyée</French>
|
||||
<Russian>Оружие зафиксировано</Russian>
|
||||
<Hungarian>Fegyver kitámasztva</Hungarian>
|
||||
<Portuguese>Arma apoiada</Portuguese>
|
||||
<Italian>Arma appoggiata</Italian>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_ACE_Resting_BipodUndeployed">
|
||||
<English>Bipod undeployed</English>
|
||||
<German>Zweibein eingeklappt</German>
|
||||
<Spanish>Bípode plegado</Spanish>
|
||||
<Polish>Dwójnóg złożony</Polish>
|
||||
<Czech>Dvojnožka rozložena</Czech>
|
||||
<French>Bipied replié</French>
|
||||
<Russian>Сошки убраны</Russian>
|
||||
<Hungarian>Állvány csukva</Hungarian>
|
||||
<Portuguese>Bipé recolhido</Portuguese>
|
||||
<Italian>Bipiede richiuso</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Resting_WeaponLifted">
|
||||
<English>Weapon lifted</English>
|
||||
<German>Waffe gehoben</German>
|
||||
<Spanish>Arma levantada</Spanish>
|
||||
<Polish>Broń podniesiona</Polish>
|
||||
<Czech>Zbraň zdvihnuta</Czech>
|
||||
<French>Arme relevée</French>
|
||||
<Russian>Оружие не зафиксировано</Russian>
|
||||
<Hungarian>Fegyver nincs támasztva</Hungarian>
|
||||
<Portuguese>Arma levantada</Portuguese>
|
||||
<Italian>Arma sollevata</Italian>
|
||||
</Key>
|
||||
|
||||
</Package>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user