Components

TOOLbayonetbase
MATCanned Peaches

Results

Canned Peaches


Script Details

Action

[_owner,format['I have opened the %1 but I have dropped some when I was opening it.',displayName _result1],'colorAction'] call fnc_playerMessage;
_condition = damage _material1;
_ruinedCanQuantity = 1;
 if (_condition == 1) then {_ruinedCanQuantity = 0;
};
_currentdamage=damage _tool1;
_tool1 setDamage _currentdamage+0.1+(round random 10)/100;
_newquant=(maxQuantity _result1-0.1-(round random 10)/100)*_ruinedCanQuantity;
_result1 setVariable ['quantity',_newquant];
_result1 setDamage _condition

What is this?

The condition and action scripts are bits of code used by the game to handle more complicated mechanics than can be expressed by just providing components and results.

The condition script adds restrictions on when a recipe can be crafted. If the expression in the condition evaluates to false, the recipe isn't available.
The action script allows the recipe to handle more complex inputs and outputs. For example, it's used when combining stacks of items to allow stacks of any sizes to be merged together.

No comments yet!
No screenshots yet!

Contribute

Log in or sign up to add your own comments!
Log in or sign up to add your own comments!