Pikifen/Object categories/Tool

A tool object is anything that can be picked up by a Pikmin and have the Pikmin hold it until it is needed later. Most of the time, this is when the Pikmin is thrown.

Examples of tool types include the bomb rock, which can be carried around and explodes when dropped, and the mine from Bingo Battle, which sticks to surfaces and objects and explodes when a leader draws near.

To create a new type of tool, please follow the creating object types tutorial.

Overview
Tool object types dictate what happens when the Pikmin picks them up, and what happens when they are dropped. They also specify when they can and cannot be picked up, be it by Pikmin or by enemies, and when exactly it is that they get activated. Their behavior is specified by the user-made script.

Tool type objects are hardcoded in the engine to be chased out by the Pikmin (when appropriate), picked up, released, and optionally, get stuck to an object.

Attributes
Besides the global object type attributes, a tool type has the following attributes.

Mandatory

 *  : Icon to show on the HUD standby bubble, representing Pikmin that are holding a tool of this type.

Recommended
None.

Optional

 *  : If true, the Pikmin will drop the tool when it is whistled. Defaults to false.
 *  : If true, the Pikmin will drop the tool when the Pikmin lands on the floor. Defaults to true.
 *  : If true, the Pikmin will drop the tool when the Pikmin lands on the an opponent. Defaults to false.
 *  : If true, the Pikmin will return to the current leader after it drops the tool. Defaults to true.
 *  : If true, and if the Pikmin drops when it lands on an opponent, then the tool will become stuck to the opponent object. Defaults to false.

Animations
Tool object types do not need any specific animations, only the ones that you call in the script.

Script
All of the tool type object's behavior is defined by the user-made script. It is recommended that you use the  action at some point to make it so Pikmin can hold the tool, and listen out to the   and   events, to know when the tool has been picked up, and is ready to be used.

Object spawn script variables
Besides the global spawn script variables, tool type objects do not read any specific script variables, but any script variable fed into them can be used in the script.