ACE3/docs/wiki/framework/field-rations-framework.md
Grim 30a0e55843
Field Rations - Add arsenal category (#9221)
* add field rations category

* improve macro

* second verse same as the first

* account for empty items

* switch to configClasses

* documentation

* add API variable

* Update docs/wiki/framework/field-rations-framework.md
2023-07-07 07:14:35 +03:00

3.3 KiB

layout title description group parent mod version redirect_from
wiki Field Rations Framework Explains how to set-up ACE Field Rations. framework wiki acex
major minor patch
3 4 0
/wiki/frameworkx/field-rations-framework.html

1. Config Values

1.1 Consumable Items

Config Name Type Description
acex_field_rations_thirstQuenched Number Amount of thirst quenched when item is consumed*
acex_field_rations_hungerSatiated Number Amount of hunger satiated when item is consumed*
acex_field_rations_consumeTime Number Time required to consume the item (in seconds)
acex_field_rations_consumeText String Progress bar text (OPTIONAL)
acex_field_rations_consumeAnims Array Animations to play when consuming item** (OPTIONAL)
acex_field_rations_consumeSounds Array Sounds to play when consuming item** (OPTIONAL)
acex_field_rations_replacementItem String Class name of replacement item to add on consumption (OPTIONAL)
acex_field_rations_refillItem String Makes an item refillable, class name of item added when refilled (OPTIONAL)
acex_field_rations_refillAmount Number Amount of water required to refill item (OPTIONAL)
acex_field_rations_refillTime Number Time required to refill item (in seconds) (OPTIONAL)
ACE_isFieldRationItem Number Force adds the item to the ACE Field Rations category in ACE Arsenal (OPTIONAL)

* Value range is 0 to 100 and can be modified by the corresponding coefficient setting.

** Array is in format: STAND, CROUCH, PRONE. If player is in vehicle, the first element is used.

1.2 Water Sources

Config Name Type Description
acex_field_rations_waterSupply Number Amount of water inside the object (-1 - disabled, -10 - infinite) (OPTIONAL)
acex_field_rations_offset Array Refill action offset relative to model (OPTIONAL)

2. Events

Event Name Passed Parameter(s) Locality Description
acex_rationConsumed [_player, _consumeItem, _replacementItem, _thirstQuenched, _hungerSatiated, _isMagazine] Local Item consumed
acex_rationRefilled [_source, _player, _item, _refillItem, _refillAmount, _isMagazine] Local Item refilled

3. Scripting

3.1 Getting water supply

ace_field_rations_fnc_getRemainingWater

* Returns the remaining water in a source.
*
* Arguments:
* 0: Water source <OBJECT>
*
* Return Value:
* Remaining water <NUMBER>
*
* Example:
* [_source] call ace_field_rations_fnc_getRemainingWater

3.2 Setting water supply

ace_field_rations_fnc_setRemainingWater

* Sets the remaining water supply for given water source.
*
* Arguments:
* 0: Water source <OBJECT>
* 1: Amount (-10 - Infinite, -1 - Disabled) <NUMBER>
*
* Return Value:
* None
*
* Example:
* [_source, 1000] call ace_field_rations_fnc_setRemainingWater

3.3 Adding a status modifier

ace_field_rations_fnc_addStatusModifier

* Adds a status modifier. Should be called on all machines.
* Code must return a NUMBER which will be applied additively with other status changes.
*
* Arguments:
* 0: Status to modify (0 - Thirst, 1 - Hunger, 2 - Both) <NUMBER>
* 1: Code (is passed the unit <OBJECT>) <CODE>
*
* Return Value:
* None
*
* Example:
* [0, {random 1}] call ace_field_rations_fnc_addStatusModifier