Resource icon

Addon SKNoise | The Addon to Generation 1.0

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

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:

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

Code:
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}%"
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:

Code:
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 :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:
Code:
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}
I lowkey forgot to update the resource here, this is a quick summary of what was changed.

(0.1.1)
Average
The expression was made more efficient

Noise Noise expressions were given a syntax to allow locations ((perlin|simplex) noise at %location%)

(0.1.2 - 0.1.4)

Seed Seed expression was originally set to return a list, this changed that
Noise These expressions were given parameters for octaves, frequency, and amplitude! Also fixed an issue with the original syntax

(0.1.5) IMPORTANT UPDATE
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.
Perlin Syntax
Code:
[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%)]

SimplexSyntax

Code:
[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%)]

(0.1.6)
Noise
The expressions were given the Normalized parameter at the beginning of the syntax

[normalized] (simplex|perlin) noise