Merge branch 'master' of github.com:KoffeinFlummi/ACE3 into nametagsOptimization

This commit is contained in:
esteldunedain 2016-02-08 12:52:49 -03:00
commit 94977ffe5c
368 changed files with 4337 additions and 1613 deletions

View File

@ -53,6 +53,7 @@ Coren <coren4@gmail.com>
Crusty
Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
Dimaslg <dimaslg@telecable.es>
dixon13 <dixonbegay@gmail.com>
Drill <drill87@gmail.com>
Dudakov aka [OMCB]Kaban <dudakov.s@gmail.com>
Dslyecxi <dslyecxi@gmail.com>
@ -63,11 +64,13 @@ Falke75
Ferenczi
Ferenzi
Filip Basara <filip.basara93@googlemail.com>
fr89k <kaschitoku@web.de>
FreeZbe <freeseb@gmail.com>
geraldbolso1899
Ghost
Gianmarco Varriale (TeamNuke) <admin@forhost.org>
GieNkoV <gienkov.grzegorz@gmail.com>
GitHawk <githawk@gmx.net>
gpgpgpgp
Grzegorz
Hamburger SV
@ -103,6 +106,7 @@ Robert Boklahánics <bokirobi@gmail.com>
ruPaladin <happyworm24@rambler.ru>
simon84 <badguy360th@gmail.com>
Sniperwolf572 <tenga6@gmail.com>
System98
SzwedzikPL <szwedzikpl@gmail.com>
Tachi <zaveruha007@gmail.com>
Toaster <jonathan.pereira@gmail.com>
@ -113,3 +117,4 @@ voiper
VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
Winter <simon@agius-muscat.net>
zGuba
Grey-Soldierman <gungamer101@hotmail.com>

View File

@ -1,5 +1,5 @@
<p align="center">
<img src="https://github.com/acemod/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg" width="480">
<img src="https://github.com/acemod/ACE3/raw/master/extras/assets/logo/black/ACE3-Logo.jpg" width="480">
</p>
<p align="center">

View File

@ -1,6 +1,11 @@
#define COMPONENT advanced_ballistics
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_ADVANCEDBALLISTICS
#define DEBUG_MODE_FULL
#endif

View File

@ -10,7 +10,7 @@
<Spanish>Mostrar información del viento</Spanish>
<German>Windinformationen anzeigen</German>
<Hungarian>Széladatok mutatása</Hungarian>
<Czech>Zobrazit informace o větru</Czech>
<Czech>Zobrazit údaje o větru</Czech>
<Portuguese>Mostrar Informação do Vento</Portuguese>
</Key>
<Key ID="STR_ACE_Advanced_Ballistics_ProtractorKey">
@ -74,7 +74,7 @@
<Spanish>Activa la balística avanzada para francotiradores no locales (cuando se usa una mira telescópica)</Spanish>
<Polish>Aktywuje zaawansowaną balistykę dla nielokalnych snajperów (kiedy używają optyki)</Polish>
<German>Aktiviert die erweiterte Ballistik für nicht lokale Scharfschützen (bei Benutzung von Optiken mit starker Vergrößerung)</German>
<Czech>Aktivuje pokročilou balistiku pro nelokální odstřelovače (když používá výkonnou optiku)</Czech>
<Czech>Aktivuje pokročilou balistiku pro nelokální odstřelovače (při použití optiky)</Czech>
<Portuguese>Ativa balística avançada para caçadores não locais (quando usando miras telescópicas)</Portuguese>
<French>Active la balistique avancée pour les snipers non locaux (en utilisant les optiques avancées)</French>
<Hungarian>Engedélyezi a fejlett ballisztikát nem-helyi mesterlövészeknek (nagy-teljesítményű optika használatakor)</Hungarian>
@ -118,7 +118,7 @@
<Spanish>Activada la balística avanzada para todos los jugadores no locales (activarlo puede degradar el rendimiento durante grandes tiroteos en multijugador).</Spanish>
<Polish>Aktywuje zaawansowaną balistykę dla wszystkich nielokalnych graczy (aktywacja tej opcji może spodowować spory spadek wydajności podczas ciężkiej wymiany ognia)</Polish>
<German>Aktiviert die erweiterte Ballistik für alle nicht lokalen Spieler (das Aktivieren dieser Funktion kann zur Beeinträchtigung des Spielerlebnisses im Multiplayer führen)</German>
<Czech>Aktivovat pokročilou balistiku pro všechny nelokální hráče (aktivace této možnosti způsobuje pokles snímu za sekundu během těžké přestřelky v multiplayeru)</Czech>
<Czech>Aktivuje pokročilou balistiku pro všechny nelokální hráče (aktivace této možnosti způsobuje pokles FPS během velké přestřelky v multiplayeru)</Czech>
<Portuguese>Ativa balística avançada para todos os jogadores não locais (ativando isso pode degradar a performance durante troca de tiros intensas no multiplayer)</Portuguese>
<French>Active la balistique avancé pour tous les joueurs non locaux (activer cette option peut avoir un impact sur les performance en multi durant les grands échanges de tirs)</French>
<Hungarian>Engedélyezi a fejlett ballisztikát az összes nem-helyi játékosnak (ez a funkció leronthatja a teljesítményt intenzív többjátékos tűzharcok alatt)</Hungarian>
@ -289,4 +289,4 @@
<Spanish>Este módulo permite la simulación balística avanzada - es decir, la trayectoria de los proyectiles está influenciada por variables como la temperatura del aire, la presión atmosférica, la humedad, la gravedad, el tipo de municiones y el arma desde el que fue disparada.</Spanish>
</Key>
</Package>
</Project>
</Project>

View File

@ -1,6 +1,11 @@
#define COMPONENT ai
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_AI
#define DEBUG_MODE_FULL
#endif

View File

@ -1,6 +1,11 @@
#define COMPONENT aircraft
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_AIRCRAFT
#define DEBUG_MODE_FULL
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,75 @@
ambient[]={1,1,1,1};
diffuse[]={2,2,2,0};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.054000214,0.054000214,0.058000047,0};
specularPower=50.700001;
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1
{
texture="z\ace\addons\apl\data\entrchtool_nohq.paa";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage2
{
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
uvSource="tex";
class uvTransform
{
aside[]={4,0,0};
up[]={0,6,0};
dir[]={0,0,2};
pos[]={0,0,0};
};
Filter="Anizotropic";
};
class Stage3
{
texture="#(argb,8,8,3)color(0,0,0,0,MC)";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
Filter="Anizotropic";
};
class Stage4
{
texture="z\ace\addons\apl\data\entrchtool_as.paa";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage5
{
texture="z\ace\addons\apl\data\entrchtool_smdi.paa";
uvSource="tex";
class uvTransform
{
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage6
{
texture="a3\data_f\env_co.paa";
uvSource="none";
};

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,11 @@
#define COMPONENT APL
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_APL
#define DEBUG_MODE_FULL
#endif

View File

@ -1,6 +1,11 @@
#define COMPONENT atragmx
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_ATRAGMX
#define DEBUG_MODE_FULL
#endif

View File

@ -1,6 +1,11 @@
#define COMPONENT attach
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_ATTACH
#define DEBUG_MODE_FULL
#endif

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Attach">
<Key ID="STR_ACE_Attach_AttachDetach">
@ -7,7 +7,7 @@
<Spanish>Acoplar objeto &gt;&gt;</Spanish>
<Polish>Przyczep &gt;&gt;</Polish>
<French>Attacher l'objet &gt;&gt;</French>
<Czech>Připnout předmět &gt;&gt;</Czech>
<Czech>Připnout &gt;&gt;</Czech>
<Portuguese>Fixar item &gt;&gt;</Portuguese>
<Italian>Attacca l'oggetto &gt;&gt;</Italian>
<Hungarian>Tárgy hozzácsatolása &gt;&gt;</Hungarian>
@ -115,7 +115,7 @@
<Spanish>Sin espacio en inventario</Spanish>
<Polish>Brak miejsca w ekwipunku</Polish>
<French>Pas de place dans l'inventaire</French>
<Czech>Není místo v inventáři</Czech>
<Czech>Nedostatek místa v inventáři</Czech>
<Portuguese>Sem espaço no inventário</Portuguese>
<Italian>Non hai più spazio</Italian>
<Hungarian>Nincs több hely</Hungarian>
@ -175,7 +175,7 @@
<German>Befestigen fehlgeschlagen</German>
<Russian>Не удалось присоединить</Russian>
<Spanish>Error al acoplar</Spanish>
<Czech>Připnutí selhalo</Czech>
<Czech>Připnout přesmět se nezdařilo</Czech>
<Portuguese>Erro ao fixar</Portuguese>
<Polish>Przyczepianie nie powiodło się</Polish>
<Hungarian>Hozzácsatolás sikertelen</Hungarian>
@ -187,7 +187,7 @@
<Spanish>%1&lt;br/&gt;acoplada</Spanish>
<Polish>Przyczepiono&lt;br/&gt;%1</Polish>
<French>%1&lt;br/&gt;attachée</French>
<Czech>%1&lt;br/&gt;Připnutý</Czech>
<Czech>%1&lt;br/&gt;Připnuto</Czech>
<Portuguese>%1&lt;br/&gt;Fixada</Portuguese>
<Italian>%1&lt;br/&gt;attaccata</Italian>
<Hungarian>%1&lt;br/&gt;hozzácsatolva</Hungarian>
@ -199,7 +199,7 @@
<Spanish>%1&lt;br/&gt;quitada</Spanish>
<Polish>Odczepiono&lt;br/&gt;%1</Polish>
<French>%1&lt;br/&gt;détachée</French>
<Czech>%1&lt;br/&gt;Odepnutý</Czech>
<Czech>%1&lt;br/&gt;Odepnuto</Czech>
<Portuguese>%1&lt;br/&gt;Separada</Portuguese>
<Italian>%1&lt;br/&gt;staccata</Italian>
<Hungarian>%1&lt;br/&gt;lecsatolva</Hungarian>

View File

@ -1,6 +1,11 @@
#define COMPONENT backpacks
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_BACKPACKS
#define DEBUG_MODE_FULL
#endif

View File

@ -1,6 +1,11 @@
#define COMPONENT ballistics
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_BALLISTICS
#define DEBUG_MODE_FULL
#endif

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Ballistics">
<!-- MX -->
@ -33,7 +33,7 @@
<Spanish>Calibre: 6,5x39mm Trazadoras IR-DIM&lt;br /&gt;Balas: 30&lt;br /&gt;Se usa en: MX/C/M/SW/3GL</Spanish>
<French>Calibre: 6,5x39mm Traçantes IR-DIM&lt;br /&gt;Cartouches: 30&lt;br /&gt;Utilisé avec: MX/C/M/SW/3GL</French>
<Polish>Kaliber: 6,5x39mm Smugacz IR-DIM&lt;br /&gt;Pociski: 30&lt;br /&gt;Używane w: MX/C/M/SW/3GL</Polish>
<Czech>Ráže: 6.5x39mm Svítící IR-DIM&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: MX/C/M/SW/3GL</Czech>
<Czech>Ráže: 6.5x39mm Svítící IR-DIM&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: MX</Czech>
<Portuguese>Calibre: 6,5x39mm Traçante IR-DIM&lt;br /&gt;Projéteis: 30&lt;br /&gt;Usado em: MX/C/M/SW/3GL</Portuguese>
<Italian>Calibro: 6.5x39mm Traccianti IR-DIM &lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: MX/C/M/SW/3GL</Italian>
<Russian>Калибр: 6,5x39 мм ИК-трассирующие&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются с: MX/C/M/SW/3GL</Russian>
@ -69,7 +69,7 @@
<Spanish>Calibre: 6,5x39mm SD&lt;br /&gt;Balas: 30&lt;br /&gt;Se usa en: MX/C/M/SW/3GL</Spanish>
<French>Calibre: 6,5x39mm SD&lt;br /&gt;Cartouches: 30&lt;br /&gt;Utilisé avec: MX/C/M/SW/3GL</French>
<Polish>Kaliber: 6,5x39mm SD&lt;br /&gt;Pociski: 30&lt;br /&gt;Używane w: MX/C/M/SW/3GL</Polish>
<Czech>Ráže: 6.5x39mm SD&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: MX/C/M/SW/3GL</Czech>
<Czech>Ráže: 6.5x39mm SD&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: MX</Czech>
<Portuguese>Calibre: 6,5x39mm SD&lt;br /&gt;Projéteis: 30&lt;br /&gt;Usado em: MX/C/M/SW/3GL</Portuguese>
<Italian>Calibro: 6.5x39mm Sil.&lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: MX/C/M/SW/3GL </Italian>
<Russian>Калибр: 6,5x39 мм дозвуковые&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются с: MX/C/M/SW/3GL</Russian>
@ -105,7 +105,7 @@
<Spanish>Calibre: 6,5x39mm AP&lt;br /&gt;Balas: 30&lt;br /&gt;Se usa en: MX/C/M/SW/3GL</Spanish>
<French>Calibre: 6,5x39mm AP&lt;br /&gt;Cartouches: 30&lt;br /&gt;Utilisé avec: MX/C/M/SW/3GL</French>
<Polish>Kaliber: 6,5x39mm AP&lt;br /&gt;Pociski: 30&lt;br /&gt;Używane w: MX/C/M/SW/3GL</Polish>
<Czech>Ráže: 6.5x39mm AP&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: MX/C/M/SW/3GL</Czech>
<Czech>Ráže: 6.5x39mm AP&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: MX</Czech>
<Portuguese>Calibre: 6,5x39mm AP&lt;br /&gt;Projéteis: 30&lt;br /&gt;Usado em: MX/C/M/SW/3GL</Portuguese>
<Italian>Calibro: 6.5x39mm AP&lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: MX/C/M/SW/3GL</Italian>
<Russian>Калибр: 6,5x39 мм бронебойные&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются с: MX/C/M/SW/3GL</Russian>
@ -142,7 +142,7 @@
<Spanish>Calibre: 6,5x39mm Trazadoras IR-DIM&lt;br /&gt;Balas: 30&lt;br /&gt;Se usa en: Katiba</Spanish>
<French>Calibre: 6,5x39mm Traçantes IR-DIM&lt;br /&gt;Cartouches: 30&lt;br /&gt;Utilisé avec: Katiba</French>
<Polish>Kaliber: 6,5x39mm Smugacz IR-DIM&lt;br /&gt;Pociski: 30&lt;br /&gt;Używane w: Katiba</Polish>
<Czech>Ráže: 6.5x39mm Svítící IR-DIM&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: Katiba</Czech>
<Czech>Ráže: 6.5x39mm Svítící IR-DIM&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: KH 2002 Sama</Czech>
<Portuguese>Calibre: 6,5x39mm Traçante IR-DIM&lt;br /&gt;Projéteis: 30&lt;br /&gt;Usado em: Katiba</Portuguese>
<Italian>Calibro: 6.5x39mm Tracciant IR-DIM&lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: Katiba</Italian>
<Russian>Калибр: 6,5x39 мм ИК-трассирующие&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются с: Katiba</Russian>
@ -178,7 +178,7 @@
<Spanish>Calibre: 6,5x39mm SD&lt;br /&gt;Balas: 30&lt;br /&gt;Se usa en: Katiba</Spanish>
<French>Calibre: 6,5x39mm SD&lt;br /&gt;Cartouches: 30&lt;br /&gt;Utilisé avec: Katiba</French>
<Polish>Kaliber: 6,5x39mm SD&lt;br /&gt;Naboje: 30&lt;br /&gt;Używane w: Katiba</Polish>
<Czech>Ráže: 6.5x39mm SD&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: Katiba</Czech>
<Czech>Ráže: 6.5x39mm SD&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: KH 2002 Sama</Czech>
<Portuguese>Calibre: 6,5x39mm SD&lt;br /&gt;Projéteis: 30&lt;br /&gt;Usado em: Katiba</Portuguese>
<Italian>Calibro: 6.5x39mm Sil.&lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: Katiba</Italian>
<Russian>Калибр: 6,5x39 мм дозвуковые&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются с: Katiba</Russian>
@ -214,7 +214,7 @@
<Spanish>Calibre: 6,5x39mm AP&lt;br /&gt;Balas: 30&lt;br /&gt;Se usa en: Katiba</Spanish>
<French>Calibre: 6,5x39mm AP&lt;br /&gt;Cartouches: 30&lt;br /&gt;Utilisé avec: Katiba</French>
<Polish>Kaliber: 6,5x39mm AP&lt;br /&gt;Pociski: 30&lt;br /&gt;Używane w: Katiba</Polish>
<Czech>Ráže: 6.5x39mm AP&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: Katiba</Czech>
<Czech>Ráže: 6.5x39mm AP&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: KH 2002 Sama</Czech>
<Portuguese>Calibre: 6,5x39mm AP&lt;br /&gt;Projéteis: 30&lt;br /&gt;Usado em: Katiba</Portuguese>
<Italian>Calibro: 6.5x39mm AP&lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: Katiba</Italian>
<Russian>Калибр: 6,5x39 мм бронебойные&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются с: Katiba</Russian>
@ -251,7 +251,7 @@
<Spanish>Calibre: 5,56x45mm Trazadoras IR-DIM&lt;br /&gt;Balas: 30&lt;br /&gt;Se usa en: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Spanish>
<French>Calibre: 5,56x45mm Traçantes IR-DIM&lt;br /&gt;Cartouches: 30&lt;br /&gt;Utilisé avec: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</French>
<Polish>Kaliber: 5,56x45mm Smugacz IR-DIM&lt;br /&gt;Pociski: 30&lt;br /&gt;Używane w: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Polish>
<Czech>Ráže: 5.56x45mm Svítící IR-DIM&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Czech>
<Czech>Ráže: 5.56x45mm Svítící IR-DIM&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: CTAR-21, TAR-21, F2000, RFB SDAR</Czech>
<Portuguese>Calibre: 5,56x45mm Traçante IR-DIM&lt;br /&gt;Projéteis: 30&lt;br /&gt;Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Portuguese>
<Italian>Calibro: 5.56x45mm Traccianti IR-DIM&lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Italian>
<Russian>Калибр: 5,56x45 мм ИК-трассирующие&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются с: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Russian>
@ -288,7 +288,7 @@
<Spanish>Calibre: 7,62x51mm Trazadora&lt;br /&gt;Balas: 20&lt;br /&gt;Se usa en: Mk18 ABR</Spanish>
<French>Calibre: 7,62x51mm Traçantes&lt;br /&gt;Cartouches: 20&lt;br /&gt;Utilisé avec: EBR</French>
<Polish>Kaliber: 7,62x51mm Smugacz&lt;br /&gt;Pociski: 20&lt;br /&gt;Używane w: Mk18 ABR</Polish>
<Czech>Ráže: 7.62x51mm Svítící&lt;br /&gt;Munice: 20&lt;br /&gt;Použití: Mk18 ABR</Czech>
<Czech>Ráže: 7.62x51mm Svítící&lt;br /&gt;Nábojů: 20&lt;br /&gt;Použití u: Mk14 Mod 1 EBR</Czech>
<Portuguese>Calibre: 7,62x51mm Traçante&lt;br /&gt;Projéteis: 20&lt;br /&gt;Usado em: Mk18 ABR</Portuguese>
<Italian>Calibro: 7.62x51mm Traccianti&lt;br /&gt;Munizioni: 20&lt;br /&gt;In uso su: Mk18 ABR</Italian>
<Russian>Калибр: 7,62x51 мм трассирующие&lt;br /&gt;Патронов: 20&lt;br /&gt;Используются с: Mk18 ABR</Russian>
@ -324,7 +324,7 @@
<Spanish>Calibre: 7,62x51mm Trazadoras IR-DIM&lt;br /&gt;Balas: 20&lt;br /&gt;Se usa en: Mk18 ABR</Spanish>
<French>Calibre: 7,62x51mm Traçantes IR-DIM&lt;br /&gt;Cartouches: 20&lt;br /&gt;Utilisé avec: EBR</French>
<Polish>Kaliber: 7,62x51mm Smugacz IR-DIM&lt;br /&gt;Pociski: 20&lt;br /&gt;Używane w: Mk18 ABR</Polish>
<Czech>Ráže: 7.62x51mm Svítící IR-DIM&lt;br /&gt;Munice: 20&lt;br /&gt;Použití: Mk18 ABR</Czech>
<Czech>Ráže: 7.62x51mm Svítící IR-DIM&lt;br /&gt;Nábojů: 20&lt;br /&gt;Použití u: Mk14 Mod 1 EBR</Czech>
<Portuguese>Calibre: 7,62x51mm Traçante IR-DIM&lt;br /&gt;Projéteis: 20&lt;br /&gt;Usado em: Mk18 ABR</Portuguese>
<Italian>Calibro: 7.62x51mm Traccianti IR-DIM&lt;br /&gt;Munizioni: 20&lt;br /&gt;In uso su: Mk18 ABR</Italian>
<Russian>Калибр: 7,62x51 мм ИК-трассирующие&lt;br /&gt;Патронов: 20&lt;br /&gt;Используются с: Mk18 ABR</Russian>
@ -360,7 +360,7 @@
<Spanish>Calibre: 7,62x51mm SD&lt;br /&gt;Balas: 20&lt;br /&gt;Se usa en: Mk18 ABR</Spanish>
<French>Calibre: 7,62x51mm SD&lt;br /&gt;Cartouches: 20&lt;br /&gt;Utilisé avec: EBR</French>
<Polish>Kaliber: 7,62x51mm SD&lt;br /&gt;Pociski: 20&lt;br /&gt;Używane w: Mk18 ABR</Polish>
<Czech>Ráže: 7.62x51mm SD&lt;br /&gt;Munice: 20&lt;br /&gt;Použití: Mk18 ABR</Czech>
<Czech>Ráže: 7.62x51mm SD&lt;br /&gt;Nábojů: 20&lt;br /&gt;Použití u: Mk14 Mod 1 EBR</Czech>
<Portuguese>Calibre: 7,62x51mm SD&lt;br /&gt;Projéteis: 20&lt;br /&gt;Usado em: Mk18 ABR</Portuguese>
<Italian>Calibro: 7.62x51mm Sil.&lt;br /&gt;Munizioni: 20&lt;br /&gt;In uso su: Mk18 ABR</Italian>
<Russian>Калибр: 7,62x51 мм дозвуковые&lt;br /&gt;Патронов: 20&lt;br /&gt;Используются с: Mk18 ABR</Russian>
@ -398,7 +398,7 @@
<Spanish>Calibre: .338 Norma Magnum trazadora&lt;br /&gt;Balas: 130&lt;br /&gt;Se usa en: SPMG</Spanish>
<Russian>Калибр: .338 Norma Magnum трассирующие&lt;br /&gt;Патронов: 130&lt;br /&gt;Используются в: SPMG</Russian>
<Italian>Calibro: .338 Norma Magnum Tracciante&lt;br /&gt;Munizioni: 130&lt;br /&gt;In uso su: SPMG</Italian>
<Czech>Ráže: .338 Noma Magnum Svítící&lt;br /&gt;Munice: 130&lt;br /&gt;Použití: SPMG</Czech>
<Czech>Ráže: .338 Noma Magnum Svítící&lt;br /&gt;Nábojů: 130&lt;br /&gt;Použití u: LWMMG</Czech>
<Portuguese>Calibre: .338 Norma Magnum Traçante&lt;br /&gt;Cartuchos: 130&lt;br /&gt;Usado em: SPMG</Portuguese>
<Hungarian>Kaliber: .338 Norma Magnum nyomkövető&lt;br /&gt;Lövedékek: 130&lt;br /&gt;Használható: SPMG</Hungarian>
</Key>
@ -434,7 +434,7 @@
<Spanish>Calibre: .338 Norma Magnum trazadora IR-DIM&lt;br /&gt;Balas: 130&lt;br /&gt;Se usa en: SPMG</Spanish>
<Russian>Калибр: .338 Norma Magnum ИК-трассирующие&lt;br /&gt;Патронов: 130&lt;br /&gt;Используются с: SPMG</Russian>
<Italian>Calibro: .338 Norma Magnum Tracciante IR-DIM&lt;br /&gt;Munizioni: 130&lt;br /&gt;In uso su: SPMG</Italian>
<Czech>Ráže: .338 Noma Magnum Svítící IR-DIM&lt;br /&gt;Munice: 130&lt;br /&gt;Použití: SPMG</Czech>
<Czech>Ráže: .338 Noma Magnum Svítící IR-DIM&lt;br /&gt;Nábojů: 130&lt;br /&gt;Použití u: LWMMG</Czech>
<Portuguese>Calibre: .338 Norma Magnum Traçante IR-DIM&lt;br /&gt;Cartuchos: 130&lt;br /&gt;Usado em: SPMG</Portuguese>
<Hungarian>Kaliber: .338 Norma Magnum infravörös nyomkövető&lt;br /&gt;Lövedékek: 130&lt;br /&gt;Használható: SPMG</Hungarian>
</Key>
@ -470,7 +470,7 @@
<Spanish>Calibre: .338 Norma Magnum AP&lt;br /&gt;Balas: 130&lt;br /&gt;Se usa en: SPMG</Spanish>
<Russian>Калибр: .338 Norma Magnum бронебойные&lt;br /&gt;Патронов: 130&lt;br /&gt;Используются с: SPMG</Russian>
<Italian>Calibro: .338 Norma Magnum AP&lt;br /&gt;Munizioni: 130&lt;br /&gt;In uso su: SPMG</Italian>
<Czech>Ráže: .338 Noma Magnum AP&lt;br /&gt;Munice: 130&lt;br /&gt;Použití: SPMG</Czech>
<Czech>Ráže: .338 Noma Magnum AP&lt;br /&gt;Nábojů: 130&lt;br /&gt;Použití u: LWMMG</Czech>
<Portuguese>Calibre: .338 Norma Magnum AP&lt;br /&gt;Cartuchos: 130&lt;br /&gt;Usado em: SPMG</Portuguese>
<Hungarian>Kaliber: .338 Norma Magnum páncéltörő&lt;br /&gt;Lövedékek: 130&lt;br /&gt;Használható: SPMG</Hungarian>
</Key>
@ -507,7 +507,7 @@
<Spanish>Calibre: 9.3x64mm trazadora&lt;br /&gt;Balas: 10&lt;br /&gt;Se usa en: Cyrus</Spanish>
<Russian>Калибр: 9,3x64 мм трассирующие&lt;br /&gt;Патронов: 10&lt;br /&gt;Используются с: Cyrus</Russian>
<Italian>Calibro: 9.3x64mm Tracer&lt;br /&gt;Munizioni: 10&lt;br /&gt;In uso su: Cyrus</Italian>
<Czech>Ráže: 9.3x64mm Svítící&lt;br /&gt;Munice: 10&lt;br /&gt;Použití: Cyrus</Czech>
<Czech>Ráže: 9.3x64mm Svítící&lt;br /&gt;Nábojů: 10&lt;br /&gt;Použití u: Cyrus</Czech>
<Portuguese>Calibre: 9.3x64mm Traçante&lt;br /&gt;Cartuchos: 10&lt;br /&gt;Usado em: Cyrus</Portuguese>
<Hungarian>Kaliber: 9,3x64mm nyomkövető&lt;br /&gt;Lövedékek: 10&lt;br /&gt;Használható: Cyrus</Hungarian>
</Key>
@ -543,7 +543,7 @@
<Spanish>Calibre: 9.3x64mm trazadora IR-DIM&lt;br /&gt;Balas: 10&lt;br /&gt;Se usa en: Cyrus</Spanish>
<Russian>Калибр: 9,3x64 мм ИК-трассирующие&lt;br /&gt;Патронов: 10&lt;br /&gt;Используются с: Cyrus</Russian>
<Italian>Calibro: 9.3x64mm Tracciante IR-DIM&lt;br /&gt;Munizioni: 10&lt;br /&gt;In uso su: Cyrus</Italian>
<Czech>Ráže: 9.3x64mm Svítící IR-DIM&lt;br /&gt;Munice: 10&lt;br /&gt;Použití: Cyrus</Czech>
<Czech>Ráže: 9.3x64mm Svítící IR-DIM&lt;br /&gt;Nábojů: 10&lt;br /&gt;Použití u: Cyrus</Czech>
<Portuguese>Calibre: 9.3x64mm Traçante IR-DIM&lt;br /&gt;Cartuchos: 10&lt;br /&gt;Usado em: Cyrus</Portuguese>
<Hungarian>Kaliber: 9,3x64mm infravörös nyomkövető&lt;br /&gt;Lövedékek: 10&lt;br /&gt; Használható: Cyrus</Hungarian>
</Key>
@ -580,7 +580,7 @@
<Spanish>Calibre: 9.3x64mm trazadora&lt;br /&gt;Balas: 150&lt;br /&gt;Se usa en: Navid</Spanish>
<Russian>Калибр: 9,3x64 мм трассирующие&lt;br /&gt;Патронов: 150&lt;br /&gt;Используются с: Навид</Russian>
<Italian>Calibro: 9.3x64mm Tracciante&lt;br /&gt;Munizioni: 150&lt;br /&gt;In uso su: Navid</Italian>
<Czech>Ráže: 9.3x64mm Svítící&lt;br /&gt;Munice: 150&lt;br /&gt;Použití: Navid</Czech>
<Czech>Ráže: 9.3x64mm Svítící&lt;br /&gt;Nábojů: 150&lt;br /&gt;Použití u: HK121</Czech>
<Portuguese>Calibre: 9.3x64mm Traçante&lt;br /&gt;Cartuchos: 150&lt;br /&gt;Usado em: Navid</Portuguese>
<Hungarian>Kaliber: 9,3x64mm nyomkövető&lt;br /&gt;Lövedékek: 150&lt;br /&gt;Használható: Navid</Hungarian>
</Key>
@ -616,7 +616,7 @@
<Spanish>Calibre: 9.3x64mm trazadora IR-DIM&lt;br /&gt;Balas: 150&lt;br /&gt;Se usa en: Navid</Spanish>
<Russian>Калибр: 9,3x64 мм ИК-трассирующие&lt;br /&gt;Патронов: 150&lt;br /&gt;Используются с: Навид</Russian>
<Italian>Calibro: 9.3x64mm Tracciante IR-DIM&lt;br /&gt;Munizioni: 150&lt;br /&gt;In uso su: Navid</Italian>
<Czech>Ráže: 9.3x64mm Svítící IR-DIM&lt;br /&gt;Munice: 150&lt;br /&gt;Použití: Navid</Czech>
<Czech>Ráže: 9.3x64mm Svítící IR-DIM&lt;br /&gt;Nábojů: 150&lt;br /&gt;Použití u: HK121</Czech>
<Portuguese>Calibre: 9.3x64mm Traçante IR-DIM&lt;br /&gt;Cartuchos: 150&lt;br /&gt;Usado em: Navid</Portuguese>
<Hungarian>Kaliber: 9,3x64mm infravörös nyomkövető&lt;br /&gt;Lövedékek: 150&lt;br /&gt;Használható: Navid</Hungarian>
</Key>
@ -652,7 +652,7 @@
<Spanish>Calibre: 9.3x64mm AP&lt;br /&gt;Balas: 150&lt;br /&gt;Se usa en: Navid</Spanish>
<Russian>Калибр: 9,3x64 мм бронебойные&lt;br /&gt;Патронов: 150&lt;br /&gt;Используются с: Навид</Russian>
<Italian>Calibro: 9.3x64mm AP&lt;br /&gt;Munizioni: 150&lt;br /&gt;In uso su: Navid</Italian>
<Czech>Ráže: 9.3x64mm AP&lt;br /&gt;Munice: 150&lt;br /&gt;Použití: Navid</Czech>
<Czech>Ráže: 9.3x64mm AP&lt;br /&gt;Nábojů: 150&lt;br /&gt;Použití u: HK121</Czech>
<Portuguese>Calibre: 9.3x64mm AP&lt;br /&gt;Cartuchos: 150&lt;br /&gt;Usado em: Navid</Portuguese>
<Hungarian>Kaliber: 9,3x64mm páncéltörő&lt;br /&gt;Lövedékek: 150&lt;br /&gt;Használható: Navid</Hungarian>
</Key>
@ -796,7 +796,7 @@
<Russian>Магазин из 100 6,5 мм ИК-трассирующих</Russian>
<German>6,5mm 100-Patronen-Magazin IR-DIM Leuchtspur&lt;br /&gt;Patronen: 100&lt;br /&gt;Eingesetzt von: MXLSW</German>
<Italian>6.5mm 100Rnd Tracer IR-DIM Mag&lt;br /&gt;Munizioni: 100&lt;br /&gt;In uso su: MX LSW</Italian>
<Czech>6.5mm 100náb. Svítící IR-DIM Zásobník&lt;br /&gt;Munice: 100&lt;br /&gt;Použití: MX LSW</Czech>
<Czech>6.5mm 100náb. Svítící IR-DIM Zásobník&lt;br /&gt;Nábojů: 100&lt;br /&gt;Použití u: MX LSW</Czech>
<Portuguese>Carregador 6.5mm 100 Cartuchos Traçantes IR-DIM&lt;br /&gt;Cartuchos: 100&lt;br /&gt;Usado em: MX LSW</Portuguese>
<Hungarian>6.5mm 100-lövedékes infravörös nyomkövető tár&lt;br /&gt;Lövedékek: 100&lt;br /&gt;Használható: MX LSW</Hungarian>
</Key>
@ -832,7 +832,7 @@
<Russian>Магазин из 200-т 6,5 мм ИК-трассирующих</Russian>
<German>6,5mm 200-Patronen-Gurt IR-DIM Leuchtspur&lt;br /&gt;Patronen: 200&lt;br /&gt;Eingesetzt von: Stoner 99 LMG</German>
<Italian>6.5mm 200Rnd Tracer IR-DIM Belt&lt;br /&gt;Munizioni: 200&lt;br /&gt;In uso su: Stoner 99 LMG</Italian>
<Czech>6.5mm 200náb. Svítící IR-DIM Pás&lt;br /&gt;Munice: 200&lt;br /&gt;Použití: Stoner 99 LMG</Czech>
<Czech>6.5mm 200náb. Svítící IR-DIM Pás&lt;br /&gt;Nábojů: 200&lt;br /&gt;Použití u: Stoner 99 LMG</Czech>
<Portuguese>Cinto de munição traçante 6.5mm IR-DIM com 200 cartuchos&lt;br /&gt;Cartuchos: 200&lt;br /&gt;Usado em: Stoner 99 LMG</Portuguese>
<Hungarian>6.5mm 200-lövedékes infravörös nyomkövető heveder&lt;br /&gt;Lövedékek: 200&lt;br /&gt;Használható: Stoner 99 LMG</Hungarian>
</Key>
@ -868,7 +868,7 @@
<Russian>Калибр: 5,56x45 мм NATO (Mk262)&lt;br /&gt;Патронов: 30</Russian>
<German>Kaliber: 5,56x45mm NATO (Mk262)&lt;br /&gt;Patronen: 30</German>
<Italian>Calibro: 5.56x45 mm NATO (Mk262)&lt;br /&gt;Munizioni: 30</Italian>
<Czech>Ráže: 5.56x45mm NATO (Mk262)&lt;br /&gt;Munice: 30</Czech>
<Czech>Ráže: 5.56x45mm NATO (Mk262)&lt;br /&gt;Nábojů: 30</Czech>
<Portuguese>Calibre: 5.56x45mm NATO (Mk262)&lt;br/&gt;Cartuchos: 30</Portuguese>
<Hungarian>Kaliber: 5,56x45mm NATO (Mk262)&lt;br /&gt;Lövedékek: 30</Hungarian>
</Key>
@ -904,7 +904,7 @@
<Russian>Калибр: 5,56x45 мм NATO (Mk318)&lt;br /&gt;Патронов: 30</Russian>
<German>Kaliber: 5,56x45mm NATO (Mk318)&lt;br /&gt;Patronen: 30</German>
<Italian>Calibro: 5.56x45 mm NATO (Mk318)&lt;br /&gt;Munizioni: 30</Italian>
<Czech>Ráže: 5.56x45mm NATO (Mk318)&lt;br /&gt;Munice: 30</Czech>
<Czech>Ráže: 5.56x45mm NATO (Mk318)&lt;br /&gt;Nábojů: 30</Czech>
<Portuguese>Calibre: 5.56x45mm NATO (Mk318)&lt;br/&gt;Cartuchos: 30</Portuguese>
<Hungarian>Kaliber: 5,56x45mm NATO (Mk318)&lt;br /&gt;Lövedékek: 30</Hungarian>
</Key>
@ -940,7 +940,7 @@
<Russian>Калибр: 5,56x45 мм NATO (M995 бронебойные)&lt;br /&gt;Патронов: 30</Russian>
<German>Kaliber: 5,56x45mm NATO (M995 AP)&lt;br /&gt;Patronen: 30</German>
<Italian>Calibro: 5.56x45 mm NATO (M995 AP)&lt;br /&gt;Munizioni: 30</Italian>
<Czech>Ráže: 5.56x45mm NATO (M995 AP)&lt;br /&gt;Munice: 30</Czech>
<Czech>Ráže: 5.56x45mm NATO (M995 AP)&lt;br /&gt;Nábojů: 30</Czech>
<Portuguese>Calibre: 5.56x45mm NATO (M995 AP)&lt;br/&gt;Cartuchos: 30</Portuguese>
<Hungarian>Kaliber: 5,56x45mm NATO (M995 páncéltörő)&lt;br /&gt;Lövedékek: 30</Hungarian>
</Key>
@ -976,7 +976,7 @@
<Russian>Калибр: 7,62x51 мм NATO (M118LR)&lt;br /&gt;Патронов: 10</Russian>
<German>Kaliber: 7,62x51mm NATO (M118LR)&lt;br /&gt;Patronen: 10</German>
<Italian>Calibro: 7.62x51 mm NATO (M118LR)&lt;br /&gt;Munizioni: 10</Italian>
<Czech>Ráže: 7.62x51mm NATO (M118LR)&lt;br /&gt;Munice: 10</Czech>
<Czech>Ráže: 7.62x51mm NATO (M118LR)&lt;br /&gt;Nábojů: 10</Czech>
<Portuguese>Calibre: 7.26x51mm NATO (M118LR)&lt;br/&gt;Cartuchos: 10</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (M118LR)&lt;br /&gt;Lövedékek: 10</Hungarian>
</Key>
@ -1012,7 +1012,7 @@
<Russian>Калибр: 7,62x51 мм NATO (M118LR)&lt;br /&gt;Патронов: 20</Russian>
<German>Kaliber: 7,62x51mm NATO (M118LR)&lt;br /&gt;Patronen: 20</German>
<Italian>Calibro: 7.62x51 mm NATO (M118LR)&lt;br /&gt;Munizioni: 20</Italian>
<Czech>Ráže: 7.62x51mm NATO (M118LR)&lt;br /&gt;Munice: 20</Czech>
<Czech>Ráže: 7.62x51mm NATO (M118LR)&lt;br /&gt;Nábojů: 20</Czech>
<Portuguese>Calibre: 7.26x51mm NATO (M118LR)&lt;br/&gt;Cartuchos: 20</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (M118LR)&lt;br /&gt;Lövedékek: 20</Hungarian>
</Key>
@ -1048,7 +1048,7 @@
<Russian>Калибр: 7,62x51 мм NATO (Mk316 Mod 0)&lt;br /&gt;Патронов: 10</Russian>
<German>Kaliber: 7,62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;Patronen: 10</German>
<Italian>Calibro: 7.62x51 mm NATO (Mk316 Mod 0)&lt;br /&gt;Munizioni: 10</Italian>
<Czech>Ráže: 7.62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;Munice: 10</Czech>
<Czech>Ráže: 7.62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;Nábojů: 10</Czech>
<Portuguese>Calibre: 7.26x51mm NATO (Mk316 Mod 0)&lt;br/&gt;Cartuchos: 10</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;Lövedékek: 10</Hungarian>
</Key>
@ -1084,7 +1084,7 @@
<Russian>Калибр: 7,62x51 мм NATO (Mk316 Mod 0)&lt;br /&gt;Патронов: 20</Russian>
<German>Kaliber: 7,62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;Patronen: 20</German>
<Italian>Calibro: 7.62x51 mm NATO (Mk316 Mod 0)&lt;br /&gt;Munizioni: 20</Italian>
<Czech>Ráže: 7.62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;Munice: 20</Czech>
<Czech>Ráže: 7.62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;Nábojů: 20</Czech>
<Portuguese>Calibre: 7.26x51mm NATO (Mk316 Mod 0)&lt;br/&gt;Cartuchos: 20</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;Lövedékek: 20</Hungarian>
</Key>
@ -1120,7 +1120,7 @@
<Russian>Калибр: 7,62x51 мм NATO (Mk319 Mod 0)&lt;br /&gt;Патронов: 10</Russian>
<German>Kaliber: 7,62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;Patronen: 10</German>
<Italian>Calibro: 7.62x51 mm NATO (Mk319 Mod 0)&lt;br /&gt;Munizioni: 10</Italian>
<Czech>Ráže: 7.62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;Munice: 10</Czech>
<Czech>Ráže: 7.62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;Nábojů: 10</Czech>
<Portuguese>Calibre: 7.26x51mm NATO (Mk319 Mod 0)&lt;br/&gt;Cartuchos: 10</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;Lövedékek: 10</Hungarian>
</Key>
@ -1156,7 +1156,7 @@
<Russian>Калибр: 7,62x51 мм NATO (Mk319 Mod 0)&lt;br /&gt;Патронов: 20</Russian>
<German>Kaliber: 7,62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;Patronen: 20</German>
<Italian>Calibro: 7.62x51 mm NATO (Mk319 Mod 0)&lt;br /&gt;Munizioni: 20</Italian>
<Czech>Ráže: 7.62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;Munice: 20</Czech>
<Czech>Ráže: 7.62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;Nábojů: 20</Czech>
<Portuguese>Calibre: 7.26x51mm NATO (Mk319 Mod 0)&lt;br/&gt;Cartuchos: 20</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;Lövedékek: 20</Hungarian>
</Key>
@ -1192,7 +1192,7 @@
<Russian>Калибр: 7,62x51 мм NATO (M993 бронебойные)&lt;br /&gt;Патронов: 10</Russian>
<German>Kaliber: 7,62x51mm NATO (M993 AP)&lt;br /&gt;Patronen: 10</German>
<Italian>Calibro: 7.62x51 mm NATO (M993 AP)&lt;br /&gt;Munizioni: 10</Italian>
<Czech>Ráže: 7.62x51mm NATO (M993 AP)&lt;br /&gt;Munice: 10</Czech>
<Czech>Ráže: 7.62x51mm NATO (M993 AP)&lt;br /&gt;Nábojů: 10</Czech>
<Portuguese>Calibre: 7.26x51mm NATO (M993 AP)&lt;br/&gt;Cartuchos: 10</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (M993 páncéltörő)&lt;br /&gt;Lövedékek: 10</Hungarian>
</Key>
@ -1228,7 +1228,7 @@
<German>Kaliber: 7,62x51mm NATO (M993 AP)&lt;br /&gt;Patronen: 20</German>
<Italian>Calibro: 7.62x51 mm NATO (M993 AP)&lt;br /&gt;Munizioni: 20</Italian>
<Spanish>Calibre: 7.62x51 mm NATO (M993 AP)&lt;br /&gt;Balas: 20</Spanish>
<Czech>Ráže: 7.62x51mm NATO (M993 AP)&lt;br /&gt;Munice: 20</Czech>
<Czech>Ráže: 7.62x51mm NATO (M993 AP)&lt;br /&gt;Nábojů: 20</Czech>
<Portuguese>Calibre: 7.26x51mm NATO (M993 AP)&lt;br/&gt;Cartuchos: 20</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (M993 páncéltörő)&lt;br /&gt;Lövedékek: 20</Hungarian>
</Key>
@ -1264,7 +1264,7 @@
<Russian>Калибр: 7,62x67 мм NATO (Mk248 Mod 0)&lt;br /&gt;Патронов: 20</Russian>
<German>Kaliber: 7,62x51mm NATO (Mk248 Mod 0)&lt;br /&gt;Patronen: 20</German>
<Italian>Calibro: 7.62x67 mm NATO (Mk248 Mod 0)&lt;br /&gt;Munizioni: 20</Italian>
<Czech>Ráže: 7.62x67mm NATO (Mk248 Mod 0)&lt;br /&gt;Munice: 20</Czech>
<Czech>Ráže: 7.62x67mm NATO (Mk248 Mod 0)&lt;br /&gt;Nábojů: 20</Czech>
<Portuguese>Calibre: 7.26x67mm NATO (Mk248 Mod 0)&lt;br/&gt;Cartuchos: 20</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (Mk248 Mod 0)&lt;br /&gt;Lövedékek: 20</Hungarian>
</Key>
@ -1300,7 +1300,7 @@
<Russian>Калибр: 7,62x67 мм NATO (Mk248 Mod 1)&lt;br /&gt;Патронов: 20</Russian>
<German>Kaliber: 7,62x51mm NATO (Mk248 Mod 1)&lt;br /&gt;Patronen: 20</German>
<Italian>Calibro: 7.62x67 mm NATO (Mk248 Mod 1)&lt;br /&gt;Munizioni: 20</Italian>
<Czech>Ráže: 7.62x67mm NATO (Mk248 Mod 1)&lt;br /&gt;Munice: 20</Czech>
<Czech>Ráže: 7.62x67mm NATO (Mk248 Mod 1)&lt;br /&gt;Nábojů: 20</Czech>
<Portuguese>Calibre: 7.26x67mm NATO (Mk248 Mod 1)&lt;br/&gt;Cartuchos: 20</Portuguese>
<Hungarian>Kaliber: 7,62x51mm NATO (Mk248 Mod 1)&lt;br /&gt;Lövedékek: 20</Hungarian>
</Key>
@ -1336,7 +1336,7 @@
<Russian>Калибр: 7,62x67 мм NATO (Berger Hybrid OTM)&lt;br /&gt;Патронов: 20</Russian>
<German>Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)&lt;br /&gt;Patronen: 20</German>
<Italian>Calibro: 7.62x67 mm NATO (Berger Hybrid OTM)&lt;br /&gt;Munizioni: 20</Italian>
<Czech>Ráže: 7.62x67mm NATO (Berger Hybrid OTM)&lt;br /&gt;Munice: 20</Czech>
<Czech>Ráže: 7.62x67mm NATO (Berger Hybrid OTM)&lt;br /&gt;Nábojů: 20</Czech>
<Portuguese>Calibre: 7.26x67mm NATO (Berger Hybrid OTM)&lt;br/&gt;Cartuchos: 20</Portuguese>
<Hungarian>Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)&lt;br /&gt;Lövedékek: 20</Hungarian>
</Key>
@ -1372,7 +1372,7 @@
<Russian>Калибр: 6,5x47 мм (экспансивные Scenar)&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются с: MXM</Russian>
<German>Kaliber: 6,5x47mm (HPBT Scenar)&lt;br /&gt;Patronen: 30&lt;br /&gt;Eingesetzt von: MXM</German>
<Italian>Calibro: 6.5x47mm (HPBT Scenar)&lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: MXM</Italian>
<Czech>Ráže: 6.5x47mm (HPBT Scenar)&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: MXM</Czech>
<Czech>Ráže: 6.5x47mm (HPBT Scenar)&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: MXM</Czech>
<Portuguese>Calibre: 6.5x47mm (HPBT Scenar)&lt;br/&gt;Cartuchos: 30&lt;br/&gt;Usado em: MXM</Portuguese>
<Hungarian>Kaliber: 6,5x47mm (HPBT Scenar)&lt;br /&gt;Lövedékek: 30&lt;br /&gt;Használható: MXM</Hungarian>
</Key>
@ -1408,7 +1408,7 @@
<Italian>Calibro: 6.5mm Creedmor&lt;br /&gt;Munizioni: 30&lt;br /&gt;In uso su: MXM</Italian>
<Spanish>Calibre: 6.5mm Creedmor&lt;br /&gt;Balas: 30&lt;br /&gt;Se usa en: MXM</Spanish>
<Russian>Калибр: 6,5x47мм Creedmor&lt;br /&gt;Патронов: 30&lt;br /&gt;Используются c: MXM</Russian>
<Czech>Ráže: 6.5x47mm Creedmor&lt;br /&gt;Munice: 30&lt;br /&gt;Použití: MXM</Czech>
<Czech>Ráže: 6.5x47mm Creedmor&lt;br /&gt;Nábojů: 30&lt;br /&gt;Použití u: MXM</Czech>
<Portuguese>Calibre: 6.5x47mm Creedmor&lt;br/&gt;Cartuchos: 30&lt;br/&gt;Usado em: MXM</Portuguese>
<Hungarian>Kaliber: 6,5x47mm Creedmor&lt;br /&gt;Lövedékek: 30&lt;br /&gt;Használható: MXM</Hungarian>
</Key>
@ -1444,7 +1444,7 @@
<Russian>Калибр: 8,6x70mm (300 гран Sierra MatchKing экспансивные)&lt;br /&gt;Патронов: 10</Russian>
<German>Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)&lt;br /&gt;Patronen: 10</German>
<Italian>Calibro: 8.6x70mm (300gr Sierra MatchKing HPBT)&lt;br /&gt;Munizioni: 10</Italian>
<Czech>Ráže: 8.6x70mm (300gr Sierra MatchKing HPBT)&lt;br /&gt;Munice: 10</Czech>
<Czech>Ráže: 8.6x70mm (300gr Sierra MatchKing HPBT)&lt;br /&gt;Nábojů: 10</Czech>
<Portuguese>Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)&lt;br/&gt;Cartuchos: 10</Portuguese>
<Hungarian>Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)&lt;br /&gt;Lövedékek: 10</Hungarian>
</Key>
@ -1480,7 +1480,7 @@
<Russian>Калибр: 8,6x70 мм (API526)&lt;br /&gt;Патронов: 10</Russian>
<German>Kaliber: 8,6x70mm (API526)&lt;br /&gt;Patronen: 10</German>
<Italian>Calibro: 8.6x70mm (API526)&lt;br /&gt;Munizioni: 10</Italian>
<Czech>Ráže: 8.6x70mm (API526)&lt;br /&gt;Munice: 10</Czech>
<Czech>Ráže: 8.6x70mm (API526)&lt;br /&gt;Nábojů: 10</Czech>
<Portuguese>Calibre: 8.6x70mm (API526)&lt;br/&gt;Cartuchos: 10</Portuguese>
<Hungarian>Kaliber: 8,6x70mm (API526)&lt;br /&gt;Lövedékek: 10</Hungarian>
</Key>
@ -1516,7 +1516,7 @@
<Russian>Калибр: 12,7x99 мм&lt;br /&gt;Патронов: 5</Russian>
<German>Kaliber: 12,7x99mm&lt;br /&gt;Patronen: 5</German>
<Italian>Calibro: 12.7x99mm&lt;br /&gt;Munizioni: 5</Italian>
<Czech>Ráže: 12.7x99mm&lt;br /&gt;Munice: 5</Czech>
<Czech>Ráže: 12.7x99mm&lt;br /&gt;Nábojů: 5</Czech>
<Portuguese>Calibre: 12.7x99mm&lt;br/&gt;Cartuchos: 5</Portuguese>
<Hungarian>Kaliber: 12,7x99mm&lt;br /&gt;Lövedékek: 5</Hungarian>
</Key>
@ -1552,7 +1552,7 @@
<Russian>Калибр: 12,7x99 мм бронебойно-зажигательные&lt;br /&gt;Патронов: 5</Russian>
<German>Kaliber:12,7x99mm API&lt;br /&gt;Patronen: 5</German>
<Italian>Calibro: 12.7x99mm API&lt;br /&gt;Munizioni: 5</Italian>
<Czech>Ráže: 12.7x99mm API&lt;br /&gt;Munice: 5</Czech>
<Czech>Ráže: 12.7x99mm API&lt;br /&gt;Nábojů: 5</Czech>
<Portuguese>Calibre: 12.7x99mm API&lt;br/&gt;Cartuchos: 5</Portuguese>
<Hungarian>Kaliber: 12,7x99mm API&lt;br /&gt;Lövedékek: 5</Hungarian>
</Key>
@ -1588,7 +1588,7 @@
<Russian>Калибр: 12,7x99 мм (A-MAX)&lt;br /&gt;Патронов: 5</Russian>
<Italian>Calibro: 12.7x99mm (AMAX)&lt;br /&gt;Munizioni: 5</Italian>
<German>Kaliber:12,7x99mm (AMAX)&lt;br /&gt;Patronen: 5</German>
<Czech>Ráže: 12.7x99mm (AMAX)&lt;br /&gt;Munice: 5</Czech>
<Czech>Ráže: 12.7x99mm (AMAX)&lt;br /&gt;Nábojů: 5</Czech>
<Portuguese>Calibre: 12.7x99mm (AMAX)&lt;br/&gt;Cartuchos: 5</Portuguese>
<Hungarian>Kaliber: 12,7x99mm (AMAX)&lt;br /&gt;Lövedékek: 5</Hungarian>
</Key>
@ -1604,4 +1604,4 @@
<Russian>[ACE] Ящик с боеприпасами</Russian>
</Key>
</Package>
</Project>
</Project>

View File

@ -2,6 +2,9 @@
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_CAPTIVES
#define DEBUG_MODE_FULL

View File

@ -7,7 +7,7 @@
<Spanish>Tomar prisionero</Spanish>
<French>Capturer le prisonnier</French>
<Polish>Aresztuj</Polish>
<Czech>Zajmout Osobu</Czech>
<Czech>Zajmout osobu</Czech>
<Italian>Arresta il prigioniero</Italian>
<Portuguese>Tomar Prisioneiro</Portuguese>
<Hungarian>Foglyul ejtés</Hungarian>
@ -19,7 +19,7 @@
<Spanish>Liberar prisionero</Spanish>
<Polish>Wypuść więźnia</Polish>
<French>Libérer le prisonnier</French>
<Czech>Osvobodit Zajatce</Czech>
<Czech>Osvobodit zajatce</Czech>
<Italian>Libera il prigioniero</Italian>
<Portuguese>Libertar Prisioneiro</Portuguese>
<Hungarian>Fogoly szabadon engedése</Hungarian>
@ -31,7 +31,7 @@
<Spanish>Escoltar prisionero</Spanish>
<Polish>Eskortuj więźnia</Polish>
<French>Escorter le prisonnier</French>
<Czech>Eskortovat Zajatce</Czech>
<Czech>Eskortovat zajatce</Czech>
<Italian>Scorta il Prigioniero</Italian>
<Portuguese>Escoltar Prisioneiro</Portuguese>
<Hungarian>Fogoly kísérése</Hungarian>
@ -43,7 +43,7 @@
<Spanish>Soltar prisionero</Spanish>
<Polish>Anuluj eskortowanie</Polish>
<French>Relâcher le prisonnier</French>
<Czech>Uvolnit Zajatce</Czech>
<Czech>Uvolnit zajatce</Czech>
<Italian>Rilascia il Prigioniero</Italian>
<Portuguese>Largar Prisioneiro</Portuguese>
<Hungarian>Fogoly elengedése</Hungarian>
@ -91,7 +91,7 @@
<Polish>Opaska zaciskowa</Polish>
<Spanish>Precinto</Spanish>
<French>Serflex</French>
<Czech>Stahovací Pásek</Czech>
<Czech>Stahovací pásek</Czech>
<Portuguese>Algema Plástica</Portuguese>
<Italian>Fascietta</Italian>
<Hungarian>Gyorskötöző</Hungarian>
@ -296,4 +296,4 @@
<Czech>Vzdávání nebo beze zbraně</Czech>
</Key>
</Package>
</Project>
</Project>

View File

@ -12,7 +12,9 @@ class Extended_PostInit_EventHandlers {
class Extended_Killed_EventHandlers {
class All {
init = QUOTE(call FUNC(handleDestroyed));
class ADDON {
serverKilled = QUOTE(call FUNC(handleDestroyed));
};
};
};

View File

@ -1,5 +1,9 @@
class CfgVehicles {
class ACE_Module;
class Logic;
class Module_F: Logic {
class ModuleDescription;
};
class ACE_Module: Module_F {};
class ACE_moduleCargoSettings: ACE_Module {
scope = 2;
displayName = CSTRING(SettingsModule_DisplayName);
@ -26,6 +30,33 @@ class CfgVehicles {
sync[] = {};
};
};
class GVAR(makeLoadable): ACE_Module {
scope = 2;
displayName = CSTRING(makeLoadable_displayName);
icon = QUOTE(PATHTOF(UI\Icon_Module_makeLoadable_ca.paa));
category = "ACE_Logistics";
function = QFUNC(moduleMakeLoadable);
isGlobal = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);
class Arguments {
class canLoad {
displayName = CSTRING(makeLoadable_displayName);
description = CSTRING(MakeLoadable_description);
typeName = "BOOL";
defaultValue = 1;
};
class setSize {
displayName = CSTRING(makeLoadable_setSize_displayName);
typeName = "NUMBER";
defaultValue = 1;
};
};
class ModuleDescription: ModuleDescription {
description = CSTRING(module_MakeLoadable_description);
sync[] = {"AnyStaticObject"};
};
};
class LandVehicle;
class Car: LandVehicle {
@ -178,7 +209,7 @@ class CfgVehicles {
GVAR(space) = 0;
GVAR(hasCargo) = 0;
};
// boats
class Ship;
class Ship_F: Ship {
@ -245,7 +276,7 @@ class CfgVehicles {
class RoadBarrier_F: RoadCone_F {
GVAR(size) = 2;
};
class Scrapyard_base_F;
class Land_PaperBox_closed_F: Scrapyard_base_F {

Binary file not shown.

View File

@ -4,14 +4,14 @@
["LoadCargo", {
(_this select 0) params ["_item","_vehicle"];
private ["_loaded", "_hint", "_itemName", "_vehicleName"];
TRACE_2("LoadCargo EH",_item,_vehicle);
_loaded = [_item, _vehicle] call FUNC(loadItem);
private _loaded = [_item, _vehicle] call FUNC(loadItem);
// Show hint as feedback
_hint = [LSTRING(LoadingFailed), LSTRING(LoadedItem)] select _loaded;
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
private _hint = [LSTRING(LoadingFailed), LSTRING(LoadedItem)] select _loaded;
private _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
@ -22,17 +22,17 @@
}] call EFUNC(common,addEventHandler);
["UnloadCargo", {
(_this select 0) params ["_item","_vehicle"];
private ["_unloaded", "_itemClass", "_hint", "_itemName", "_vehicleName"];
(_this select 0) params ["_item","_vehicle", ["_unloader", objNull]];
TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader);
private _unloaded = [_item, _vehicle, _unloader] call FUNC(unloadItem); //returns true if sucessful
_unloaded = [_item, _vehicle] call FUNC(unloadItem);
_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
// Show hint as feedback
_hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded;
_itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
private _hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded;
private _itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);

View File

@ -13,6 +13,8 @@ PREP(handleDestroyed);
PREP(initObject);
PREP(initVehicle);
PREP(loadItem);
PREP(makeLoadable);
PREP(moduleMakeLoadable);
PREP(moduleSettings);
PREP(onMenuOpen);
PREP(startLoadIn);
@ -21,5 +23,6 @@ PREP(unloadItem);
PREP(validateCargoSpace);
GVAR(initializedItemClasses) = [];
GVAR(initializedVehicleClasses) = [];
ADDON = true;

View File

@ -18,7 +18,7 @@
*/
#include "script_component.hpp"
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ];
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]]];
TRACE_3("params",_itemClass,_vehicle,_amount);
for "_i" from 1 to _amount do {

View File

@ -17,11 +17,11 @@
#include "script_component.hpp"
params ["_player", "_object"];
TRACE_2("params",_player,_object);
if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false};
private ["_nearestVehicle"];
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
private _nearestVehicle = [_player] call FUNC(findNearestVehicle);
if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then {
{

View File

@ -18,11 +18,10 @@
params [["_item", "", [objNull,""]], "_vehicle"];
if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false};
private ["_itemSize", "_validItem"];
_itemSize = [_item] call FUNC(getSizeItem);
if (speed _vehicle > 1 || {((getPos _vehicle) select 2) > 3}) exitWith {TRACE_1("vehicle not stable",_vehicle); false};
private _itemSize = [_item] call FUNC(getSizeItem);
private _validItem = false;
if (_item isEqualType "") then {
_validItem =
isClass (configFile >> "CfgVehicles" >> _item) &&

View File

@ -5,6 +5,7 @@
* Arguments:
* 0: loaded Object <OBJECT>
* 1: Object <OBJECT>
* 2: Unloader (player) <OPTIONAL><OBJECT>
*
* Return value:
* Can be unloaded <BOOL>
@ -16,30 +17,14 @@
*/
#include "script_component.hpp"
params ["_item", "_vehicle"];
private ["_loaded", "_itemClass", "_validVehiclestate", "_emptyPos"];
params ["_item", "_vehicle", ["_unloader", objNull]];
TRACE_2("params",_item,_vehicle);
_loaded = _vehicle getVariable [QGVAR(loaded), []];
private _loaded = _vehicle getVariable [QGVAR(loaded), []];
if !(_item in _loaded) exitWith {false};
_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
_validVehiclestate = true;
_emptyPos = [];
if (_vehicle isKindOf "Ship" ) then {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot.
} else {
if (_vehicle isKindOf "Air" ) then {
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
_emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition);
_emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ];
} else {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]);
};
};
private _emptyPos = [_vehicle, _itemClass, _unloader] call EFUNC(common,findUnloadPosition);
if (!_validVehiclestate) exitWith {false};
(count _emptyPos != 0)
(count _emptyPos) == 3

View File

@ -15,23 +15,21 @@
*/
#include "script_component.hpp"
private ["_loadCar", "_loadHelicopter", "_loadTank", "_loadShip", "_loadContainer"];
params ["_unit"];
_loadCar = nearestObject [_unit, "car"];
private _loadCar = nearestObject [_unit, "car"];
if (_unit distance _loadCar <= MAX_LOAD_DISTANCE) exitWith {_loadCar};
_loadHelicopter = nearestObject [_unit, "air"];
private _loadHelicopter = nearestObject [_unit, "air"];
if (_unit distance _loadHelicopter <= MAX_LOAD_DISTANCE) exitWith {_loadHelicopter};
_loadTank = nearestObject [_unit, "tank"];
private _loadTank = nearestObject [_unit, "tank"];
if (_unit distance _loadTank <= MAX_LOAD_DISTANCE) exitWith {_loadTank};
_loadShip = nearestObject [_unit, "ship"];
private _loadShip = nearestObject [_unit, "ship"];
if (_unit distance _loadShip <= MAX_LOAD_DISTANCE) exitWith {_loadShip};
_loadContainer = nearestObject [_unit,"Cargo_base_F"];
private _loadContainer = nearestObject [_unit,"Cargo_base_F"];
if (_unit distance _loadContainer <= MAX_LOAD_DISTANCE) exitWith {_loadContainer};
objNull

View File

@ -16,5 +16,6 @@
#include "script_component.hpp"
params ["_object"];
// TRACE_1("params",_object);
_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))]

View File

@ -16,22 +16,23 @@
#include "script_component.hpp"
params ["_item"];
private ["_isVirtual","_itemClass","_config"];
scopeName "return";
_isVirtual = (_item isEqualType "");
_itemClass = if (_isVirtual) then {_item} else {typeOf _item};
_config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size));
private _isVirtual = (_item isEqualType "");
private _itemClass = if (_isVirtual) then {_item} else {typeOf _item};
private _config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size));
if (_isVirtual) then {
if (isNumber _config) then {
(getNumber _config) breakOut "return";
};
} else {
_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size));
if (!isNil {_item getVariable QGVAR(size)}) then {
(_item getVariable QGVAR(size)) breakOut "return";
};
if (isNumber _config) then {
(_item getVariable [QGVAR(size), getNumber _config]) breakOut "return";
(getNumber _config) breakOut "return";
};
};

View File

@ -1,6 +1,6 @@
/*
* Author: Glowbal
* Handle object being destroyed.
* Handle object being destroyed. Only runs on server.
*
* Arguments:
* 0: Object <OBJECT>
@ -16,10 +16,9 @@
#include "script_component.hpp"
params ["_vehicle"];
TRACE_1("params",_vehicle);
private["_loaded"];
_loaded = _vehicle getVariable [QGVAR(loaded), []];
private _loaded = _vehicle getVariable [QGVAR(loaded), []];
if (_loaded isEqualTo []) exitWith {};
{
@ -27,6 +26,7 @@ if (_loaded isEqualTo []) exitWith {};
if (_x isEqualType objNull) then {
deleteVehicle _x;
};
nil
} count _loaded;
[_vehicle] call FUNC(validateCargoSpace);

View File

@ -16,15 +16,31 @@
#include "script_component.hpp"
params ["_object"];
private _type = typeOf _object;
TRACE_2("params",_object,_type);
if (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(canLoad)) != 1) exitWith {};
private ["_type", "_action"];
_type = typeOf _object;
if ((_object getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad))]) != 1) exitWith {};
// do nothing if the class is already initialized
if (_type in GVAR(initializedItemClasses)) exitWith {};
GVAR(initializedItemClasses) pushBack _type;
_action = [QGVAR(load), localize LSTRING(loadObject), QUOTE(PATHTOF(UI\Icon_load.paa)), {[_player, _target] call FUNC(startLoadIn)}, {GVAR(enable) && {[_player, _target] call FUNC(canLoad)}}] call EFUNC(interact_menu,createAction);
TRACE_1("Adding load cargo action to class", _type);
private _condition = {
GVAR(enable) &&
{(_target getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(canLoad))]) == 1} &&
{locked _target < 2} &&
{alive _target} &&
{[_player, _target, []] call EFUNC(common,canInteractWith)}
};
private _statement = {
params ["_target", "_player"];
[_player, _target] call FUNC(startLoadIn);
};
private _text = localize LSTRING(loadObject);
private _icon = QUOTE(PATHTOF(UI\Icon_load.paa));
private _action = [QGVAR(load), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);

View File

@ -18,9 +18,7 @@
params ["_vehicle"];
TRACE_1("params", _vehicle);
private ["_type", "_initializedClasses"];
_type = typeOf _vehicle;
_initializedClasses = GETMVAR(GVAR(initializedClasses),[]);
private _type = typeOf _vehicle;
if (isServer) then {
{
@ -35,21 +33,24 @@ if (isServer) then {
};
// do nothing if the class is already initialized
if (_type in _initializedClasses) exitWith {};
if (_type in GVAR(initializedVehicleClasses)) exitWith {};
// set class as initialized
_initializedClasses pushBack _type;
SETMVAR(GVAR(initializedClasses),_initializedClasses);
GVAR(initializedVehicleClasses) pushBack _type;
if (!hasInterface) exitWith {};
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {};
private ["_text", "_condition", "_statement", "_icon", "_action"];
_condition = {
params ["_target", "_player"];
GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, []] call EFUNC(common,canInteractWith)}
};
_text = localize LSTRING(openMenu);
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
_icon = "";
TRACE_1("Adding unload cargo action to class", _type);
_action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
private _condition = {
GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)}
};
private _statement = {
GVAR(interactionVehicle) = _target;
createDialog QGVAR(menu);
};
private _text = localize LSTRING(openMenu);
private _icon = "";
private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);

View File

@ -6,7 +6,6 @@
* Arguments:
* 0: Item <OBJECT or STRING>
* 1: Vehicle <OBJECT>
* 2: Show Hint <BOOL> (default: true)
*
* Return value:
* Object loaded <BOOL>
@ -19,18 +18,18 @@
#include "script_component.hpp"
params [["_item","",[objNull,""]], ["_vehicle",objNull,[objNull]]];
private ["_loaded", "_space", "_itemSize"];
TRACE_2("params",_item,_vehicle);
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false};
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {TRACE_2("cannot load",_item,_vehicle); false};
_loaded = _vehicle getVariable [QGVAR(loaded), []];
private _loaded = _vehicle getVariable [QGVAR(loaded), []];
_loaded pushBack _item;
_vehicle setVariable [QGVAR(loaded), _loaded, true];
TRACE_1("added to loaded array",_loaded);
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem);
private _space = [_vehicle] call FUNC(getCargoSpaceLeft);
private _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), _space - _itemSize, true];
if (_item isEqualType objNull) then {

View File

@ -0,0 +1,47 @@
/*
* Author: PabstMirror
* Makes any object loadable. Needs to be called on all machines.
*
* Arguments:
* 0: Object <OBJECT>
* 1: Set as loadable (default: true) <BOOL><SCALAR>
* 2: Size. (default: 1) <NUMBER>
*
* Return value:
* None
*
* Example:
* [cursorTarget, true, 1] call ace_cargo_fnc_makeLoadable
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_object", objNull, [objNull]], ["_canLoad", true, [false, 0]], ["_setSize", 1, [0]]];
TRACE_3("params",_object,_canLoad,_setSize);
if (isNull _object) exitWith {TRACE_1("null",_object);};
private _type = typeOf _object;
private _cfgCanLoad = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad));
private _curSize = [_object] call FUNC(getSizeItem);
_canLoad = [0, 1] select _canLoad; //convert true/false to scalar
if ((_canLoad == 1) && {_setSize <= 0}) exitWith {
ACE_LOGERROR("ace_cargo_fnc_makeLoadable (size <= 0) when making loadable");
};
TRACE_2("setVar if different from config",_canLoad,_cfgCanLoad);
if (_canLoad != _cfgCanLoad) then {
_object setVariable [QGVAR(canLoad), _canLoad];
};
TRACE_2("setVar if different from config",_setSize,_curSize);
if (_setSize != _curSize) then {
_object setVariable [QGVAR(size), _setSize];
};
//Add the load actions to the object class if not already added
[_object] call FUNC(initObject);
nil

View File

@ -0,0 +1,34 @@
/*
* Author: PabstMirror
* Module to make an object loadable.
*
* Arguments:
* 0: The module logic <OBJECT>
* 1: Synchronized units <ARRAY>
* 2: Activated <BOOL>
*
* Return Value:
* None
*
* Example:
* [logic, [box], true] call ace_cargo_fnc_moduleMakeLoadable
*
* Public: No
*/
#include "script_component.hpp"
params ["_logic", "_objects", "_activated"];
TRACE_3("params",_logic,_objects,_activated);
if ((isNull _logic) || {!_activated}) exitWith {};
if (_objects isEqualTo []) exitWith {
ACE_LOGWARNING_1("ace_cargo_fnc_moduleMakeLoadable has no synced objects [%1]", _logic);
};
private _canLoad = _logic getVariable ["canLoad", true];
private _setSize = _logic getVariable ["setSize", 1];
TRACE_2("settings",_canLoad,_setSize);
{
[_x, _canLoad, _setSize] call FUNC(makeLoadable);
} forEach _objects;

View File

@ -19,7 +19,7 @@
if (!isServer) exitWith {};
params ["_logic", "_units", "_activated"];
params ["_logic", "", "_activated"];
if (!_activated) exitWith {};

View File

@ -22,25 +22,24 @@ params ["_display"];
uiNamespace setVariable [QGVAR(menuDisplay), _display];
[{
private ["_display","_loaded", "_ctrl", "_class", "_label"];
disableSerialization;
_display = uiNamespace getVariable QGVAR(menuDisplay);
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isnil "_display") exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
if (isNull GVAR(interactionVehicle) || ACE_player distance GVAR(interactionVehicle) >= 10) exitWith {
if (isNull GVAR(interactionVehicle) || {ACE_player distance GVAR(interactionVehicle) >= 10}) exitWith {
closeDialog 0;
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
_loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
_ctrl = _display displayCtrl 100;
_label = _display displayCtrl 2;
private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
private _ctrl = _display displayCtrl 100;
private _label = _display displayCtrl 2;
lbClear _ctrl;
{
_class = if (_x isEqualType "") then {_x} else {typeOf _x};
private _class = if (_x isEqualType "") then {_x} else {typeOf _x};
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName"));
true
} count _loaded;

View File

@ -3,38 +3,46 @@
* Start load item.
*
* Arguments:
* 0: Object <OBJECT>
* 0: Player <OBJECT>
* 1: Object <OBJECT>
*
* Return value:
* Object loaded <BOOL>
* Load ProgressBar Started <BOOL>
*
* Example:
* [object] call ace_cargo_fnc_starLoadIn
* [player, cursorTarget] call ace_cargo_fnc_startLoadIn
*
* Public: No
*/
#include "script_component.hpp"
params ["_player", "_object"];
private ["_vehicle", "_size", "_displayName"];
TRACE_2("params",_player,_object);
_vehicle = [_player] call FUNC(findNearestVehicle);
private _vehicle = [_player] call FUNC(findNearestVehicle);
if (isNull _vehicle || _vehicle isKindOf "Cargo_Base_F") then {
if ((isNull _vehicle) || {_vehicle isKindOf "Cargo_Base_F"}) then {
{
if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x};
} forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
};
if (isNull _vehicle) exitWith {false};
if (isNull _vehicle) exitWith {
TRACE_3("Could not find vehicle",_player,_object,_vehicle);
false
};
private _return = false;
// Start progress bar
if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
_size = [_object] call FUNC(getSizeItem);
private _size = [_object] call FUNC(getSizeItem);
[5 * _size, [_object,_vehicle], "LoadCargo", {}, localize LSTRING(LoadingItem)] call EFUNC(common,progressBar);
_return = true;
} else {
_displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName");
private _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName");
["displayTextStructured", [[LSTRING(LoadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);
};
_return

View File

@ -15,34 +15,29 @@
*/
#include "script_component.hpp"
private ["_display", "_loaded", "_ctrl", "_selected", "_item"];
disableSerialization;
_display = uiNamespace getVariable QGVAR(menuDisplay);
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isNil "_display") exitWith {};
_loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
if (count _loaded == 0) exitWith {};
private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
if (_loaded isEqualTo []) exitWith {};
_ctrl = _display displayCtrl 100;
private _ctrl = _display displayCtrl 100;
_selected = (lbCurSel _ctrl) max 0;
private _selected = (lbCurSel _ctrl) max 0;
if (count _loaded <= _selected) exitWith {};
_item = _loaded select _selected;
private _item = _loaded select _selected; //This can be an object or a classname string
// Start progress bar
private ["_size", "_itemClass", "_displayName"];
if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then {
private _size = [_item] call FUNC(getSizeItem);
if ([_item, GVAR(interactionVehicle)] call FUNC(canUnloadItem)) then {
_size = [_item] call FUNC(getSizeItem);
[5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar);
[5 * _size, [_item, GVAR(interactionVehicle), ACE_player], "UnloadCargo", {}, localize LSTRING(UnloadingItem), {true}, ["isNotSwimming"]] call EFUNC(common,progressBar);
} else {
_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
_displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
private _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);
};

View File

@ -16,53 +16,45 @@
*/
#include "script_component.hpp"
params ["_item", "_vehicle"];
private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"];
params ["_item", "_vehicle", ["_unloader", objNull]];
TRACE_3("params",_item,_vehicle,_unloader);
if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith {
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
//This covers testing vehicle stability and finding a safe position
private _emptyPosAGL = [_vehicle, _itemClass, _unloader] call EFUNC(common,findUnloadPosition);
TRACE_1("findUnloadPosition",_emptyPosAGL);
if ((count _emptyPosAGL) != 3) exitWith {
TRACE_4("Could not find unload pos",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle);
if ((!isNull _unloader) && {_unloader == ACE_player}) then {
//display text saying there are no safe places to exit the vehicle
["displayTextStructured", [localize ELSTRING(common,NoRoomToUnload)]] call EFUNC(common,localEvent);
};
false
};
_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
private _loaded = _vehicle getVariable [QGVAR(loaded), []];
_validVehiclestate = true;
_emptyPos = [];
if (_vehicle isKindOf "Ship" ) then {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
TRACE_1("SHIP Ground Check", getPosATL _vehicle );
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot.
} else {
if (_vehicle isKindOf "Air" ) then {
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
_emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition);
_emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ];
} else {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, _itemClass]);
};
if !(_item in _loaded) exitWith {
ACE_LOGERROR_3("Tried to unload item [%1] not in vehicle[%2] cargo[%3]", _item, _vehicle, _loaded);
false
};
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
if (!_validVehiclestate) exitWith {false};
if (count _emptyPos == 0) exitWith {false};
_loaded = _vehicle getVariable [QGVAR(loaded), []];
_loaded deleteAt (_loaded find _item);
_vehicle setVariable [QGVAR(loaded), _loaded, true];
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem);
private _space = [_vehicle] call FUNC(getCargoSpaceLeft);
private _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
if (_item isEqualType objNull) then {
detach _item;
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
_item setPosASL (AGLtoASL _emptyPosAGL);
["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent);
} else {
createVehicle [_item, _emptyPos, [], 0, ""];
private _newItem = createVehicle [_item, _emptyPosAGL, [], 0, ""];
_newItem setPosASL (AGLtoASL _emptyPosAGL);
};
true

View File

@ -15,14 +15,13 @@
*/
#include "script_component.hpp"
private ["_loaded", "_newLoaded", "_totalSpaceOccupied"];
params ["_vehicle"];
TRACE_1("params",_vehicle);
_loaded = _vehicle getVariable [QGVAR(loaded), []];
private _loaded = _vehicle getVariable [QGVAR(loaded), []];
_newLoaded = [];
_totalSpaceOccupied = 0;
private _newLoaded = [];
private _totalSpaceOccupied = 0;
{
if ((_x isEqualType "") || {!isNull _x}) then {
_newLoaded pushback _x;

View File

@ -2,6 +2,9 @@
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_CARGO
#define DEBUG_MODE_FULL

View File

@ -43,7 +43,7 @@
<Polish>Pozostałe miejsce: %1</Polish>
<Portuguese>Espaço de carga restante: %1</Portuguese>
<Russian>Осталось мест: %1</Russian>
<Czech>Volný prostor: %1</Czech>
<Czech>Zbývající prostor: %1</Czech>
<Spanish>Espacio de carga restante: %1</Spanish>
</Key>
<Key ID="STR_ACE_Cargo_ModuleSettings_enable">
@ -62,6 +62,7 @@
<Portuguese>Ativar o módulo de carregamento de carga</Portuguese>
<Russian>Включает модуль погрузки и перевозки грузов</Russian>
<Spanish>Habilitar la carga en el módulo de carga</Spanish>
<Czech>Umožňuje naložit předměty do nákladového prostoru vozidla</Czech>
</Key>
<Key ID="STR_ACE_Cargo_SettingsModule_DisplayName">
<English>Cargo Settings</English>
@ -133,5 +134,14 @@
<Czech>%1&lt;br/&gt;nemůže být vyloženo</Czech>
<Russian>%1&lt;br/&gt;не может быть выгружен</Russian>
</Key>
<Key ID="STR_ACE_Cargo_makeLoadable_displayName">
<English>Make Object Loadable</English>
</Key>
<Key ID="STR_ACE_Cargo_makeLoadable_description">
<English>Sets the synced object as loadable by the cargo system.</English>
</Key>
<Key ID="STR_ACE_Cargo_makeLoadable_setSize_displayName">
<English>Object's Size</English>
</Key>
</Package>
</Project>

View File

@ -46,6 +46,7 @@ PREP(execPersistentFnc);
PREP(execRemoteFnc);
PREP(executePersistent);
PREP(filter);
PREP(findUnloadPosition);
PREP(fixCollision);
PREP(fixFloating);
PREP(fixLoweredRifleAnimation);
@ -153,6 +154,7 @@ PREP(selectWeaponMode);
PREP(sendRequest);
PREP(serverLog);
PREP(setAllGear);
PREP(setApproximateVariablePublic);
PREP(setCaptivityStatus);
PREP(setDefinedVariable);
PREP(setDisableUserInputStatus);

View File

@ -5,7 +5,7 @@
* Arguments [Client] :
* 0: eventName <STRING>
* 1: arguments <ARRAY>
* 2: ttl <SCALAR>
* 2: ttl <NUMBER>
*
* Return Value:
* Boolean of success <BOOL>

View File

@ -0,0 +1,117 @@
/*
* Author: PabstMirror, ViperMaul
* Find a safe place near a vehicle to unload something
* Handles Normal Terrain, In Water or On Buildings (Pier, StaticShip)
*
* Arguments:
* 0: Source Vehicle <OBJECT>
* 1: Cargo Classname <STRING>
* 2: Unloader (player) <OBJECT><OPTIONAL>
* 3: Max Distance (meters) <NUMBER><OPTIONAL>
* 4: Check Vehicle is Stable <BOOL><OPTIONAL>
*
* Return Value:
* Unload PositionAGL (Can Be [] if no valid pos found) <ARRAY>
*
* Example:
* [theCar, "CAManBase", player, 10, true] call ace_common_fnc_findUnloadPosition;
*
* Public: No
*/
// #define DEBUG_MODE_FULL
#include "script_component.hpp"
//Number of tests run (effects performance in worst case scenarior where nothing is found VERSUES reliably finding a pos):
#define MAX_TESTS 75
//Manual collision tests (count and radius):
#define COL_TEST_COUNT 12
params ["_vehicle", "_typeOfCargo", ["_theUnloader", objNull], ["_maxDistance", 10], ["_checkVehicleIsStable", true]];
TRACE_5("params",_vehicle,_typeOfCargo,_theUnloader,_maxDistance,_checkVehicleIsStable);
scopeName "main";
if (_checkVehicleIsStable) then {
if (((vectorMagnitude (velocity _vehicle)) > 1.5) || {(!(_vehicle isKindOf "Ship")) && {(!isTouchingGround _vehicle) && {((getPos _vehicle) select 2) > 1.5}}}) then {
TRACE_4("bad vehicle state",_vehicle,velocity _vehicle,isTouchingGround _vehicle,getPos _vehicle);
[] breakOut "main";
};
};
private _radiusOfItem = 1;
if (_typeOfCargo isKindOf "CAManBase") then {
_radiusOfItem = 1.1;
} else {
//`sizeOf` is unreliable, and does not work with object types that don't exist on map, so estimate size based on cargo size
if (isNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> QEGVAR(cargo,size))) then {
_radiusOfItem = (((getNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> QEGVAR(cargo,size))) ^ 0.35) max 0.75);
};
};
if (isNull _theUnloader) then {_theUnloader = _vehicle;};
//Ideal unload pos is halfway between unloader and vehicle (at the unloader's height)
private _originASL = ((getPosASL _theUnloader) vectorAdd (getPosASL _vehicle)) vectorMultiply 0.5;
_originASL set [2, (getPosASL _theUnloader) select 2];
private _originAGL = ASLtoAGL _originASL;
//Do a manual search for empty pos (handles underwater, buildings or piers)
TRACE_2("Checking for unload",_originAGL,_radiusOfItem);
private _rangeToCheck = 0;
while {_rangeToCheck < _maxDistance} do {
private _roundDistance = random _rangeToCheck;
private _roundAngle = random 360;
private _roundAGL = _originAGL vectorAdd [(cos _roundAngle) * _roundDistance, (sin _roundAngle) * _roundDistance, 0];
private _roundPointIsValid = false;
if (((AGLtoASL _roundAGL) select 2) > 0) then {
//Shoot a ray down, and make sure we hit something solid like a building or the ground:
private _belowRoundArray = lineIntersectsSurfaces [(AGLtoASL _roundAGL) vectorAdd [0,0,0.5], (AGLtoASL _roundAGL) vectorAdd [0,0,-1]];
TRACE_4("Testing for solid",_roundDistance,_roundAngle,_roundAGL,_belowRoundArray);
if (!(_belowRoundArray isEqualTo [])) then {
private _aboveBuilding = (_belowRoundArray select 0) select 2;
//Point is above something: Terrain(null) or Building
if ((isNull _aboveBuilding) || {_aboveBuilding isKindOf "Building"}) then {
//Get the real intersection point:
_roundAGL = ASLtoAGL ((_belowRoundArray select 0) select 0);
_roundPointIsValid = true;
};
};
} else {
//Underwater, just unload anywhere
TRACE_3("Under the sea",_roundDistance,_roundAngle,_roundAGL);
_roundPointIsValid = true;
};
//Make sure point is valid and do a fast check for people in the way (which sometimes aren't caught by line scaning)
if (_roundPointIsValid && {(_roundAGL nearEntities ["Man", _radiusOfItem]) isEqualTo []}) then {
for "_index" from 0 to (COL_TEST_COUNT -1) do {
//Scan for colisions with objects with lineIntersectsSurfaces
private _angle = _index * (360 / COL_TEST_COUNT);
private _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1];
private _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, (_radiusOfItem + 0.5)];
private _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL];
if (!(_testIntersections isEqualTo [])) exitWith {
TRACE_2("collision low/high",_roundAGL,_testIntersections);
_roundPointIsValid = false;
};
_point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.5];
_point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, 1];
_testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL];
if (!(_testIntersections isEqualTo [])) exitWith {
TRACE_2("collision mid",_roundAGL,_testIntersections);
_roundPointIsValid = false;
};
};
if (_roundPointIsValid) then {
TRACE_3("Valid point found", _rangeToCheck,_roundAGL, (_originAGL distance _roundAGL));
//Raise it slightly so we don't sink through the floor:
(_roundAGL vectorAdd [0,0,0.05]) breakOut "main";
};
};
_rangeToCheck = _rangeToCheck + (_maxDistance / MAX_TESTS);
};
TRACE_1("no valid spots found",_rangeToCheck);
[] //return empty array

View File

@ -1,11 +1,11 @@
/*
* Author: commy2
* Author: VKing
* Get the distance to the next object the player is looking at. Used for laser distance measurements.
*
* Arguments:
* 0: Messurement Accuracy <NUMBER>
* 1: Maximal messure distance <NUMBER>
* 2: Minimal messure distance (default: nil) <NUMBER>
* 0: Measurement Accuracy (default: 1) <NUMBER>
* 1: Maximum measure distance (default: 5000) <NUMBER>
* 2: Minimum measure distance (default: 0) <NUMBER>
*
* Return Value:
* Distance in meters <NUMBER>
@ -14,33 +14,23 @@
*/
#include "script_component.hpp"
params ["_interval", "_maxDistance", "_minDistance"];
params [["_accuracy",1], ["_maxDistance",5000], ["_minDistance",0]];
private _position = ATLToASL positionCameraToWorld [0, 0, 0];
_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)];
private _camPosition = AGLToASL positionCameraToWorld [0, 0, 0];
private _aimLinePos = AGLToASL positionCameraToWorld [0, 0, _maxDistance];
private _laser = + _position;
private _line = [_position, _laser];
private _LIS = lineIntersectsSurfaces [_camPosition, _aimLinePos];
private _distance = _maxDistance;
private _iteration = _distance;
while {
_iteration > _interval / 2
} do {
_iteration = _iteration / 2;
_laser = ATLToASL positionCameraToWorld [0, 0, _distance];
_laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)];
_line set [1, _laser];
_distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle ACE_player]) || {terrainIntersectASL _line})) * _iteration);
private _distance = 0;
if (count _LIS > 0) then {
_distance = _camPosition vectorDistance ((_LIS select 0) select 0);
} else {
_distance = _maxDistance;
};
_distance = _interval * round (_distance / _interval);
_distance = _distance max _minDistance;
_distance = _distance min _maxDistance;
if (!isNil "_minDistance") then {_distance = _distance max _minDistance};
_accuracy = _accuracy max 1;
_distance = (round (_distance/_accuracy)) * _accuracy;
_distance

View File

@ -1,6 +1,6 @@
/*
* Author: bux578, commy2
* Applies gear to unit.
* Applies gear to unit. It must be called in the machine in which the unit is local.
*
* Arguments:
* 0: Unit <OBJECT>
@ -20,6 +20,10 @@
params ["_unit", "_allGear", ["_clearAttachments", false], ["_clearBackpack", false]];
if (!local _unit) exitWith {
ACE_LOGWARNING_1("setAllGear - %1 has to be local.",_unit);
};
// remove all starting gear of a player
removeAllWeapons _unit;
removeGoggles _unit;

View File

@ -0,0 +1,42 @@
/*
* Author: esteldunedain
* Publish a variable if it's different enough from the previously published value.
*
* Argument:
* 0: Object the variable should be assigned to <OBJECT>
* 1: Name of the variable <STRING>
* 2: Value of the variable <ANY>
* 3: Absolute tolerance <NUMBER>
*
* Return value:
* Nothing.
*
* Example:
* [player, "balls", 2, 0.1] call ace_common_fnc_setApproximateVariablePublic;
*
* Public: No
*/
// #define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_object", "_varName", "_value", "_tolerance"];
TRACE_4("params",_object,_varName,_value,_tolerance);
// Set exact new value locally
_object setVariable [_varName, _value];
// Exit if in SP - "duh"
if (!isMultiplayer) exitWith {};
// If new value is not different
private _oldVarName = format ["ACE_oldValue_%1", _varName];
private _oldValue = _object getVariable [_oldVarName, -100000];
// Exit if new value is not different enough from the old onedifferent
if (abs(_value - _oldValue) < _tolerance) exitWith {};
// Publish the new value:
_object setVariable [_varName, _value, true];
_object setVariable [_oldVarName, _value];
TRACE_2("Published variable:", _varName, _value);

View File

@ -1,54 +1,53 @@
/*
* Author: commy2 and joko // Jonas
* Sets a public variable, but wait a certain amount of time to transfer the value over the network. Changing the value by calling this function again resets the windup timer.
* Author: commy2 and CAA-Picard and joko and PabstMirror
* Publish a variable, but wait a certain amount of time before allowing it to be published it again.
*
* Arguments:
* Argument:
* 0: Object the variable should be assigned to <OBJECT>
* 1: Name of the variable <STRING>
* 2: Value of the variable <ANY>
* 3: Windup time <NUMBER> (default: 1)
* 3: Embargo delay <NUMBER> (Optional. Default: 1)
*
* Return Value:
* None
* Return value:
* Nothing.
*
* Example:
* [player, "balls", 2, 1] call ace_common_fnc_setVariablePublic;
*
* Public: No
*/
// #define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_object", "_varName", "_value", ["_sync", 1]];
params ["_object", "_varName", "_value", ["_delay", 1]];
TRACE_4("params",_object,_varName,_value,_delay);
// set value locally
_object setVariable [_varName, _value];
// Exit if in SP
// Exit if in SP - "duh"
if (!isMultiplayer) exitWith {};
private _idName = format ["ACE_setVariablePublic_%1", _varName];
// If we are on embargo, exit
if (_object isEqualTo (_object getVariable [format ["ACE_onEmbargo_%1", _varName], objNull])) exitWith {};
if (_idName in GVAR(setVariableNames)) exitWith {};
// Publish Now and set last update time:
_object setVariable [_varName, _value, true];
_object setVariable [format ["ACE_onEmbargo_%1", _varName], _object];
private _syncTime = ACE_diagTime + _sync;
TRACE_2("Starting Embargo", _varName, _delay);
GVAR(setVariableNames) pushBack _idName;
[{
params ["_object", "_varName", "_value"];
if (isNull _object) exitWith {TRACE_1("objNull",_this);};
GVAR(setVariablePublicArray) pushBack [_object, _varName, _syncTime, _idName];
_object setVariable [format ["ACE_onEmbargo_%1", _varName], nil]; //Remove Embargo
private _curValue = _object getVariable _varName;
if (isNil QGVAR(setVariablePublicPFH)) exitWith {};
TRACE_4("End of embargo", _object, _varName, _value, _curValue);
GVAR(setVariablePublicPFH) = [{
{
_x params ["_object", "_varName", "_syncTime", "_idName"];
if (ACE_diagTime > _syncTime) then {
// set value public
_object setVariable [_varName, _object getVariable _varName, true];
GVAR(setVariablePublicArray) deleteAt (GVAR(setVariablePublicArray) find _x);
GVAR(setVariableNames) deleteAt (GVAR(setVariableNames) find _x);
};
nil
} count +GVAR(setVariablePublicArray);
if (GVAR(setVariablePublicArray) isEqualTo []) then {
[GVAR(setVariablePublicPFH)] call CBA_fnc_removePerFrameHandler;
GVAR(setVariablePublicPFH) = nil;
//If value at start of embargo doesn't equal current, then broadcast and start new embargo
if (!(_value isEqualTo _curValue)) then {
_this call FUNC(setVariablePublic);
};
}, 0, []] call CBA_fnc_addPerFrameHandler;
}, _this, _delay] call FUNC(waitAndExecute);

View File

@ -8,6 +8,9 @@
* Return Value:
* Returns true if succesfully unloaded person <BOOL>
*
* Example:
* [hurtGuy] call ace_common_fnc_unloadPerson
*
* Public: No
*/
#include "script_component.hpp"
@ -20,14 +23,10 @@ private _vehicle = vehicle _unit;
if (_vehicle == _unit) exitWith {false};
if (speed _vehicle > 1 || getPos _vehicle select 2 > 2) exitWith {false};
private _emptyPos = (getPos _vehicle) findEmptyPosition [0, 10, typeOf _unit]; // @todo to small?
if (count _emptyPos == 0) exitWith {false};
if (speed _vehicle > 1 || {((getPos _vehicle) select 2) > 2}) exitWith {false};
if (!isNull _vehicle) then {
[[_unit], QUOTE(FUNC(unloadPersonLocal)), _unit, false] call FUNC(execRemoteFnc);
["unloadPersonEvent", [_unit], [_unit, _vehicle]] call EFUNC(common,targetEvent);
};
true

View File

@ -3,7 +3,9 @@
* Unload a person from a vehicle, local
*
* Arguments:
* 0: unit <OBJECT>
* 0: unit to unload <OBJECT>
* 1: Vehicle <OBJECT>
* 2: Unloader (player) <OBJECT><OPTIONAL>
*
* Return Value:
* Returns true if succesfully unloaded person <BOOL>
@ -14,53 +16,22 @@
#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson))
params ["_unit", "_vehicle"];
TRACE_2("params",_unit,_vehicle);
params ["_unit", "_vehicle", ["_unloader", objNull]];
TRACE_3("params",_unit,_vehicle,_unloader);
private _validVehiclestate = true;
private _emptyPos = [];
//This covers testing vehicle stability and finding a safe position
private _emptyPos = [_vehicle, (typeOf _unit), _unloader] call EFUNC(common,findUnloadPosition);
TRACE_1("findUnloadPosition",_emptyPos);
if (_vehicle isKindOf "Ship") then {
if (speed _vehicle > 1 || {getPos _vehicle select 2 > 2}) then {
_validVehiclestate = false;
if (count _emptyPos != 3) exitwith {
ACE_LOGWARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle, getPosASL _vehicle, isTouchingGround _vehicle, speed _vehicle);
if ((!isNull _unloader) && {[_unloader] call FUNC(isPlayer)}) then {
//display text saying there are no safe places to exit the vehicle
["displayTextStructured", [_unloader], [localize LSTRING(NoRoomToUnload)]] call FUNC(targetEvent);
};
TRACE_1("SHIP Ground Check",getPos _vehicle);
_emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeOf _unit]; // TODO: if spot is underwater pick another spot.
} else {
if (_vehicle isKindOf "Air") then {
if (speed _vehicle > 1 || {!isTouchingGround _vehicle}) then {
_validVehiclestate = false;
};
TRACE_1("Vehicle Ground Check",isTouchingGround _vehicle);
_emptyPos = ASLToAGL getPosASL _vehicle;
_emptyPos = _emptyPos vectorAdd [random 10 - 5, random 10 - 5, 0];
} else {
if (speed _vehicle > 1 || {getPos _vehicle select 2 > 2}) then {
_validVehiclestate = false;
};
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
_emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeOf _unit];
};
};
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
if !(_validVehiclestate) exitWith {
ACE_LOGWARNING_4("Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPos _vehicle,isTouchingGround _vehicle,speed _vehicle);
false
};
if (count _emptyPos == 0) exitWith {
ACE_LOGWARNING_1("No safe empty spots to unload patient. %1",_emptyPos);
false
}; //consider displaying text saying there are no safe places to exit the vehicle
unassignVehicle _unit;
[_unit] orderGetIn false;
@ -87,16 +58,16 @@ _unit action ["Eject", vehicle _unit];
if ((_unit getVariable "ACE_isUnconscious") and (animationState _unit != _anim)) then {
[_unit, _anim, 2, true] call FUNC(doAnimation);
};
}, [_unit, _anim], 0.5, 0] call FUNC(waitAndExecute);
}, [_unit, _anim], 0.5] call FUNC(waitAndExecute);
};
};
}, [_unit, _emptyPos], 0.5, 0] call FUNC(waitAndExecute);
}, [_unit, _emptyPos], 0.5] call FUNC(waitAndExecute);
[_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide);
private _loaded = _vehicle getVariable [QGVAR(loaded_persons),[]];
private _loaded = _vehicle getvariable [QGVAR(loaded_persons),[]];
_loaded deleteAt (_loaded find _unit);
_vehicle setVariable [QGVAR(loaded_persons), _loaded, true];
_vehicle setvariable [QGVAR(loaded_persons), _loaded, true];
true

View File

@ -2,7 +2,9 @@
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_COMMON
#define DEBUG_MODE_FULL

View File

@ -418,7 +418,7 @@
<Russian>Цвет фона всплывающих подсказок АСЕ.</Russian>
<Polish>Kolor tła dla powiadomień ACE</Polish>
<French>Notification ACE: couleur de l'arrière plan</French>
<Czech>Barva pozadí ACE nápověd.</Czech>
<Czech>Barva pozadí ACE nápovědy.</Czech>
<Hungarian>Az ACE-súgók hátterének színe.</Hungarian>
<Portuguese>A cor de fundo das hints do ACE.</Portuguese>
</Key>
@ -430,7 +430,7 @@
<Russian>Цвет шрифта всплывающих подсказок</Russian>
<Polish>Kolor tekstu powiadomień</Polish>
<French>Notification: couleur du texte</French>
<Czech>Barva fontu nápověd.</Czech>
<Czech>Barva fontu nápovědy.</Czech>
<Hungarian>Súgószöveg betűinek színe</Hungarian>
<Portuguese>Cor do do texto da hint</Portuguese>
</Key>
@ -475,7 +475,7 @@
<Polish>Sprawdzaj PBO</Polish>
<Spanish>Comprobar PBOs</Spanish>
<German>Überprüfe PBOs</German>
<Czech>Zkontrolovat PBO</Czech>
<Czech>Zkontrolovat soubory PBO</Czech>
<Portuguese>Verificar PBOs</Portuguese>
<French>Vérifier les PBOs</French>
<Hungarian>PBO-k ellenőrzése</Hungarian>
@ -658,7 +658,7 @@
</Key>
<Key ID="STR_ACE_Common_Enabled">
<English>Enabled</English>
<Czech>Zapnuto</Czech>
<Czech>Povoleno</Czech>
<French>Oui</French>
<German>Aktiviert</German>
<Italian>Attivato</Italian>
@ -762,5 +762,8 @@
<Czech>ACE3 Vozidla</Czech>
<Spanish>ACE3 Vehículos</Spanish>
</Key>
<Key ID="STR_ACE_Common_NoRoomToUnload">
<English>No Room to unload</English>
</Key>
</Package>
</Project>
</Project>

View File

@ -2,6 +2,9 @@
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_CONCERTINA_WIRE
#define DEBUG_MODE_FULL

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="concertina_wire">
<Key ID="STR_ACE_CONCERTINA_WIRE">
@ -20,7 +20,7 @@
<Polish>Zwój koncentriny</Polish>
<Spanish>Bobina de alambre de espino</Spanish>
<French>Bobine de fil barbelé</French>
<Czech>Smyčka ostnatého drátu</Czech>
<Czech>Svitek ostnatého drátu</Czech>
<Italian>Concertina wire coil</Italian>
<Hungarian>Concertina wire coil</Hungarian>
<Portuguese>Bobina de arame farpado</Portuguese>

View File

@ -1,6 +1,11 @@
#define COMPONENT dagr
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_DAGR
#define DEBUG_MODE_FULL
#endif

View File

@ -1,6 +1,11 @@
#define COMPONENT difficulties
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_DIFFICULTIES
#define DEBUG_MODE_FULL
#endif

View File

@ -1,6 +1,11 @@
#define COMPONENT disarming
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_DISARMING
#define DEBUG_MODE_FULL
#endif

View File

@ -2,6 +2,9 @@
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_ATTACH
#define DEBUG_MODE_FULL

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Disposable">
<Key ID="STR_ACE_Disposable_UsedTube">
@ -29,7 +29,7 @@
<English>Preloaded Missile Dummy</English>
<German>Vorgeladene Racketennachbildung</German>
<French>Missile préchargé</French>
<Czech>Přednabitá dummy střela</Czech>
<Czech>Přednabitá maketa rakety</Czech>
<Polish>Wstępnie załadowana atrapa pocisku</Polish>
<Spanish>Precargado misil inerte</Spanish>
<Hungarian>Előtöltött műrakéta</Hungarian>
@ -38,4 +38,4 @@
<Portuguese>Míssel inerte pré-carregado</Portuguese>
</Key>
</Package>
</Project>
</Project>

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Check if unit can carry the object. Doesn't check weight.
*
* Arguments:
@ -10,6 +9,9 @@
* Return Value:
* Can the unit carry the object? <BOOL>
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_canCarry;
*
* Public: No
*/
#include "script_component.hpp"
@ -18,6 +20,10 @@ params ["_unit", "_target"];
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
//#2644 - Units with injured legs cannot bear the extra weight of carrying an object
//The fireman carry animation does not slow down for injured legs, so you could carry and run
if ((_unit getHitPointDamage "HitLegs") >= 0.5) exitWith {false};
// a static weapon has to be empty for dragging (ignore UAV AI)
if (((typeOf _target) isKindOf "StaticWeapon") && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false};

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Check if unit can drag the object. Doesn't check weight.
*
* Arguments:
@ -10,14 +9,14 @@
* Return Value:
* Can the unit drag the object? <BOOL>
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_canDrag;
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
params ["_unit", "_target"];
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Check if unit can drop the object.
*
* Arguments:
@ -10,6 +9,9 @@
* Return Value:
* Can the unit drop the object? <BOOL>
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_canDrop;
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Check if unit can drop the carried object.
*
* Arguments:
@ -10,6 +9,9 @@
* Return Value:
* Can the unit drop the object? <BOOL>
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_canDrop_carry;
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Carry an object.
*
* Arguments:
@ -10,17 +9,20 @@
* Return Value:
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_carryObject;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
// get attachTo offset and direction.
private ["_position", "_direction", "_UAVCrew"];
_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
_direction = _target getVariable [QGVAR(carryDirection), 0];
private _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
private _direction = _target getVariable [QGVAR(carryDirection), 0];
// handle objects vs persons
if (_target isKindOf "CAManBase") then {
@ -34,8 +36,7 @@ if (_target isKindOf "CAManBase") then {
} else {
// add height offset of model
private "_offset";
_offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2);
private _offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2);
_position = _position vectorAdd [0, 0, _offset];
@ -56,16 +57,20 @@ _unit setVariable [QGVAR(ReleaseActionID), [
] call EFUNC(common,addActionEventHandler)];
// show mouse hint
[localize LSTRING(Drop), "", localize LSTRING(LowerRaise)] call EFUNC(interaction,showMouseHint);
if (_target isKindOf "CAManBase") then {
[localize LSTRING(Drop), "", ""] call EFUNC(interaction,showMouseHint);
} else {
[localize LSTRING(Drop), "", localize LSTRING(LowerRaise)] call EFUNC(interaction,showMouseHint);
};
// check everything
[FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
[FUNC(carryObjectPFH), 0.5, [_unit, _target, ACE_time]] call CBA_fnc_addPerFrameHandler;
// reset current dragging height.
GVAR(currentHeightChange) = 0;
// prevent UAVs from firing
_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
if !(_UAVCrew isEqualTo []) then {
{_target deleteVehicleCrew _x} count _UAVCrew;

View File

@ -1,14 +1,20 @@
/*
* Author: commy2
*
* PFH for Carry Object
*
* Arguments:
* ?
* 0: ARGS <ARRAY>
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
* 2: Start time <NUMBER>
* 1: PFEH Id <NUMBER>
*
* Return Value:
* None
*
* Example:
* [[player, target], 20] call ace_dragging_fnc_carryObjectPFH;
*
* Public: No
*/
#include "script_component.hpp"
@ -18,14 +24,21 @@
#endif
params ["_args", "_idPFH"];
_args params ["_unit","_target"];
_args params ["_unit","_target", "_startTime"];
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
TRACE_2("carry false",_unit,_target);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if (!alive _target || {_unit distance _target > 10}) then {
TRACE_2("dead/distance",_unit,_target);
if ((_unit distance _target > 10) && {(ACE_time - _startTime) < 1}) exitWith {
//attachTo seems to have some kind of network delay and target can return an odd position durring the first few frames,
//so wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos)
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,ACE_time);
};
[_unit, _target] call FUNC(dropObject_carry);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Drag an object. Called from ace_dragging_fnc_startDrag
*
* Arguments:
@ -10,24 +9,29 @@
* Return Value:
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_dragObject;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_target"];
private ["_position", "_direction", "_offset", "_UAVCrew"];
TRACE_2("params",_unit,_target);
// get attachTo offset and direction.
_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
_direction = _target getVariable [QGVAR(dragDirection), 0];
private _position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
private _direction = _target getVariable [QGVAR(dragDirection), 0];
// add height offset of model
_offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2);
private _offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2);
if (_target isKindOf "CAManBase") then {
_offset = 0;
};
_position = _position vectorAdd [0, 0, _offset];
// attach object
TRACE_3("attaching",_position,_offset,_direction);
_target attachTo [_unit, _position];
["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent);
@ -49,13 +53,13 @@ _unit setVariable [QGVAR(ReleaseActionID), [
[localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint);
// check everything
[FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
[FUNC(dragObjectPFH), 0.5, [_unit, _target, ACE_time]] call CBA_fnc_addPerFrameHandler;
// reset current dragging height.
GVAR(currentHeightChange) = 0;
// prevent UAVs from firing
_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
if !(_UAVCrew isEqualTo []) then {
{_target deleteVehicleCrew _x} count _UAVCrew;

View File

@ -1,14 +1,20 @@
/*
* Author: commy2
*
* PFH for Drag Object
*
* Arguments:
* ?
* 0: ARGS <ARRAY>
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
* 2: Start time <NUMBER>
* 1: PFEH Id <NUMBER>
*
* Return Value:
* None
*
* Example:
* [[player, target], 20] call ace_dragging_fnc_dragObjectPFH;
*
* Public: No
*/
#include "script_component.hpp"
@ -18,14 +24,21 @@
#endif
params ["_args", "_idPFH"];
_args params ["_unit", "_target"];
_args params ["_unit","_target", "_startTime"];
if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
TRACE_2("drag false",_unit,_target);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if (!alive _target || {_unit distance _target > 10}) then {
TRACE_2("dead/distance",_unit,_target);
if ((_unit distance _target > 10) && {(ACE_time - _startTime) < 1}) exitWith {
//attachTo seems to have some kind of network delay and target can return an odd position durring the first few frames,
//so wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos)
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,ACE_time);
};
[_unit, _target] call FUNC(dropObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Drop a dragged object.
*
* Arguments:
@ -10,17 +9,20 @@
* Return Value:
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_dropObject;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
// remove drop action
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
private "_inBuilding";
_inBuilding = [_unit] call FUNC(isObjectOnObject);
private _inBuilding = [_unit] call FUNC(isObjectOnObject);
if !(_unit getVariable ["ACE_isUnconscious", false]) then {
// play release animation
@ -47,6 +49,7 @@ _unit removeWeapon "ACE_FakePrimaryWeapon";
// prevent object from flipping inside buildings
if (_inBuilding) then {
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
TRACE_2("setPos",getPosASL _unit,getPosASL _target);
};
// hide mouse hint

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Drop a carried object.
*
* Arguments:
@ -10,17 +9,20 @@
* Return Value:
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_dropObject_carry;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
// remove drop action
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
private "_inBuilding";
_inBuilding = [_unit] call FUNC(isObjectOnObject);
private _inBuilding = [_unit] call FUNC(isObjectOnObject);
// prevent collision damage
["fixCollision", _unit] call EFUNC(common,localEvent);

View File

@ -1,6 +1,5 @@
/*
* Author: L-H, edited by commy2, rewritten by joko // Jonas
*
* Returns the weight of a crate.
*
* Arguments:
@ -10,20 +9,20 @@
* Total Weight <NUMBER>
*
* Example:
* _weight = Crate1 call ace_dragging_fnc_getweight;
* [Crate1] call ace_dragging_fnc_getweight;
*
* Public: No
*/
#include "script_component.hpp"
private "_totalWeight";
params ["_object"];
// Initialize the total weight.
_totalWeight = 0;
private _totalWeight = 0;
// Cycle through all item types with their assigned config paths.
{
_x params["_items","_getConfigCode"];
_x params ["_items", "_getConfigCode"];
_items params ["_item", "_count"];
// Cycle through all items and read their mass out of the config.
{

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Handle the animaion for a Unit for Dragging Module
*
* Arguments:
@ -17,35 +16,28 @@
*/
#include "script_component.hpp"
private ["_unit", "_anim"];
_unit = _this select 0;
_anim = _this select 1;
params ["_unit", "_anim"];
if (_unit getVariable [QGVAR(isDragging), false]) then {
// drop dragged object when not in valid animation
if !(_anim in DRAG_ANIMATIONS) then {
private "_draggedObject";
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
if (!isNull _draggedObject) then {
[_unit, _draggedObject] call FUNC(dropObject);
};
};
};
if (_unit getVariable [QGVAR(isCarrying), false]) then {
// drop carried object when not standing; also some exceptions when picking up crate
if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then {
private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
if (!isNull _carriedObject) then {
[_unit, _carriedObject] call FUNC(dropObject_carry);
};
};
};

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Handle death of the dragger
*
* Arguments:
@ -17,17 +16,16 @@
#include "script_component.hpp"
params ["_unit"];
TRACE_1("params",_unit);
if (_unit getVariable [QGVAR(isDragging), false]) then {
private "_draggedObject";
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
[_unit, _draggedObject] call FUNC(dropObject);
};
if (_unit getVariable [QGVAR(isCarrying), false]) then {
private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
[_unit, _carriedObject] call FUNC(dropObject_carry);
};

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Handle player changes.
*
* Arguments:
@ -11,13 +10,14 @@
* None
*
* Example:
* [_unitNew, _unitOld] call ace_dragging_fnc_handlePlayerChanged;
* [_newPlayer, _oldPlayer] call ace_dragging_fnc_handlePlayerChanged;
*
* Public: No
*/
#include "script_component.hpp"
params ["_newPlayer", "_oldPlayer"];
TRACE_2("params",_newPlayer,_oldPlayer);
{
if (_x getVariable [QGVAR(isDragging), false]) then {

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Handle the Weapon Changed Event
*
* Arguments:
@ -11,20 +10,20 @@
* None
*
* Example:
* [_unit, _currentWeapon] call ace_dragging_fnc_handlePlayerWeaponChanged;
* [_unit, "gun"] call ace_dragging_fnc_handlePlayerWeaponChanged;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_weapon"];
TRACE_2("params",_unit,_weapon);
if (_unit getVariable [QGVAR(isDragging), false]) then {
// drop dragged object when selecting a non-primary weapon
if (_weapon != primaryWeapon _unit) then {
private "_draggedObject";
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
[_unit, _draggedObject] call FUNC(dropObject);
};
@ -33,8 +32,7 @@ if (_unit getVariable [QGVAR(isDragging), false]) then {
if (_unit getVariable [QGVAR(isCarrying), false]) then {
private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
if (_carriedObject isKindOf "CAManBase") then {

View File

@ -1,6 +1,5 @@
/*
* Author: L-H, commy2
*
* Handles raising and lowering the dragged weapon to be able to place it on top of objects.
*
* Arguments:
@ -9,15 +8,16 @@
* Return Value:
* Handled or not. <BOOL>
*
* Example:
* [0.1] call ace_dragging_fnc_handleScrollWheel;
*
* Public: No
*/
#include "script_component.hpp"
params ["_scrollAmount"];
private ["_unit", "_carriedItem", "_position", "_maxHeight"];
_unit = ACE_player;
private _unit = ACE_player;
// EH is always assigned. Exit and don't overwrite input if not carrying
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false};
@ -25,13 +25,13 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false};
// move carried item 15 cm per scroll interval
_scrollAmount = _scrollAmount * 0.15;
_carriedItem = _unit getVariable [QGVAR(carriedObject), objNull];
private _carriedItem = _unit getVariable [QGVAR(carriedObject), objNull];
//disabled for persons
if (_carriedItem isKindOf "CAManBase") exitWith {false};
_position = getPosATL _carriedItem;
_maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2;
private _position = getPosATL _carriedItem;
private _maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2;
_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight];

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Handle the Unconscious of a Unit while Dragging
*
* Arguments:
@ -16,15 +15,13 @@
*/
#include "script_component.hpp"
private ["_player", "_draggedObject", "_carriedObject"];
params ["_unit"];
_player = ACE_player;
private _player = ACE_player;
if (_player getVariable [QGVAR(isDragging), false]) then {
_draggedObject = _player getVariable [QGVAR(draggedObject), objNull];
private _draggedObject = _player getVariable [QGVAR(draggedObject), objNull];
// handle falling unconscious
if (_unit == _player) then {
@ -40,7 +37,7 @@ if (_player getVariable [QGVAR(isDragging), false]) then {
if (_player getVariable [QGVAR(isCarrying), false]) then {
_carriedObject = _player getVariable [QGVAR(carriedObject), objNull];
private _carriedObject = _player getVariable [QGVAR(carriedObject), objNull];
// handle falling unconscious
if (_unit == _player) then {

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Initialize variables for drag or carryable objects. Called from init EH.
*
* Argument:
@ -9,26 +8,27 @@
* Return Value:
* None
*
* Example:
* [box] call ace_dragging_fnc_initObject;
*
* Public: No
*/
#include "script_component.hpp"
private ["_position", "_direction", "_config"];
params ["_object"];
_config = configFile >> "CfgVehicles" >> typeOf _object;
private _config = configFile >> "CfgVehicles" >> typeOf _object;
if (getNumber (_config >> QGVAR(canDrag)) == 1) then {
_position = getArray (_config >> QGVAR(dragPosition));
_direction = getNumber (_config >> QGVAR(dragDirection));
private _position = getArray (_config >> QGVAR(dragPosition));
private _direction = getNumber (_config >> QGVAR(dragDirection));
[_object, true, _position, _direction] call FUNC(setDraggable);
};
if (getNumber (_config >> QGVAR(canCarry)) == 1) then {
_position = getArray (_config >> QGVAR(carryPosition));
_direction = getNumber (_config >> QGVAR(carryDirection));
private _position = getArray (_config >> QGVAR(carryPosition));
private _direction = getNumber (_config >> QGVAR(carryDirection));
[_object, true, _position, _direction] call FUNC(setCarryable);
};

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Initialize variables for drag or carryable persons. Called from init EH.
*
* Argument:
@ -9,6 +8,9 @@
* Return value:
* None
*
* Example:
* [player] call ace_dragging_fnc_initPerson;
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Check if Object is Overlapping
*
* Argument:
@ -9,6 +8,9 @@
* Return value:
* <BOOL>
*
* Example;
* [player] call ace_dragging_fnc_isObjectOnObject
*
* Public: No
*/
params ["_object"];

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Enable the object to be carried.
*
* Argument:
@ -12,12 +11,13 @@
* Return Value:
* None
*
* Example:
* [object, true, [0,1,1], 0] call ace_dragging_fnc_setCarryable;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_carryAction", "_dropAction", "_type", "_initializedClasses"];
params ["_object", "_enableCarry", "_position", "_direction"];
if (isNil "_position") then {
@ -34,8 +34,8 @@ _object setVariable [QGVAR(carryPosition), _position];
_object setVariable [QGVAR(carryDirection), _direction];
// add action to class if it is not already present
_type = typeOf _object;
_initializedClasses = GETGVAR(initializedClasses_carry,[]);
private _type = typeOf _object;
private _initializedClasses = GETGVAR(initializedClasses_carry,[]);
// do nothing if the class is already initialized
if (_type in _initializedClasses) exitWith {};
@ -43,8 +43,8 @@ if (_type in _initializedClasses) exitWith {};
_initializedClasses pushBack _type;
GVAR(initializedClasses_carry) = _initializedClasses;
_carryAction = [QGVAR(carry), localize LSTRING(Carry), "", {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction);
_dropAction = [QGVAR(drop_carry), localize LSTRING(Drop), "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction);
private _carryAction = [QGVAR(carry), localize LSTRING(Carry), "", {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction);
private _dropAction = [QGVAR(drop_carry), localize LSTRING(Drop), "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _carryAction] call EFUNC(interact_menu,addActionToClass);
[_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass);

View File

@ -1,22 +1,23 @@
/*
* Author: commy2
*
* Enable the object to be dragged.
*
* Argument:
* 0: Any object (Object)
* 1: true to enable dragging, false to disable (Bool)
* 0: Any object <OBJECT>
* 1: true to enable dragging, false to disable <BOOL>
* 2: Position offset for attachTo command (Array, optinal; default: [0,0,0])
* 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0)
*
* Return value:
* None
*
* Example:
* [object, true, [0,0,0], 0] call ace_dragging_fnc_setDraggable;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_dragAction", "_dropAction", "_type", "_initializedClasses"];
//IGNORE_PRIVATE_WARNING("_player", "_target");
params ["_object", "_enableDrag", "_position", "_direction"];
@ -34,8 +35,8 @@ _object setVariable [QGVAR(dragPosition), _position];
_object setVariable [QGVAR(dragDirection), _direction];
// add action to class if it is not already present
_type = typeOf _object;
_initializedClasses = GETGVAR(initializedClasses,[]);
private _type = typeOf _object;
private _initializedClasses = GETGVAR(initializedClasses,[]);
// do nothing if the class is already initialized
if (_type in _initializedClasses) exitWith {};
@ -43,8 +44,8 @@ if (_type in _initializedClasses) exitWith {};
_initializedClasses pushBack _type;
GVAR(initializedClasses) = _initializedClasses;
_dragAction = [QGVAR(drag), localize LSTRING(Drag), "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction);
_dropAction = [QGVAR(drop), localize LSTRING(Drop), "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction);
private _dragAction = [QGVAR(drag), localize LSTRING(Drag), "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction);
private _dropAction = [QGVAR(drop), localize LSTRING(Drop), "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _dragAction] call EFUNC(interact_menu,addActionToClass);
[_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass);

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Start the carrying process.
*
* Arguments:
@ -10,22 +9,24 @@
* Return Value:
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_startCarry;
*
* Public: No
*/
#include "script_component.hpp"
private ["_weight", "_timer"];
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
// check weight
_weight = [_target] call FUNC(getWeight);
private _weight = [_target] call FUNC(getWeight);
if (_weight > missionNamespace getVariable ["ACE_maxWeightCarry", 1E11]) exitWith {
[localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
};
_timer = ACE_time + 5;
private _timer = ACE_time + 5;
// handle objects vs persons
if (_target isKindOf "CAManBase") then {

View File

@ -1,14 +1,20 @@
/*
* Author: commy2
*
* Carry PFH
*
* Arguments:
* ?
* 0: ARGS <ARRAY>
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
* 2: Timeout <NUMBER>
* 1: PFEH Id <NUMBER>
*
* Return Value:
* None
*
* Example:
* [[player, target, 100], 20] call ace_dragging_fnc_startCarryPFH;
*
* Public: No
*/
#include "script_component.hpp"
@ -22,11 +28,13 @@ _args params ["_unit", "_target", "_timeOut"];
// handle aborting carry
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
TRACE_4("carry false",_unit,_target,_timeOut,ACE_time);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if (!alive _target || {_unit distance _target > 10}) then {
TRACE_4("dead/distance",_unit,_target,_timeOut,ACE_time);
[_unit, _target] call FUNC(dropObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
@ -34,25 +42,26 @@ if (!alive _target || {_unit distance _target > 10}) then {
// handle persons vs objects
if (_target isKindOf "CAManBase") then {
if (ACE_time > _timeOut) exitWith {
TRACE_4("Start carry person",_unit,_target,_timeOut,ACE_time);
[_unit, _target] call FUNC(carryObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
} else {
if (ACE_time > _timeOut) exitWith {
TRACE_4("timeout",_unit,_target,_timeOut,ACE_time);
[_idPFH] call CBA_fnc_removePerFrameHandler;
// drop if in timeout
private "_draggedObject";
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
[_unit, _draggedObject] call FUNC(dropObject);
};
// wait for the unit to stand up
if (stance _unit == "STAND") exitWith {
TRACE_4("Start carry object",_unit,_target,_timeOut,ACE_time);
[_unit, _target] call FUNC(carryObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
};

View File

@ -1,6 +1,5 @@
/*
* Author: commy2
*
* Start the dragging process.
*
* Argument:
@ -9,14 +8,19 @@
*
* Return value:
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_startDrag;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
// check weight
private "_weight";
_weight = [_target] call FUNC(getWeight);
private _weight = [_target] call FUNC(getWeight);
if (_weight > missionNamespace getVariable ["ACE_maxWeightDrag", 1E11]) exitWith {
[localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);

View File

@ -1,14 +1,20 @@
/*
* Author: commy2
*
* Drag PFH
*
* Arguments:
* ?
* 0: ARGS <ARRAY>
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
* 2: Timeout <NUMBER>
* 1: PFEH Id <NUMBER>
*
* Return Value:
* None
*
* Example:
* [[player, target, 100], 20] call ace_dragging_fnc_startDragPFH;
*
* Public: No
*/
#include "script_component.hpp"
@ -22,27 +28,30 @@ _args params ["_unit", "_target", "_timeOut"];
// handle aborting drag
if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
TRACE_4("drag false",_unit,_target,_timeOut,ACE_time);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if (!alive _target || {_unit distance _target > 10}) then {
TRACE_4("dead/distance",_unit,_target,_timeOut,ACE_time);
[_unit, _target] call FUNC(dropObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
// timeout. Do nothing. Quit. ACE_time, because anim length is linked to ingame time.
if (ACE_time > _timeOut) exitWith {
TRACE_4("timeout",_unit,_target,_timeOut,ACE_time);
[_idPFH] call CBA_fnc_removePerFrameHandler;
// drop if in timeout
private "_draggedObject";
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
[_unit, _draggedObject] call FUNC(dropObject);
};
// unit is ready to start dragging
if (animationState _unit in DRAG_ANIMATIONS) exitWith {
TRACE_4("Start Dragging",_unit,_target,_timeOut,ACE_time);
[_unit, _target] call FUNC(dragObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;

View File

@ -2,6 +2,10 @@
#include "\z\ace\addons\main\script_mod.hpp"
//#define DEBUG_ENABLED_DRAGGING
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_DRAGGING
#define DEBUG_MODE_FULL

View File

@ -34,7 +34,7 @@
<Portuguese>Objeto muito pesado</Portuguese>
<Italian>L'oggetto pesa troppo</Italian>
<Russian>Предмет слишком тяжёлый</Russian>
<Czech>Moc težké</Czech>
<Czech>Předmět je moc těžký</Czech>
<Hungarian>Az objektum túl nehéz</Hungarian>
</Key>
<Key ID="STR_ACE_Dragging_Carry">

Some files were not shown because too many files have changed in this diff Show More