Attention | Topic was automatically imported from the old Question2Answer platform. | |
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.
What does the rest of your code look like?
Because that code works for me
Christoffer | 2018-11-20 10:49