Pikifen/Object categories/Pile

Piles are objects that contain several resources in them, that can be harvested by the Pikmin.

Examples of pile types include piles of bridge fragments, or Burgeoning Spiderworts, which have a bundle of berries.

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

Overview
Pile objects just sit there, and can be attacked by the Pikmin. Once they suffer enough damage, they give the Pikmin one of their resources. They can recharge with time, and change their look as the number of resources they have left changes.

Pile type objects are hardcoded in the engine to sit there and have their health depleted, give out resources when they suffer enough damage, show how many resources they have, changed their look based on how many resources they have, and optionally disappear when they're empty.

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

Mandatory

 *  : What resource they contain. Specify the name of the resource object type here.

Recommended

 *  : The pile must suffer this much damage to give out the next resource. Defaults to 1.
 *  : At most, this pile type can only contain these many resources inside. Defaults to 1.

Optional

 *  : If true, the pile can drop multiple resources at once in a single attack, if the damage requirements are met. This is useful if you want the pile to drop resources when struck with a bomb rock, for instance. Excess resources will not be delivered to a Pikmin, but will instead be thrown to the ground next to the pile. Defaults to false.
 *  : If true, the pile object is deleted when the harvesting has been done. The harvesting won't be considered finished until the last resource it had is successfully delivered. Defaults to true.
 *  : If true, the pile object will hide and become intangible when it has no resources at the moment. Defaults to true.
 *  : If this pile can recharge, this specifies how many resources get added per recharge. Defaults to 0.
 *  : Specifies how often the pile recharge. If this is 0, the pile will not recharge. It will also not recharge if it's already at max capacity. Defaults to 0.
 *  : If true, the number of resources left in the pile will be shown above the object. Defaults to true.
 *  : If you want the pile to change animations as it changes amount, this will indicate the suffix of the animations for every given phase. This is a semicolon-separated list, and must be filled in order from empty to fullest. For example, in a pile of 10 resources max, if you want it to have an idling animation for when it's empty, and three more idling animations for the different amounts of resources it's holding, you'd set this to something like . This would mean the   animation would be used when empty,   for when it's got 5, etc. The first will always correspond to the pile being empty, while the others are divided equally. So a pile with 20 max, split into 5 animations + empty, would change animation every 4 resources. Defaults to not set.

Animations
A pile type needs to have the following animations. Note that for every phase specified in the  attribute, you need another set of these animations, and each set needs to end with the corresponding suffix.


 *  : Idling; used for everything.

Script
A pile type's script cannot be changed.

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


 *  : How many resources this starts with.

Besides that, there are the global spawn script variables.