Zylann / godot_heightmap_plugin

HeightMap terrain for Godot implemented in GDScript
Other
1.72k stars 159 forks source link

Procgen terrain - script debugged but not working #409

Open ShockBock opened 10 months ago

ShockBock commented 10 months ago

Hi there, I would like to get HTerrain to generate a terrain at the point at which the game is loaded, i.e. (for now) when I press F5 to go into the debugger. I have copy-pasted the code at https://hterrain-plugin.readthedocs.io/en/latest/#procedural-generation into a script for the root Node3D, shown below:

HTerrain play

Side note, I changed:

splat = splat.linear_interpolate(Color(0,1,0,0), sand_amount)
splat = splat.linear_interpolate(Color(0,0,1,0), leaves_amount)

to:

splat = splat.lerp(Color(0,1,0,0), sand_amount)
splat = splat.lerp(Color(0,0,1,0), leaves_amount)

...to deal with an error message. I guess this is the result of the transition of Godot 3.x to 4.x?

Anyway, I provided filepaths to textures in the project folder and that dealt with any outstanding issues. However, when F5-ing into the debugger, I see no proc gen terrain.

I would be grateful for any help.

PS: I have no problems generating HTerrain in the editor.

ShockBock commented 10 months ago

Wait! I think I solved it. I needed to have a HTerrrain node already in the tree (duh). Okay, I'll have a play and see where I go from here