derkork / godot-statecharts

A state charts extension for Godot 4
MIT License
679 stars 33 forks source link

Cannot add StateChart node to tree #112

Closed Jillybread closed 2 months ago

Jillybread commented 2 months ago

After State Chart is installed, the following errors show in the console:

  res://addons/godot_state_charts/state_chart.gd:86 - Parse Error: Function "is_node_ready()" not found in base self.
  res://addons/godot_state_charts/state_chart.gd:102 - Parse Error: Function "is_node_ready()" not found in base self.
  res://addons/godot_state_charts/state_chart.gd:182 - Parse Error: Function "is_node_ready()" not found in base self.

Adding a state chart to the tree results in the following errors and no change to the tree:

  Cannot get class ''.
  editor/editor_data.cpp:529 - Parameter "p_object" is null.
  editor/scene_tree_dock.cpp:2198 - Condition "!child" is true.
derkork commented 2 months ago

Which version of Godot are you using? The error message would indicate that you try to run this on Godot 3, which this library does not support. If you run this on Godot 4, please make sure you enabled the plugin in the project settings and also please restart the editor one time after you installed and enabled the plugin.

Jillybread commented 2 months ago

I'm using v4.0 stable. The plugin is enabled in project settings. I tried restarting Godot after installing with the same results. I was able to get it working by removing the 3 code blocks throwing errors in state_chart.gd.

derkork commented 2 months ago

Hmm, can't reproduce this. I use 4.0.3 stable. It could be that very early 4.0 versions did not have the is_node_ready method. Commenting out the lines should fix this they are not needed for the plugin to function. I have added a section to the manual specifying the minimum Godot version as 4.0.3 as that is what I developed with.