Shape Particle Density / Particle Count (Expression) — skript-particle

Addon: skript-particle · Category: Expression · Since: 1.0.0

Syntax

[the] particle (density|count) of %shapes%

Description

The density at which particles are spawned in a shape. This is in "particles per meter" (ppm), and defaults to 4.Be careful with this property, as it can cause lag if set to a high number. It's recommended to not go above 20 or so for this reason. 1000 ppm is the maximum value. Keep in mind that this value scales with dimensions. A 1 meter line with a density of 20 will spawn 20 particles, but a 1 meter cube with a density of 20 will spawn 8,000 particles (2,400 if hollow). Also, be aware that this may not be exact. Some shapes, like cuboids, will tweak the density a bit to ensure particles land exactly on the borders of the shape.

This syntax also supports setting the particle count directly, which is the amount of particles spawned in a shape. Note that this is NOT exact. The actual amount of particles spawned will be the closest multiple of the particle count to the amount of particles needed to draw the shape. For example, if the particle count of a solid cube is set to 100, the actual amount of particles spawned will be 125, which is the nearest cubic number. The returned value of this expression will always be the accurate amount of particles spawned in a shape.

Changing this will change the particle density or count of the shape. Resetting or deleting it will set it back to the default density (4).

Examples

set {_shape}'s particle density to 10
set {_shape}'s particle count to 100
reset {_shape}'s particle density
reset {_shape}'s particle count

View source