Pikmin Fanon will close on September 1st (see here for details and discussion).
A full-history page and file archive is available for download here (mirror).
Wayback Machine archive can be found here. Partial Wikia archive here.

Difference between revisions of "Pikifen/Object categories/Scale"

From Pikmin Fanon
Jump to: navigation, search
(Version 0.18!)
(No difference)

Revision as of 13:31, 8 February 2020

Scales are objects that can measure how much weight is on top of them, and change freely based on that amount. Numbers can appear above the object indicating how much weight is on top of it now, and optionally, how much weight is required to trigger something. Any object can weigh down a scale object.

Examples of scale types include seesaw blocks, where one block weighing more than the other causes that one to sink and the other to rise, or crushable paper bags, that block the way until enough weight is put on them to crush them.

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

Overview

A scale object can be anything and do anything, but it can also have information to show a goal weight number above it. Objects of this category should worry about checking how much weight is atop them, and change accordingly.

Other than that, scale objects are hardcoded in the engine to do whatever the script tells them.

Attributes

Besides the global object type attributes, a scale type has the following attributes.

Mandatory

None.

Recommended

None.

Optional

  • goal_number: If not zero, the numbers above the object will be a fraction with the bottom number being this "goal" amount. Defaults to 0.

Animations

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

Script

All of the scale type object's behavior is defined by the user-made script. You should be using the on_weight_added and on_weight_removed events to know when the weight atop a scale has changed, and also use the get_info action to know what the current weight is.

Object spawn script variables

Besides the global spawn script variables, scale type objects do not read any specific script variables.