deadlykam / Duniya_Skapare

A godot tool that creates a grid world using algorithms.
MIT License
8 stars 2 forks source link

Addon not working in 4.2.2.stable.mono #43

Open wielandb opened 3 months ago

wielandb commented 3 months ago

I tried loading the tutorial but I get the follwoing errors in Godot:

res://addons/kamran_wali/duniya_skapare/scripts/stage_generators/wave_function_collapse/ds_wfc_gen.gd:193 - Parse Error: The function signature doesn't match the parent. Parent signature is "get_data() -> Variant".
  res://addons/kamran_wali/duniya_skapare/scripts/stage_generators/wave_function_collapse/ds_wfc_gen.gd:194 - Parse Error: The function signature doesn't match the parent. Parent signature is "get_tile_names() -> Variant".
  res://addons/kamran_wali/duniya_skapare/scripts/stage_generators/wave_function_collapse/ds_wfc_gen_thread.gd:-1 - Compile Error: 
  modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/kamran_wali/duniya_skapare/scripts/stage_generators/wave_function_collapse/ds_wfc_gen_thread.gd" with error "Compilation failed". (User)

The addon after that refuses to work. (The Editor interface will not react to any button press)

Tested on 4.2.2.stable.mono on Windows

deadlykam commented 2 months ago

Thanks for reporting this. Yes, faced this issue in Godot 4.3 as well but did not know it existed in 4.2 as well. I gave an explanation on to why this was the case when I fixed the issue for Godot 4.3 plugin Stable-v1.0.1.

But unfortunately the plugin Stable-v1.0.1 won't work in Godot 4.2 because in Godot 4.3 the meshes are imported differently and causes issues in 4.2 when importing them. At least that's what happened to me.

The best way to fix this issue in 4.2 is to use the Stable-v1.0.0 and then just update the script _ds_wfcgen.gd which can be found in _res:// -> addons -> kamran_wali -> duniya_skapare -> scripts -> stage_generators -> wave_function_collapse -> ds_wfcgen.gd

Open the script and then change the lines 193 and 194 to the code bellow:

line 193: func get_data(): return _data line 194: func get_tile_names(): return _data.get_tile_names()

This should fix the issue for the error and once you restart Godot and try to open up any example scenes, Godot then will instruct you how to re-import the models which is simple using a Godot tool found in Project -> Tools -> Upgrade Mesh Surfaces

Hope this helps. :)