mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Rearm - Improve framework documentation (#9114)
* Added scripted way of creating a rearm source to framework documentation * Fixed indentation level * More verbosity * Updated phrasing * * Fixed bad copy paste job * Changed introduction version to more likely candidate * Reordered `makeSource` under `Functions` and applied hopefully more sensible order of "create source > ammo specifics" * Wording fix and further reorder * Fixed wording to be in line with rest of document * Further updated order * Update docs/wiki/framework/rearm-framework.md Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Update docs/wiki/framework/rearm-framework.md Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Update docs/wiki/framework/rearm-framework.md Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Update docs/wiki/framework/rearm-framework.md Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Update docs/wiki/framework/rearm-framework.md Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * Added execution hint to makeSource --------- Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
This commit is contained in:
parent
27a2a7c131
commit
0a2e7d1202
@ -14,7 +14,16 @@ version:
|
|||||||
|
|
||||||
## 1. Config Values
|
## 1. Config Values
|
||||||
|
|
||||||
### 1.1 Ammo Configs
|
### 1.1 Setting vehicle as a supply
|
||||||
|
|
||||||
|
A vehicle will be set as a supply vehicle based on the config `ace_rearm_defaultSupply`
|
||||||
|
```cpp
|
||||||
|
class MyTruck: Car_F {
|
||||||
|
ace_rearm_defaultSupply = 1200;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.2 Ammo Configs
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
class CfgAmmo {
|
class CfgAmmo {
|
||||||
@ -38,18 +47,6 @@ class CfgVehicles {
|
|||||||
<p>ace_rearm_dummy is only needed if you have a custom ammunition model. For each model you should create a dummy vehicle extending ace_rearm_defaultCarriedObject.</p>
|
<p>ace_rearm_dummy is only needed if you have a custom ammunition model. For each model you should create a dummy vehicle extending ace_rearm_defaultCarriedObject.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
### 1.2 Setting vehicle as a supply
|
|
||||||
A vehicle will be set as a supply vehicle based on the config `ace_rearm_defaultSupply`
|
|
||||||
```cpp
|
|
||||||
class MyTruck: Car_F {
|
|
||||||
ace_rearm_defaultSupply = 1200;
|
|
||||||
};
|
|
||||||
```
|
|
||||||
<div class="panel callout">
|
|
||||||
<h5>Note:</h5>
|
|
||||||
<p>Mission makers can also use `this setVariable ["ace_rearm_isSupplyVehicle", true]`</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## 2. Variables
|
## 2. Variables
|
||||||
|
|
||||||
### 2.1 Allow Rearming of Scripted Loadouts
|
### 2.1 Allow Rearming of Scripted Loadouts
|
||||||
@ -67,7 +64,105 @@ VEHICLE setVariable ["ace_rearm_scriptedLoadout", true, true];
|
|||||||
|
|
||||||
## 3. Functions
|
## 3. Functions
|
||||||
|
|
||||||
### 3.1 Adding specific magazines
|
#### 3.1 Make an object into a rearm source
|
||||||
|
*Added in ACE3 3.12.3*
|
||||||
|
|
||||||
|
Meant to run on server only.
|
||||||
|
|
||||||
|
`ace_rearm_fnc_makeSource`
|
||||||
|
|
||||||
|
| Arguments | Type | Optional (default value)
|
||||||
|
---| --------- | ---- | ------------------------
|
||||||
|
0 | Ammo Truck | Object | Required
|
||||||
|
1 | Supply Count | Number | Optional (default: `0`)
|
||||||
|
1 | Add (`true`) or set (`false`) supply | Bool | Optional (default: `false`)
|
||||||
|
**R** | None | None | Return value
|
||||||
|
|
||||||
|
#### 3.1.1 Example
|
||||||
|
|
||||||
|
`[cursorObject, 1200] call ace_rearm_fnc_makeSource`
|
||||||
|
|
||||||
|
| Arguments | Explanation
|
||||||
|
---| --------- | -----------
|
||||||
|
0 | `cursorObject` | Rearm source object
|
||||||
|
1 | `1200` | Ammo supply
|
||||||
|
|
||||||
|
### 3.2 Enabling / disabling rearming
|
||||||
|
|
||||||
|
`ace_rearm_fnc_disable`
|
||||||
|
|
||||||
|
| Arguments | Type | Optional (default value)
|
||||||
|
---| --------- | ---- | ------------------------
|
||||||
|
0 | Ammo Truck | Object | Required
|
||||||
|
1 | Disable rearming, true to disable, false to enable | Boolean | Optional (default: `true`)
|
||||||
|
**R** | None | None | Return value
|
||||||
|
|
||||||
|
This function disables rearming for all supported turrets of a vehicle.
|
||||||
|
|
||||||
|
#### 3.2.1 Example 1
|
||||||
|
|
||||||
|
`[tank] call ace_rearm_fnc_disable;`
|
||||||
|
|
||||||
|
| Arguments | Explanation
|
||||||
|
---| --------- | -----------
|
||||||
|
0 | `tank` | My object
|
||||||
|
|
||||||
|
Disables rearming on the object `tank`.
|
||||||
|
|
||||||
|
#### 3.2.2 Example 2
|
||||||
|
|
||||||
|
`[tank, false] call ace_rearm_fnc_disable;`
|
||||||
|
|
||||||
|
| Arguments | Explanation
|
||||||
|
---| --------- | -----------
|
||||||
|
0 | `tank` | My object
|
||||||
|
1 | `false`| Rearming is enabled
|
||||||
|
|
||||||
|
Enables rearming on the object `tank`.
|
||||||
|
|
||||||
|
### 3.3 Getting the supply count
|
||||||
|
|
||||||
|
`ace_rearm_fnc_getSupplyCount`
|
||||||
|
|
||||||
|
| Arguments | Type | Optional (default value)
|
||||||
|
---| --------- | ---- | ------------------------
|
||||||
|
0 | Ammo Truck | Object | Required
|
||||||
|
**R** | Supply count | Number | Return value
|
||||||
|
|
||||||
|
This function returns the current supply count of the ammo truck.
|
||||||
|
|
||||||
|
#### 3.3.1 Example
|
||||||
|
|
||||||
|
`[ammo_truck] call ace_rearm_fnc_getSupplyCount;`
|
||||||
|
|
||||||
|
| Arguments | Explanation
|
||||||
|
---| --------- | -----------
|
||||||
|
0 | `ammo_truck` | My object
|
||||||
|
|
||||||
|
The remaining supply count of `ammo_truck` will be returned.
|
||||||
|
|
||||||
|
### 3.4 Setting the supply count
|
||||||
|
|
||||||
|
`ace_rearm_fnc_setSupplyCount`
|
||||||
|
|
||||||
|
| Arguments | Type | Optional (default value)
|
||||||
|
---| --------- | ---- | ------------------------
|
||||||
|
0 | Ammo Truck | Object | Required
|
||||||
|
1 | Supply Count | Boolean | Required
|
||||||
|
**R** | None | None | Return value
|
||||||
|
|
||||||
|
This function sets the current supply count of the ammo truck. It can be used to replenish the ammo truck on `Limited ammo supply based on caliber` setting.
|
||||||
|
|
||||||
|
#### 3.4.1 Example
|
||||||
|
|
||||||
|
`[ammo_truck, 1000] call ace_rearm_fnc_setSupplyCount;`
|
||||||
|
|
||||||
|
| Arguments | Explanation
|
||||||
|
---| --------- | -----------
|
||||||
|
0 | `ammo_truck` | My ammo truck object
|
||||||
|
1 | `1000`| Supply Count
|
||||||
|
|
||||||
|
### 3.5 Adding specific magazines
|
||||||
|
|
||||||
`ace_rearm_fnc_addMagazineToSupply`
|
`ace_rearm_fnc_addMagazineToSupply`
|
||||||
|
|
||||||
@ -82,7 +177,7 @@ This function is most useful with the module setting `Only specific Magazines`.
|
|||||||
|
|
||||||
This function can also be used to increase the supply count on setting `Limited ammo supply based on caliber` by a certain caliber value.
|
This function can also be used to increase the supply count on setting `Limited ammo supply based on caliber` by a certain caliber value.
|
||||||
|
|
||||||
#### 3.1.1 Example
|
#### 3.5.1 Example
|
||||||
|
|
||||||
`[ammo_truck, "32Rnd_155mm_Mo_shells"] call ace_rearm_fnc_addMagazineToSupply;`
|
`[ammo_truck, "32Rnd_155mm_Mo_shells"] call ace_rearm_fnc_addMagazineToSupply;`
|
||||||
|
|
||||||
@ -93,7 +188,7 @@ This function can also be used to increase the supply count on setting `Limited
|
|||||||
|
|
||||||
The 32 artillery shells are added to the supply count or the magazine storage of the specified ammo truck.
|
The 32 artillery shells are added to the supply count or the magazine storage of the specified ammo truck.
|
||||||
|
|
||||||
### 3.2 Adding all magazines of a specific vehicle
|
### 3.6 Adding all magazines of a specific vehicle
|
||||||
|
|
||||||
`ace_rearm_fnc_addVehicleMagazinesToSupply`
|
`ace_rearm_fnc_addVehicleMagazinesToSupply`
|
||||||
|
|
||||||
@ -103,9 +198,9 @@ The 32 artillery shells are added to the supply count or the magazine storage of
|
|||||||
1 | Any vehicle object or class name | Object or String | Required
|
1 | Any vehicle object or class name | Object or String | Required
|
||||||
**R** | None | None | Return value
|
**R** | None | None | Return value
|
||||||
|
|
||||||
This functions wraps `ace_rearm_fnc_addMagazineToSupply` and uses it to add all default magazines of all supported turrets of the vehicle to the ammo truck.
|
This function wraps `ace_rearm_fnc_addMagazineToSupply` and uses it to add all default magazines of all supported turrets of the vehicle to the ammo truck.
|
||||||
|
|
||||||
#### 3.2.1 Example 1
|
#### 3.6.1 Example 1
|
||||||
|
|
||||||
`[ammo_truck, tank] call ace_rearm_fnc_addVehicleMagazinesToSupply;`
|
`[ammo_truck, tank] call ace_rearm_fnc_addVehicleMagazinesToSupply;`
|
||||||
|
|
||||||
@ -116,7 +211,7 @@ This functions wraps `ace_rearm_fnc_addMagazineToSupply` and uses it to add all
|
|||||||
|
|
||||||
All magazines found in the class config of the object `tank` are made available.
|
All magazines found in the class config of the object `tank` are made available.
|
||||||
|
|
||||||
#### 3.2.2 Example 2
|
#### 3.6.2 Example 2
|
||||||
|
|
||||||
`[ammo_truck, "B_MBT_01_arty_F"] call ace_rearm_fnc_addVehicleMagazinesToSupply;`
|
`[ammo_truck, "B_MBT_01_arty_F"] call ace_rearm_fnc_addVehicleMagazinesToSupply;`
|
||||||
|
|
||||||
@ -127,61 +222,8 @@ All magazines found in the class config of the object `tank` are made available.
|
|||||||
|
|
||||||
All magazines found in the config of the vehicle class `B_MBT_01_arty_F` are made available.
|
All magazines found in the config of the vehicle class `B_MBT_01_arty_F` are made available.
|
||||||
|
|
||||||
### 3.3 Enabling / disabling rearming
|
|
||||||
|
|
||||||
`ace_rearm_fnc_disable`
|
### 3.7 Removing magazines from supply
|
||||||
|
|
||||||
| Arguments | Type | Optional (default value)
|
|
||||||
---| --------- | ---- | ------------------------
|
|
||||||
0 | Any object | Object | Required
|
|
||||||
1 | Disable rearming, true to disable, false to enable | Boolean | Optional (default: `true`)
|
|
||||||
**R** | None | None | Return value
|
|
||||||
|
|
||||||
This functions disables rearming for all supported turrets of a certain vehicle.
|
|
||||||
|
|
||||||
#### 3.3.1 Example 1
|
|
||||||
|
|
||||||
`[tank] call ace_rearm_fnc_disable;`
|
|
||||||
|
|
||||||
| Arguments | Explanation
|
|
||||||
---| --------- | -----------
|
|
||||||
0 | `tank` | My object
|
|
||||||
|
|
||||||
Disables rearming on the object `tank`.
|
|
||||||
|
|
||||||
#### 3.3.2 Example 2
|
|
||||||
|
|
||||||
`[tank, false] call ace_rearm_fnc_disable;`
|
|
||||||
|
|
||||||
| Arguments | Explanation
|
|
||||||
---| --------- | -----------
|
|
||||||
0 | `tank` | My object
|
|
||||||
1 | `false`| Rearming is enabled
|
|
||||||
|
|
||||||
Enables rearming on the object `tank`.
|
|
||||||
|
|
||||||
### 3.4 Getting the supply count
|
|
||||||
|
|
||||||
`ace_rearm_fnc_getSupplyCount`
|
|
||||||
|
|
||||||
| Arguments | Type | Optional (default value)
|
|
||||||
---| --------- | ---- | ------------------------
|
|
||||||
0 | Ammo Truck | Object | Required
|
|
||||||
**R** | Supply count | Number | Return value
|
|
||||||
|
|
||||||
This functions returns the current supply count of the ammo truck.
|
|
||||||
|
|
||||||
#### 3.4.1 Example
|
|
||||||
|
|
||||||
`[ammo_truck] call ace_rearm_fnc_getSupplyCount;`
|
|
||||||
|
|
||||||
| Arguments | Explanation
|
|
||||||
---| --------- | -----------
|
|
||||||
0 | `ammo_truck` | My object
|
|
||||||
|
|
||||||
The remaining supply count of `ammo_truck` will be returned.
|
|
||||||
|
|
||||||
### 3.5 Removing magazines from supply
|
|
||||||
|
|
||||||
`ace_rearm_fnc_removeMagazineFromSupply`
|
`ace_rearm_fnc_removeMagazineFromSupply`
|
||||||
|
|
||||||
@ -192,7 +234,7 @@ The remaining supply count of `ammo_truck` will be returned.
|
|||||||
2 | Number of Rounds to withdraw | Number | Optional (default: `-1`)
|
2 | Number of Rounds to withdraw | Number | Optional (default: `-1`)
|
||||||
**R** | Magazine could be removed successfully | Boolean | Return value
|
**R** | Magazine could be removed successfully | Boolean | Return value
|
||||||
|
|
||||||
#### 3.5.1 Example 1
|
#### 3.7.1 Example 1
|
||||||
|
|
||||||
`[ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_removeMagazineFromSupply;`
|
`[ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_removeMagazineFromSupply;`
|
||||||
|
|
||||||
@ -201,9 +243,9 @@ The remaining supply count of `ammo_truck` will be returned.
|
|||||||
0 | `ammo_truck` | My ammo truck object
|
0 | `ammo_truck` | My ammo truck object
|
||||||
1 | `"500Rnd_127x99_mag_Tracer_Red"`| Carrying is enabled
|
1 | `"500Rnd_127x99_mag_Tracer_Red"`| Carrying is enabled
|
||||||
|
|
||||||
Removes one ammo box worth of 500Rnd_127x99_mag_Tracer_Red from the supply. Depending on the module setting the ammo box does hold an entire magazine or only the caliber based amount of rounds.
|
Removes one ammo box worth of "500Rnd_127x99_mag_Tracer_Red" from the supply. Depending on the module setting the ammo box does hold an entire magazine or only the caliber based amount of rounds.
|
||||||
|
|
||||||
#### 3.5.2 Example 2
|
#### 3.7.2 Example 2
|
||||||
|
|
||||||
`[ammo_truck, "500Rnd_127x99_mag_Tracer_Red", 50] call ace_rearm_fnc_removeMagazineFromSupply;`
|
`[ammo_truck, "500Rnd_127x99_mag_Tracer_Red", 50] call ace_rearm_fnc_removeMagazineFromSupply;`
|
||||||
|
|
||||||
@ -215,27 +257,6 @@ Removes one ammo box worth of 500Rnd_127x99_mag_Tracer_Red from the supply. Depe
|
|||||||
|
|
||||||
Removes one ammo box with 50 rounds of 500Rnd_127x99_mag_Tracer_Red from the supply. This is 10% of the supply of an entire magazine.
|
Removes one ammo box with 50 rounds of 500Rnd_127x99_mag_Tracer_Red from the supply. This is 10% of the supply of an entire magazine.
|
||||||
|
|
||||||
### 3.6 Setting the supply count
|
|
||||||
|
|
||||||
`ace_rearm_fnc_setSupplyCount`
|
|
||||||
|
|
||||||
| Arguments | Type | Optional (default value)
|
|
||||||
---| --------- | ---- | ------------------------
|
|
||||||
0 | Ammo Truck | Object | Required
|
|
||||||
1 | Supply Count | Boolean | Required
|
|
||||||
**R** | None | None | Return value
|
|
||||||
|
|
||||||
This function sets the current supply count of the ammo truck. It can be used to replenish the ammo truck on `Limited ammo supply based on caliber` setting.
|
|
||||||
|
|
||||||
#### 3.6.1 Example
|
|
||||||
|
|
||||||
`[ammo_truck, 1000] call ace_rearm_fnc_setSupplyCount;`
|
|
||||||
|
|
||||||
| Arguments | Explanation
|
|
||||||
---| --------- | -----------
|
|
||||||
0 | `ammo_truck` | My ammo truck object
|
|
||||||
1 | `1000`| Supply Count
|
|
||||||
|
|
||||||
## 4. Events
|
## 4. Events
|
||||||
|
|
||||||
| Name | Arguments | Global? | Added in |
|
| Name | Arguments | Global? | Added in |
|
||||||
|
Loading…
Reference in New Issue
Block a user