godot
godot copied to clipboard
tried to assign unset node without an identifier
Godot version
4.0.alpha10
System information
Windows10, GPU: AMD R7 200 SERIES(250)
Issue description
only error: modules/gdscript/gdscript_analyzer.cpp:656 - Parser bug (please report): tried to assign unset node without an identifier.
Steps to reproduce
extends StaticBody3D
var file = ConfigFile.new()
@export var NOISE : FastNoiseLite
@export var SIZE : Vector2i = Vector2i(10, 10)
@export var HEIGHT_M : float = 5.0
@export var material : StandardMaterial3D
var st := SurfaceTool.new()
var mdt := MeshDataTool.new()
var arr := ArrayMesh.new()
var plane_mesh := PlaneMesh.new()
var COORD := {}
var COORD_NEW := {}
var INDEXS := {}
var INDEXS_NEW := {}
func _ready() -> void:
plane_mesh.size = Vector2(SIZE)
plane_mesh.subdivide_depth = SIZE.y - 1
plane_mesh.subdivide_width = SIZE.x - 1
st.create_from( plane_mesh, 0 )
var plane = st.commit()
mdt.create_from_surface( plane, 0 )
for index in mdt.get_vertex_count():
var vertex = mdt.get_vertex( index )
vertex.y = NOISE.get_noise_3d( vertex.x, vertex.y, vertex.z ) * HEIGHT_M
vertex = Vector3( Vector3i(vertex) )
COORD[str(vertex)] = index
INDEXS[str(index)] = vertex
for index in INDEXS.size():
var vertex = INDEXS[str(index)]
if index != 0:
var vertex_last = INDEXS[str(index - 1)]
var dv = vertex.direction_to(vertex_last) * 10
var ds = INDEXS[str(index)].distance_to(INDEXS_NEW[str(index - 1)])
dv = dv.floor()
var ds_10 = floor(ds * 10)
print(ds)
if dv.x == 7 and dv.y == 7 and dv.z == 0:
vertex.x += 1
if ds_10 == 14:
vertex.y += 0.41421353816986
mdt.set_vertex( index, vertex )
COORD_NEW[str(vertex)] = index
INDEXS_NEW[str(index)] = vertex
arr.clear_surfaces()
mdt.commit_to_surface( arr )
arr.surface_set_material( 0, material )
var mesh_inst = MeshInstance3D.new()
mesh_inst.mesh = arr
add_child( mesh_inst )
# save
file_add_coord()
save_file()
func _physics_process(_delta: float) -> void:
if Input.is_action_just_pressed("switch_mode_visible"):
material.use_point_size = true if !material.use_point_size else false
# for save game information.
func file_add_coord() -> void:
for index in INDEXS.size():
file.set_value( "coordinates", str(index) + " - old", INDEXS[str(index)] )
file.set_value( "coordinates", str(index) + " - new", INDEXS_NEW[str(index)] )
func file_add_value(section: String, key: String, value: Variant = null) -> void:
#if key is empty, then will use index.
for index in INDEXS.size():
if key == "":
file.set_value( section, index, INDEXS[str(index)] )
else:
file.set_value( section, key, INDEXS[str(index)] )
func save_file() -> void:
file.save( "res://InfoVerticesWorld.cfg" )
Minimal reproduction project
Code is writed already
Related to https://github.com/godotengine/godot/issues/62006.
Did you upgrade your project from a previous 4.0 alpha?
I'm also starting to see these errors in alpha10, though I didn't right after upgrading from 9.
This code, which only was written in alpha10, will print the error 3-4 times in my project.
extends ControlState
func enter(message := {}) -> void:
super.enter(message)
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func exit() -> void:
super.exit()
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
If there's a way to get more helpful error messages, I'm happy to investigate further.
I found an easier way to reproduce the same error code in Godot alpha 10 on Win 11 64bits.
- Create a node and attached a GDScript
- Add the code below @onready var _state_machine := _get_state_machine(self) func _get_state_machine( node: Node ) -> Node: return node
- Save, assign the main tscn and run
- The error message shows as below: --- Debugging process started --- modules/gdscript/gdscript_analyzer.cpp:656 - Parser bug (please report): tried to assign unset node without an identifier
The sample project is attached: GetNodeError.zip
To see the same error code in Godot 4.0 alpha 12, change the code in step 2 to:
@onready var _state_machine : Node = _get_state_machine(self)
Still reproducible v4.0.alpha.custom_build [b3bd08207]
extends Node
var test := _get_value()
func _get_value() -> int:
return 5
extends Node var test := _get_value() func _get_value() -> int: return 5
See #58542 and #63438.
I also get Parser bug (please report): tried to assign unset node without an identifier. when I do the following in 4.0 alpha 10 or later (earlier versions not tested):
- Create a new script in any project.
- Paste in the following code.
- Type a
.at the end.
extends Node
var test_arr = [
{"a": "1"}
]
var test_val = test_arr[0]
Seeing this as early as alpha14 WHILE writing the script in question. Once I'm done writing, the error goes away. Still happens in beta 1 (it did when I was upgrading to account for the API changes)
For me, godot crashes slightly after this. Not sure if its related?
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.beta4.official (e6751549cf7247965d1744b8c464f5e901006f21)
[1] /usr/lib/libc.so.6(+0x38a00) [0x7f1d63908a00] (??:0)
[2] godot4() [0x1122d36] (??:0)
[3] godot4() [0x11e5d50] (??:0)
[4] godot4() [0x11e852c] (??:0)
[5] godot4() [0x10f1f6d] (??:0)
[6] godot4() [0x45cf3b0] (??:0)
[7] godot4() [0x107dc18] (??:0)
[8] godot4() [0x103f78b] (??:0)
[9] godot4() [0x424c5e8] (??:0)
[10] godot4() [0x426eb5f] (??:0)
[11] godot4() [0x14442e0] (??:0)
[12] godot4() [0x1444c5a] (??:0)
[13] godot4() [0x105aa25] (??:0)
[14] godot4() [0x106019b] (??:0)
[15] godot4() [0x4245ea4] (??:0)
[16] godot4() [0x29209ce] (??:0)
[17] godot4() [0x2965f4e] (??:0)
[18] godot4() [0xe5da65] (??:0)
[19] godot4() [0xd96fa3] (??:0)
[20] /usr/lib/libc.so.6(+0x23290) [0x7f1d638f3290] (??:0)
[21] /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7f1d638f334a] (??:0)
[22] godot4() [0xdb87de] (??:0)
Ill see if i can get my hands on a debug build.
I tried to reproduce numerous examples here, but couldn't reproduce on master (fcba87e). I suggest to close this issue.