-
Note:
-
The following functions are NOT public and are likely to change in the future!
-
-
You will **not** be able to carry / drag objects that are too heavy, the mass is also affected by what is inside the object. To bypass this empty the object. You can change the weight limits by setting `ACE_maxWeightDrag` (default 800) and `ACE_maxWeightCarry` (default 600).
### 2.1 Enabling / disabling dragging
@@ -103,3 +98,27 @@ You will **not** be able to carry / drag objects that are too heavy, the mass is
| 1 | `true`| Carrying is enabled |
| 2 | `[0,2,0]` | 0 meters sideways, 3 meters forward, 1 meter upwards |
| 3 | `10` | Rotated by 10° |
+
+## 3. Corpse moving
+Added in 3.18.0, ACE allows you to drag and carry corpses.
+
+### 3.1 Config Values
+
+```cpp
+class CfgVehicles {
+ class MyUnit {
+ ace_dragging_cloneClass = "MyClone"; // Allows you to define what type of clone is used for moving the corpse (default: "ace_dragging_clone")
+ };
+
+ class ace_dragging_clone;
+ class MyClone: ace_dragging_clone {}; // Custom clones must inherit from ace_dragging_clone
+};
+```
+
+### 3.2 Enabling / disabling corpse moving
+
+By default, corpse moving is enabled. If you wish to disable it, you can set the variable below to `false`:
+
+```sqf
+ace_dragging_canMoveDead = false;
+```
diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md
index 4aad8f16741..b531387ee79 100644
--- a/docs/wiki/framework/events-framework.md
+++ b/docs/wiki/framework/events-framework.md
@@ -167,7 +167,20 @@ MenuType: 0 = Interaction, 1 = Self Interaction
| `ace_headless_groupTransferPre` | [_group, _HC (OBJECT), _previousOwner, _idHC] | Target | Listen | Called just before a group is transferred from any machine to a HC. Called where group currently is local and on the HC, where group is going to be local.
| `ace_headless_groupTransferPost` | [_group, _HC (OBJECT), _previousOwner, _idHC, _transferredSuccessfully] | Target | Listen | Called just after a group is transferred from a machine to a HC. Called where group was local and on the HC, where group is now local. `_transferredSuccessfully` is passed so mods can actually check if the locality was properly transferred, as ownership transfer is not guaranteed.
-### 2.18 HuntIR (`ace_huntir`)
+### 2.18 Dragging (`ace_dragging`)
+
+| Event Key | Parameters | Locality | Type | Description |
+|---------- |------------|----------|------|-------------|
+| `ace_dragging_cloneCreated` | [_clone, _corpse] | Local | Listen | Called when a clone used for dragging/carrying corpses is created
+| `ace_dragging_cloneDeleted` | [_clone, _corpse] | Local | Listen | Called when a clone used for dragging/carrying corpses is deleted
+| `ace_dragging_setupCarry` | [_unit, _target] | Local | Listen | Called when the unit starts the carrying animation for the target
+| `ace_dragging_startedCarry` | [_unit, _target] | Local | Listen | Called when the unit starts successfully carrying the target. This event is called after `ace_dragging_setupCarry`.
+| `ace_dragging_stoppedCarry` | [_unit, _target, _loadCargo] | Local | Listen | Called when the unit stops carrying the target. `_loadCargo` says if the target is being loaded as cargo/person or not.
+| `ace_dragging_setupDrag` | [_unit, _target] | Local | Listen | Called when the unit starts the dragging animation for the target
+| `ace_dragging_startedDrag` | [_unit, _target] | Local | Listen | Called when the unit starts successfully dragging the target. This event is called after `ace_dragging_setupDrag`.
+| `ace_dragging_stoppedDrag` | [_unit, _target] | Local | Listen | Called when the unit stops dragging the target
+
+### 2.19 HuntIR (`ace_huntir`)
| Event Key | Parameters | Locality | Type | Description |
|---------- |------------|----------|------|-------------|
diff --git a/docs/wiki/framework/fortify-framework.md b/docs/wiki/framework/fortify-framework.md
index 9de0fab35b3..19cdf45e6b9 100644
--- a/docs/wiki/framework/fortify-framework.md
+++ b/docs/wiki/framework/fortify-framework.md
@@ -109,10 +109,22 @@ The Fortify budget can be updated for any side using the function.
* [west, -250, false] call ace_fortify_fnc_updateBudget
```
+## 2. Config Values
-## 2. Events
+### 2.1 Enabling fortify tools on an item or backpack
+```cpp
+class CfgWeapons { // same config also works on backpacks (CfgVehicles)
+ class yourBaseClass;
+ class yourFortifyToolClass: yourBaseClass {
+ ace_fortify_fortifyTool = 1;
+ };
+};
+```
+
+
+## 3. Events
-### 2.1 Listenable
+### 3.1 Listenable
| Event Name | Passed Parameter(s) | Locality | Description |
| ---------- | ----------- | ------------------- | -------- |
diff --git a/docs/wiki/framework/frag-framework.md b/docs/wiki/framework/frag-framework.md
index d05f5068f69..2c453eb7497 100644
--- a/docs/wiki/framework/frag-framework.md
+++ b/docs/wiki/framework/frag-framework.md
@@ -14,7 +14,7 @@ version:
## 1. Overview
-The fragmentation system in ACE3 is a significant improvement over the fragmentation system in ACE2. Previously the system relied on fuzzy math from the values of `indirectHit` and `indirectHitRange` in `CfgAmmo` to calculate roughly the velocity and range of fragmentation. This had some serious drawbacks, especially in the case of smaller explosives such as hand grenades and 40mm grenades where casualty production was lower than desired.
+The fragmentation system in ACE3 is a significant improvement over the fragmentation system in ACE2. Previously the system relied on fuzzy math from the values of `indirectHit` and `indirectHitRange` in `CfgAmmo` to calculate roughly the velocity and range of fragmentation. This had some serious drawbacks, especially in the case of smaller explosives such as hand grenades and 40mm grenades where lethality was lower than desired.
In ACE3 the system has moved away from what "feels" right to actual explosive engineering equations, primarily the [Gurney equations](http://en.wikipedia.org/wiki/Gurney_equations). This allows us to get close to the actual fragmentation velocities that would be produced by an explosive configuration similar to type of ammo we are simulating.
@@ -26,7 +26,7 @@ The system for the end-developer is easy to use, and only requires minimal resea
```cpp
class CfgAmmo {
class MyGrenade {
- ace_frag_enabled = 1; // Enable fragmentation (0-disabled, 1-enabled)
+ ace_frag_enabled = 1; // Deprecated
ace_frag_metal = 210; // Amount of metal being fragmented (grams) - information below
ace_frag_charge = 185; // Amount of explosive filler (grams) - information below
ace_frag_gurney_c = 2843; // Gurney velocity constant for explosive type - information below
@@ -38,27 +38,27 @@ class CfgAmmo {
};
```
-### 1.1 Metal amount
+### 2.1 Metal amount
`ace_frag_metal`
-Amount of metal being fragmented (generally taken as the entire weight of the warhead, though in some cases you might want to only include the fragmentation jacket or body.
+The amount of metal being fragmented. Generally taken as the entire weight of the warhead, though in some cases you might want to only include the fragmentation jacket or body.
-Dimensionless value, as long as same unit as `ace_frag_charge` (for example `kg/kg` or `g/g` or `lbs/lbs`).
+`ace_frag_charge` is the total mass of fragmenting metal given in grams.
-### 1.2 Explosives filler amount
+### 2.2 Explosives filler amount
`ace_frag_charge`
-Amount of explosive filler in the warhead. `ace_frag_metal` and `ace_frag_charge` are dimensionless values, as long as they are both in the same unit (for example kg/kg g/g lbs/lbs).
+The mass of explosive filler in the warhead. This may include any detonation/ignition charges, but usually such charges are relatively small.
-Dimensionless value, as long as same unit as `ace_frag_metal` (for example `kg/kg` or `g/g` or `lbs/lbs`).
+`ace_frag_metal` is the total mass of explosive filler given in grams.
-### 1.3 Gurney velocity constant
+### 2.3 Gurney velocity constant
`ace_frag_gurney_c`
-Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is **not** the detonation velocity of the explosive, do not confuse them!
+The Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is **not** the detonation velocity of the explosive, do not confuse them†!
| Type | Speed |
| --------------- | -------- |
@@ -77,11 +77,13 @@ Gurney constant for explosive force. You can find a list of common explosive typ
| TNT | 2440 m/s |
| Tritonal | 2320 m/s |
-### 1.4 Gurney shape factor
+†A rule of thumb from literature is that the Gurney constant is given as 0.338 times the detonation velocity.
+
+### 2.4 Gurney shape factor
`ace_frag_gurney_k`
-Shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors.
+The shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors.
| Shape | Factor |
| -------- | ------ |
@@ -91,7 +93,7 @@ Shape factor for the explosive configuration. You should choose it based on the
There are other configurations but these are the most common. If you are interested in others check out the wikipedia link given above. Most of these will not correctly function in ACE3 though due to additional variables for the equation.
-### 1.5 Fragments type
+### 2.5 Fragments type
`ace_frag_classes[]`
@@ -110,16 +112,16 @@ There are different types of fragmentation fragments to choose from, and they ca
| ACE_frag_huge |
| ACE_frag_huge_HD |
-The tinier the piece of fragmentation the shorter the distance of travel. The `_HD` variants are all even higher drag versions. Grenades generally should use the `_HD` variants. Experimentation here is important.
+Tinier fragments do less damage, and generally correlate to lower mass fragments. The `_HD` variants are all higher drag versions. Higher drag version are useful for fragments that are irregular or would not fly very far. Experimentation here is important.
-### 1.6 Ignore fragmentation
+### 2.6 Ignore fragmentation
`ace_frag_skip`
-Setting this to `1` will skip fragmentation for ammo of this type. This is useful for things that might cause high network load, such as FFAR rockets, or possibly even 40mm grenades from AGLs. Experimentation under network conditions is required.
+When `1`, the ammunition type will not produce fragments. `ace_frag_skip` does not stop submunitions of the ammo type from producing fragments. `ace_frag_skip` may be helpful for ammunition types that might cause high network load or for explosives that do not produce fragments. Experimentation under network conditions may be required. `ace_frag_skip` takes a higher priority than `ace_frag_force`.
-### 1.7 Force fragmentation
+### 2.7 Force fragmentation
`ace_frag_force`
-Settings this to `1` will force the fragmentation system to use frag on this ammo, ignoring internal qualifications based on hit values.
+When `1`, the ammunition type will fragment, ignoring internal hit value-based qualifications. `ace_frag_force` takes a lower priority than `ace_frag_skip`.
diff --git a/docs/wiki/framework/goggles-framework.md b/docs/wiki/framework/goggles-framework.md
index 07840ebf95a..e7201041d06 100644
--- a/docs/wiki/framework/goggles-framework.md
+++ b/docs/wiki/framework/goggles-framework.md
@@ -38,3 +38,4 @@ class CfgGlasses {
| ---------- | ----------- | ------------------- | -------- |
| `ace_glassesChanged` | Glasses Changed | `[_unit, _glassesClass]` | Local |
| `ace_glassesCracked` | Glasses Cracked | `[_unit]` | Local |
+| `ace_goggles_effect` | Applied Goggle Effect | `[_unit, "cause"]` | Local
diff --git a/docs/wiki/framework/grenades-framework.md b/docs/wiki/framework/grenades-framework.md
index 755773c1710..dcf1f60cd00 100644
--- a/docs/wiki/framework/grenades-framework.md
+++ b/docs/wiki/framework/grenades-framework.md
@@ -74,7 +74,7 @@ The average amount of time in seconds, after `explosionTime` has passed, between
The amount of randomness in the fuse time.
-### 2.1.5 ace_grenades_flashbangExplodeSound
+#### 2.1.5 ace_grenades_flashbangExplodeSound
The sounds that can be used when the flashbang detonates. It randomly selects an entry from this array (equal chances, there are no weights involved).
If not defined, `[format ["A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_0%1.wss", floor (random 4) + 1], 5, 1.2, 400]` is used as a default instead (4 sounds total).
@@ -108,7 +108,7 @@ class CfgAmmo {
If set to zero or left undefined, the grenade is not treated as a flare. If it is set to 1, the grenade will be treated as a flare with the associated effects.
-#### 2.3.1 ace_grenades_color
+#### 2.3.2 ace_grenades_color
Sets the color of the emitted light. The first 3 values of the array of the color, the last is the light intensity.
diff --git a/docs/wiki/framework/javelin-framework.md b/docs/wiki/framework/javelin-framework.md
index ba2a390f309..136066f4dbd 100644
--- a/docs/wiki/framework/javelin-framework.md
+++ b/docs/wiki/framework/javelin-framework.md
@@ -18,7 +18,7 @@ version:
class CfgWeapons {
class MyLauncher {
ace_javelin_enabled = 1; // Enable Javelin-style locking (0-disabled, 1-enabled)
- weaponInfoType = "ACE_RscOptics_javelin"; // Inteface
+ weaponInfoType = "ACE_RscOptics_javelin"; // Interface
modelOptics = "\z\ace\addons\javelin\data\reticle_titan.p3d"; // Optics model
canLock = 0; // Disable vanilla locking (0-disabled, 1-enabled)
lockingTargetSound[] = {"", 0, 1}; // Locking sound
diff --git a/docs/wiki/framework/missile-guidance-framework.md b/docs/wiki/framework/missile-guidance-framework.md
index df83559996d..4264f7a1d68 100644
--- a/docs/wiki/framework/missile-guidance-framework.md
+++ b/docs/wiki/framework/missile-guidance-framework.md
@@ -144,9 +144,32 @@ class ace_missileguidance_navigationTypes {
};
```
-## 5. Events
+## 5. Migrating From Old Missile Guidance
-### 5.1 Listenable
+There are a few changes existing missiles need to implement to work with the new framework. Although sensible defaults are used, they may not be sufficient for all users
+
+### 5.1 Turn Rate
+
+`minDeflection`, `maxDeflection`, and `incDeflection` are all deprecated. These values were never used before, and had no meaning. The new system one should use is through `pitchRate` and `yawRate`: these describe the missiles rotation in pitch and yaw in degrees/second
+
+### 5.2 Navigation
+
+Missiles before didn't have any navigation logic. The new framework utilizes a navigation autopilot to guide the missile. You must add `defaultNavigationType`, `navigationTypes` and `navigationGain` to your missiles.
+
+### 5.2.1 Available Navigation Types
+
+| Navigation Name | Description | Use Case | Caveats |
+| ---------- | ----------- | ------------------- | ------- |
+| `Direct` | Adjusts missile direction so it is always pointing at the target | If you have a static target that doesn't need movement prediction | N/A |
+| `Line` | Attempts to drive missile so the direction to the target is zero | Any missile which needs to follow a line | Can only be used with some seekers |
+| `LineOfSight` | Accelerations missile to null-out the line-of-sight rate of change to try and intercept target | Old missiles which have a low-hit rate that predict target motion | N/A |
+| `ProportionalNavigation` | Adjusts missile to enter collision course with target | Missiles which intercept by predicting target motion | N/A |
+| `AugmentedProportionalNavigation` | Adjusts missile to enter collision course with target while taking into account target acceleration to reduce energy loss | Missiles which intercept by predicting target motion | N/A |
+| `ZeroEffortMiss` | Adjusts missile to enter collision course with target with minimal energy loss | Missiles which intercept by predicting target motion | N/A |
+
+## 6. Events
+
+### 6.1 Listenable
| Event Name | Description | Passed Parameter(s) | Locality |
| ---------- | ----------- | ------------------- | -------- |
diff --git a/extension/Cargo.toml b/extension/Cargo.toml
index 1131bc39087..a50d1e16bc7 100644
--- a/extension/Cargo.toml
+++ b/extension/Cargo.toml
@@ -8,7 +8,7 @@ name = "ace"
crate-type = ["cdylib"]
[dependencies]
-arma-rs = { version = "1.10.5", features = ["uuid"] }
+arma-rs = { version = "1.11.10", default-features = false, features = ["extension", "uuid"]}
uuid = { version = "1.10.0", features = ["v4"] }
rand = "0.8.5"
rand_chacha = "0.3.1"
diff --git a/extension/src/artillery/simulate.rs b/extension/src/artillery/simulate.rs
index b776a831cfe..2201d4d2ec9 100644
--- a/extension/src/artillery/simulate.rs
+++ b/extension/src/artillery/simulate.rs
@@ -71,8 +71,13 @@ pub fn find_solution(
return (-1.0, -1.0, -1.0);
}
let radicand = radicand.sqrt();
- let angle_root =
+ let mut angle_root =
(muzzle_velocity.mul_add(*muzzle_velocity, radicand) / (GRAVITY * range_to_hit)).atan();
+ if angle_root > max_elev || angle_root < min_elev {
+ angle_root = (muzzle_velocity.mul_add(*muzzle_velocity, -radicand)
+ / (GRAVITY * range_to_hit))
+ .atan();
+ }
if angle_root > max_elev || angle_root < min_elev {
return (-1.0, -1.0, -1.0);
}
diff --git a/extension/src/ballistics/atmosphere.rs b/extension/src/ballistics/atmosphere.rs
index 69000c5bded..9781d6e5669 100644
--- a/extension/src/ballistics/atmosphere.rs
+++ b/extension/src/ballistics/atmosphere.rs
@@ -1,4 +1,4 @@
-use arma_rs::FromArma;
+use arma_rs::{FromArma, FromArmaError};
use super::map::Map;
use crate::common::Temperature;
@@ -10,12 +10,12 @@ pub enum AtmosphereModel {
}
impl FromArma for AtmosphereModel {
- fn from_arma(s: String) -> Result