Pikifen/Object categories/Onion

Onions are where Pikmin deliver corpses and pellets, they generate seeds, and they store Pikmin.

Examples of Onion types include the Red Onion, the Yellow Onion, and the Blue Onion.

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

Overview
An Onion type object can organize the Pikmin of one Pikmin type. Onion objects serve as a destination for carried corpses and pellets, and will accept the corpse or pellet when it is delivered. Shortly afterwards, the Onion generates some Pikmin sprouts by shooting seeds in the air, or, if the limit of Pikmin has been reached, stores them inside the Onion. Currently, there is almost no logic in the engine related to stowing or retrieving Pikmin from and to the Onion; the player can use the throw or whistle buttons to do that at a very rudimentary level.

Onion type objects are hardcoded in the engine to idle, receive delivered objects, convert them to Pikmin or sprouts, hold the number of Pikmin stowed, per maturity, and very basically allow the player to retrieve or stow a Pikmin at a time.

Attributes
Besides the global object type attributes, an Onion type has the following attributes.

Mandatory

 *  : Name of the type of Pikmin this Onion belongs to.

Recommended
None.

Optional
None.

Animations
An Onion type needs to have the following animations:


 *  : Idling; used for everything.

Script
An Onion type's script cannot be changed.

Object spawn script variables
When an Onion type object is spawned, it will read the following script variables, if they're present:


 *  : How many Pikmin, per maturity, are inside. For instance,  means this Onion has 8 leaf Pikmin inside, and 1 flower Pikmin.

Besides that, there are the global spawn script variables.