Update 1.0
This update is a complete recode of skNoise, bringing in a new way to handle generators, more ways to edit a generator and its values
Generators are now actually an object compared to constructing the entire generator through one line.
You can save a generator to a variable now as well!
Here's a quick example of creating a new generator, editing some values, and using it:
command /noise:
trigger:
set {_gen} to new simplex generator with seed 42069
set frequency of {_gen} to 0.01 # Essentially a zoom value
set {_value} to abs(value of {_gen} at player)
if {_value} < 0.5:
set block at player to black concrete
else:
set block at player to white concrete
Alongside this new format for generators, there's also a new type of generator,
which is the Value
generator.
This generator allows you to essentially create a seeded random number generator, for example:
command /random:
trigger:
set {_g} to new value generator with seed 1
set frequency of {_g} to 1 # Setting to 1 makes it that each value obtained from different locations is completely different
set {_val} to abs(value of {_g} at player)
send "Random Number: %{_val}%"
You can also do a lot more to Cellular (Voronoi) generators, such as setting its jitter (how the points are spread), return type, and changing the distance function used.
Here's a quick example of how you'd get the cell values now:
command /cellvalue:
trigger:
set {_g} to new voronoi generator with seed 1
set voronoi return type of {_g} to CellValue
set {_val} to abs(value of {_g} at player)
send "Cell Value: %{_val}%"
And yes, the average expression still exists ;)