Components

MATImprovised Fishing Rod


Script Details

Condition

_owner getVariable ['isUsingSomething',0] == 0 && ((count (itemsInInventory _material1)) == 0)

Action

_rm = _material1 getVariable ['ropemat',-1];
if(_rm == -1)then{_rp0=['Crafting_Rope',_owner] call player_addInventory;
_rp0 setDamage (damage _material1);
};
	if(_rm == -2)then{_rp1=['Crafting_ImprovisedRope',_owner] call player_addInventory;
_rp1 setDamage (damage _material1);
};
if(_rm > 0)then{_rp2=['Food_Guts',_owner] call player_addInventory;
_rp2 setDamage (damage _material1);
_rp2 setQuantity _rm;
};
[_owner,format['I have broke the Rod into materials.',displayName _result1],'colorAction'] call fnc_playerMessage;
_result1 setDamage (damage _material1);

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!