Particle Properties

From The Powder Toy
Revision as of 00:18, 14 July 2016 by cxi (talk | contribs) (Create)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Particle properties are the properties that every individual particle has which can change during simulation, for example temperature and ctype. Some of these properties are saved in saves or stamps and others are not.

ID

The particle ID is a unique number assigned to each particle. The ID is visible in the HUD in debug mode and used mainly in the simulation code.

type

This is the type of the particle, indicating what element it is.

ctype

This is a secondary type which is used by particles like CLNE/BCLN/PCLN/PBCN and CRAY which create other elements. It is usually set to an element type and in some cases is used to store a number.

temp

This stores the particle's temperature. When setting temp from the console or PROP tool, it accepts temperature in degrees Kelvin, instead of the Celsius scale which is used for displaying temperature in the HUD.

life

This is used by some particles as a timer, either to make the particle disappear after a certain time or to time a reaction.

tmp

This is used by some particles for storing a number, or in the case of PIPE, an element type.

tmp2

This is like a second tmp and is mainly used for graphics purposes.

flags

This is a property that is only used with a few different elements. It is not saved. There are currently 4 different flags:

0x1: "Stagnant" - Used by energy particles and water when a particle can't move, to reduce lag by not performing as many checks next frame. 0x2: Skip movement for one frame, only works on PHOT (used when created by powered clones) 0x4: Used for water equalization, to keep track of which particles have been checked 0x8: Compatibility flag, which allows sponge to move, or photons to be decorated. (for compatibility with older saves)

pavg

This property is unlike the others in that it is an array storing two values, pavg[0] and pavg[1]. It is used to control TUNG, QRTZ, and GLAS breaking, and to store properties of elements that have been infected by VIRS or are inside PIPE or STOR.