**SKNoise** by ReportCards

The Addon That Includes Noise! (No, not sound.)

**Events**

**0**

**Expressions**

**5**

**Effects**

**0**

**Conditions**

**0**

**Types**

**0**

**Sections**

**0**

**Structures**

**0**

**Total**

**5**

The Addon That Includes Noise! (No, not sound.)

**Events**

**0**

**Expressions**

**5**

**Effects**

**0**

**Conditions**

**0**

**Types**

**0**

**Sections**

**0**

**Structures**

**0**

**Total**

**5**

**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

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 so that each value obtained from a different location, is completely different

set {_val} to abs(value of {_g} at player)

send "Random Number: %{_val}%"

trigger:

set {_g} to new value generator with seed 1

set frequency of {_g} to 1 # Setting to 1 makes it so that each value obtained from a different location, 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}%"

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 :emoji_wink:

This update fixes voronoi noise bugs from 0.1.8

**NEW EXPRESSION**

- **Voronoi**:

**Syntax**:

__[sknoise] voronoi [noise] at [x] %number%[,] [[y] %-number%[(,|[,] and) [z] %-number%]] [with cell values]__

__[sknoise] voronoi [noise] at (loc|location) %location% [with cell values]__

**Description**:

Get's the voronoi noise at a location, voronoi noise in simple words is a plot of distance between points. (Wiki)

**Big Example**:

command /set:

trigger:

set {_l} to location of player

set {_ogL} to location of player

loop 100 times:

loop 100 times:

set {_value} to voronoi noise at ((x-coord of {_l}) / 2), (z-coord of {_l} / 2)

if {_value} >= 0.5:

set block at {_l} to white concrete

else:

set block at {_l} to black concrete

add 1 to x-coord of {_l}

add 1 to z-coord of {_l}

set x-coord of {_l} to x-coord of {_ogL}

trigger:

set {_l} to location of player

set {_ogL} to location of player

loop 100 times:

loop 100 times:

set {_value} to voronoi noise at ((x-coord of {_l}) / 2), (z-coord of {_l} / 2)

if {_value} >= 0.5:

set block at {_l} to white concrete

else:

set block at {_l} to black concrete

add 1 to x-coord of {_l}

add 1 to z-coord of {_l}

set x-coord of {_l} to x-coord of {_ogL}

*I lowkey forgot to update the resource here, this is a quick summary of what was changed.*

This is update reduced the file size by a ton, by removing skript from being bundled with the build, it reduced the file size from ~2.7mb to ~42kb

This update also changed the syntax by a lot for noise expressions.

[sknoise] perlin [noise] at [x] %number%[,] [[y] %-number%[(,|[,] and) [z] %-number%]] [(1¦with octaves %-integer%[,] frequency %-number%(,|[,] and) amplitude %-number%)]

[sknoise] perlin [noise] at [(loc|location)] %location% [(1¦with octaves %-integer%[,] frequency %-number%(,|[,] and) amplitude %-number%)]

[sknoise] perlin [noise] at [(loc|location)] %location% [(1¦with octaves %-integer%[,] frequency %-number%(,|[,] and) amplitude %-number%)]

[sknoise] simplex [noise] at [x] %number%[,] [[y] %-number%[(,|[,] and) [z] %-number%]] [(1¦with octaves %-integer%[,] frequency %-number%(,|[,] and) amplitude %-number%)]

[sknoise] simplex [noise] at [(loc|location)] %location% [(1¦with octaves %-integer%[,] frequency %-number%(,|[,] and) amplitude %-number%)]

[sknoise] simplex [noise] at [(loc|location)] %location% [(1¦with octaves %-integer%[,] frequency %-number%(,|[,] and) amplitude %-number%)]

Noise

The Addon That Includes Noise! (No, not sound)

The addon is still in a heavily early build and will have more to it soon. I am still somewhat new to Java so the code may not be the best, but within test runs I can generate 1 million perlin values in 0.6 seconds (With nothing but setting a local variable to the value.)

This addon allows you to create noise generators, and edit them with a lot of different values!

You can view more information about the expressions on the GitHub release. https://github.com/ReportCardsMC/SKNoise/releases/tag/1.0

(We also have SkriptHub documentation, working on SKUnity documentation as well)

skUnity uses cookies to enhance your browsing experience. By continuing to use skUnity, you agree to the placement of cookies on your device.