mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Refuel - Improve framework documentation (#9122)
* Refuel framework doc update * Fixed one explanation * Unified terminology * Changed order to mirror that of rearm-doc update in PR #9114 * Added execution hints for makeSource and makeJerryCan
This commit is contained in:
parent
eef506b7eb
commit
27a2a7c131
@ -18,11 +18,11 @@ version:
|
|||||||
```cpp
|
```cpp
|
||||||
class CfgVehicles {
|
class CfgVehicles {
|
||||||
class MyFuelTruck {
|
class MyFuelTruck {
|
||||||
ace_refuel_fuelCargo = 3000; // Fuel cargo
|
ace_refuel_fuelCargo = 3000; // Maximum fuel cargo amount (in liters)
|
||||||
ace_refuel_hooks[] = {{0.38,-3.17,-.7},{-0.41,-3.17,-.7}}; // Nozzle hooks positions
|
ace_refuel_hooks[] = {{0.38,-3.17,-.7},{-0.41,-3.17,-.7}}; // Nozzle hooks positions
|
||||||
};
|
};
|
||||||
class MyCar {
|
class MyCar {
|
||||||
ace_refuel_fuelCapacity = 100; // Fuel tank volume
|
ace_refuel_fuelCapacity = 100; // Fuel tank volume (in liters)
|
||||||
};
|
};
|
||||||
class MyElectricCar {
|
class MyElectricCar {
|
||||||
ace_refuel_canReceive = 0; // For vehicles which can't be refueled
|
ace_refuel_canReceive = 0; // For vehicles which can't be refueled
|
||||||
@ -38,16 +38,39 @@ class CfgVehicles {
|
|||||||
|
|
||||||
## 2. Functions
|
## 2. Functions
|
||||||
|
|
||||||
### 2.1 Getting the fuel supply
|
### 2.1 Make an object into a refuel source
|
||||||
|
*Added in ACE3 3.11.0*
|
||||||
|
|
||||||
|
Meant to be called on server only.
|
||||||
|
|
||||||
|
`ace_refuel_fnc_makeSource`
|
||||||
|
|
||||||
|
| Arguments | Type | Optional (default value)
|
||||||
|
---| --------- | ---- | ------------------------
|
||||||
|
0 | Fuel Source | Object | Required
|
||||||
|
1 | Amount (in liters) | Number | Optional (default: `0`)
|
||||||
|
2 | Hooks positions | Array | Optional (default: `[[0,0,0]]`)
|
||||||
|
**R** | None | None | Return value
|
||||||
|
|
||||||
|
#### 2.1.1 Example
|
||||||
|
|
||||||
|
`[cursorObject, 100] call ace_refuel_fnc_makeSource`
|
||||||
|
|
||||||
|
| Arguments | Explanation
|
||||||
|
---| --------- | -----------
|
||||||
|
0 | `cursorObject` | Fuel source object
|
||||||
|
1 | `100` | Fuel amount (in liters)
|
||||||
|
|
||||||
|
### 2.2 Getting the fuel supply
|
||||||
|
|
||||||
`ace_refuel_fnc_getFuel`
|
`ace_refuel_fnc_getFuel`
|
||||||
|
|
||||||
| Arguments | Type | Optional (default value)
|
| Arguments | Type | Optional (default value)
|
||||||
---| --------- | ---- | ------------------------
|
---| --------- | ---- | ------------------------
|
||||||
0 | Fuel Truck | Object | Required
|
0 | Fuel Truck | Object | Required
|
||||||
**R** | Fuel left (in liters) | Number | Return value
|
**R** | Fuel amount left (in liters) | Number | Return value
|
||||||
|
|
||||||
#### 2.1.1 Example
|
#### 2.2.1 Example
|
||||||
|
|
||||||
`[fuelTruck] call ace_refuel_fnc_getFuel;`
|
`[fuelTruck] call ace_refuel_fnc_getFuel;`
|
||||||
|
|
||||||
@ -55,37 +78,6 @@ class CfgVehicles {
|
|||||||
---| --------- | -----------
|
---| --------- | -----------
|
||||||
0 | `fuelTruck` | My fuel truck object
|
0 | `fuelTruck` | My fuel truck object
|
||||||
|
|
||||||
### 2.2 Make a jerry can
|
|
||||||
|
|
||||||
`ace_refuel_fnc_makeJerryCan`
|
|
||||||
|
|
||||||
| Arguments | Type | Optional (default value)
|
|
||||||
---| --------- | ---- | ------------------------
|
|
||||||
0 | My Object | Object | Required
|
|
||||||
1 | Fuel amount (in liters) | Number | Optional (default: `20`)
|
|
||||||
**R** | None | None | Return value
|
|
||||||
|
|
||||||
#### 2.2.1 Example 1
|
|
||||||
|
|
||||||
`[can] call ace_refuel_fnc_makeJerryCan;`
|
|
||||||
|
|
||||||
| Arguments | Explanation
|
|
||||||
---| --------- | -----------
|
|
||||||
0 | `can` | My jerry can object
|
|
||||||
|
|
||||||
The jerry can will have the default 20 liters volume.
|
|
||||||
|
|
||||||
#### 2.2.2 Example 2
|
|
||||||
|
|
||||||
`[can, 200] call ace_refuel_fnc_makeJerryCan;`
|
|
||||||
|
|
||||||
| Arguments | Explanation
|
|
||||||
---| --------- | -----------
|
|
||||||
0 | `can` | My jerry can object
|
|
||||||
1 | `200` | Vehicle class name
|
|
||||||
|
|
||||||
The jerry can will now have a volume of 200 liters.
|
|
||||||
|
|
||||||
### 2.3 Setting the fuel supply
|
### 2.3 Setting the fuel supply
|
||||||
|
|
||||||
`ace_refuel_fnc_setFuel`
|
`ace_refuel_fnc_setFuel`
|
||||||
@ -102,29 +94,41 @@ The jerry can will now have a volume of 200 liters.
|
|||||||
|
|
||||||
| Arguments | Explanation
|
| Arguments | Explanation
|
||||||
---| --------- | -----------
|
---| --------- | -----------
|
||||||
0 | `fuelTruck` | My fuel truck object
|
0 | `fuelTruck` | Fuel truck object
|
||||||
1 | `428` | New fuel supply
|
1 | `428` | New fuel amount (in liters)
|
||||||
|
|
||||||
### 2.4 Make an object into a refuel source
|
### 2.4 Make a jerry can
|
||||||
*Added in ACE3 3.11.0*
|
|
||||||
|
|
||||||
`ace_refuel_fnc_makeSource`
|
Meant to be run on all clients and server.
|
||||||
|
|
||||||
|
`ace_refuel_fnc_makeJerryCan`
|
||||||
|
|
||||||
| Arguments | Type | Optional (default value)
|
| Arguments | Type | Optional (default value)
|
||||||
---| --------- | ---- | ------------------------
|
---| --------- | ---- | ------------------------
|
||||||
0 | Fuel Source | Object | Required
|
0 | Jerry Can | Object | Required
|
||||||
1 | Amount (in liters) | Number | Optional (default: `0`)
|
1 | Amount (in liters) | Number | Optional (default: `20`)
|
||||||
2 | Hooks positions | Array | Optional (default: `[[0,0,0]]`)
|
|
||||||
**R** | None | None | Return value
|
**R** | None | None | Return value
|
||||||
|
|
||||||
#### 2.4.1 Example
|
#### 2.4.1 Example 1
|
||||||
|
|
||||||
`[cursorObject, 100] call ace_refuel_fnc_makeSource`
|
`[can] call ace_refuel_fnc_makeJerryCan;`
|
||||||
|
|
||||||
| Arguments | Explanation
|
| Arguments | Explanation
|
||||||
---| --------- | -----------
|
---| --------- | -----------
|
||||||
0 | `cursorObject` | Fuel source object
|
0 | `can` | Jerry can object
|
||||||
1 | `100` | Fuel supply
|
|
||||||
|
The jerry can will have the default 20 liters volume.
|
||||||
|
|
||||||
|
#### 2.4.2 Example 2
|
||||||
|
|
||||||
|
`[can, 200] call ace_refuel_fnc_makeJerryCan;`
|
||||||
|
|
||||||
|
| Arguments | Explanation
|
||||||
|
---| --------- | -----------
|
||||||
|
0 | `can` | Jerry can object
|
||||||
|
1 | `200` | Amount (in liters)
|
||||||
|
|
||||||
|
The jerry can will now have a volume of 200 liters.
|
||||||
|
|
||||||
## 3. Events
|
## 3. Events
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user