Script Details

Condition

_owner getVariable ['isUsingSomething',0] == 0

Action

if(((count(itemsInInventory _tool1)) > 0) or ((count itemsInCargo _tool2) > 0))then{[_owner,'I need to empty it first.','colorAction'] call fnc_playerMessage;
}else{_dt1 = damage _tool1;
_dt2 = damage _tool2;
if((_dt1 == 1) OR (_dt2 == 1))then{[_owner,'It is too damaged to be attached.','colorAction'] call fnc_playerMessage;
}else{deleteVehicle _tool1;
deleteVehicle _tool2;
_vest=['PlateCarrierComplete',_owner] call player_addInventory;
if(_dt1 > _dt2)then{_vest setDamage _dt1;
}else{_vest setDamage _dt2;
};
};
};

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!