Issue with using OpenSimplex in GODOT 3.1 Alpha - It doesn't register the module.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sariteed

So I followed the ‘tutorial’ for the open simplex module that used to be third-party but then included in GODOT 3.1. So, I downloaded and installed the Alpha for 3.1. I was trying to generate a matrix of simplex noise for my project. I followed the docs here on the docs site. Using the following code:

# Instantiate var noise = OpenSimplexNoise.new(); # Configure noise.seed = randi(); noise.octaves = 4; noise.period = 20.0; noise.persistence = 0.8;

From this, I get a “Parse error of unexpected token: Identifier:noise”.

Then when I thought to put it into a function like:

func _ready():
    #getNoise()
    var noise = OpenSimplexNoise.new()

    # Configure
    noise.seed = randi()
    noise.octaves = 4
    noise.period = 20.0
    noise.persistence = 0.8

    # Sample
    print("Values:")
    print(noise.get_noise_2d(1.0, 1.0))
    print(noise.get_noise_3d(0.5, 3.0, 15.0))
    print(noise.get_noise_4d(0.5, 1.9, 4.7, 0.0))
    pass

And with this I am left with the error: Parser Error: Identifier ‘OpenSimplexNoise’ is not declared in the current scope.

I thought that if it was included in the core I could reference it like that without having to import/include anything. I am a bit confused on what’s going on, am I missing something from the documentation?

Also, here is proof I am on Alpha 3.1. I did migrate this program from a previous build, but the project only includes some tiles and this program file.
Screenshot of the About page in GODOT

What does the rest of your code look like?
Because that code works for me

Christoffer | 2018-11-20 10:49

:bust_in_silhouette: Reply From: Xrayez

Have you tried

var noise = SimplexNoise.new()

It might be that you’re using an older alpha version in which SimplexNoise wasn’t yet renamed to OpenSimplexNoise.

I downloaded the most recent alpha release from the website, but I tried it out anyway since you suggested and it is the same error. Just saying that SimplexNoise is the issue instead of OpenSimplexNoise.

Sariteed | 2018-11-19 14:30

I just downloaded Godot 3.1 alpha2 from here and it features OpenSimplexNoise (I’m on Windows).

Xrayez | 2018-11-19 15:45