OctoD / godot-gameplay-systems

⚔️ A plugin for Godot to create your gameplay systems in a Godot way.
MIT License
509 stars 49 forks source link

🐛 [bug] plugin fail to load scripts and icons after 4.2 relocatability change #45

Closed danielbernard closed 11 months ago

danielbernard commented 11 months ago

Describe the bug Loading plugin from AssetLib fails to load on 4.2, indicating that load'ed scripts and files failed.

To Reproduce

  1. Create empty project
  2. Add GGS from AssetLib
  3. Enable plugin and relaunch editor or reload project
  4. See error:
    Attempt to open script 'res://./nodes/camera_shake.gd' resulted in error 'File not found'.
    Failed loading resource: res://./nodes/camera_shake.gd. Make sure resources have been imported by opening the project in the editor at least once.
    It's not a reference to a valid Script object.
    Attempt to open script 'res://./nodes/2d/point_and_click_2d.gd' resulted in error 'File not found'.
    Failed loading resource: res://./nodes/2d/point_and_click_2d.gd. Make sure resources have been imported by opening the project in the editor at least once.
    It's not a reference to a valid Script object.
    Attempt to open script 'res://./nodes/3d/point_and_click_3d.gd' resulted in error 'File not found'.
    Failed loading resource: res://./nodes/3d/point_and_click_3d.gd. Make sure resources have been imported by opening the project in the editor at least once.
    It's not a reference to a valid Script object.
    Attempt to open script 'res://./nodes/2d/interactable_area_2d.gd' resulted in error 'File not found'.
    Failed loading resource: res://./nodes/2d/interactable_area_2d.gd. Make sure resources have been imported by opening the project in the editor at least once.
    Resource file not found: res://./assets/InteractableArea2D.png (expected type: )
    It's not a reference to a valid Script object.
    Attempt to open script 'res://./nodes/3d/interactable_area_3d.gd' resulted in error 'File not found'.
    Failed loading resource: res://./nodes/3d/interactable_area_3d.gd. Make sure resources have been imported by opening the project in the editor at least once.
    Resource file not found: res://./assets/InteractableArea2D.png (expected type: )
    It's not a reference to a valid Script object.
    Attempt to open script 'res://./nodes/2d/interaction_raycast_2d.gd' resulted in error 'File not found'.
    Failed loading resource: res://./nodes/2d/interaction_raycast_2d.gd. Make sure resources have been imported by opening the project in the editor at least once.
    Resource file not found: res://./assets/InteractionRayCast2DIcon.png (expected type: )
    It's not a reference to a valid Script object.
    Attempt to open script 'res://./nodes/3d/interaction_raycast_3d.gd' resulted in error 'File not found'.
    Failed loading resource: res://./nodes/3d/interaction_raycast_3d.gd. Make sure resources have been imported by opening the project in the editor at least once.
    Resource file not found: res://./assets/InteractionRayCast3DIcon.png (expected type: )
    It's not a reference to a valid Script object.
    Attempt to open script 'res://./nodes/interaction_manager.gd' resulted in error 'File not found'.
    Failed loading resource: res://./nodes/interaction_manager.gd. Make sure resources have been imported by opening the project in the editor at least once.
    Resource file not found: res://./assets/InteractionIcon.png (expected type: )
    It's not a reference to a valid Script object.
    Attempt to open script 'res://./resources/interaction.gd' resulted in error 'File not found'.
    Failed loading resource: res://./resources/interaction.gd. Make sure resources have been imported by opening the project in the editor at least once.
    Resource file not found: res://./assets/InteractionIcon.png (expected type: )
    It's not a reference to a valid Script object.

Expected behavior Plugin should load normally without error.

Desktop (please complete the following information):

Reproducible project Happens even on a clone of this repository

Proposed fix I was able to remedy this by adjusting the load calls in the _enter_tree() functions within the plugin.gd files. Addressed in subsequent pull request.

OctoD commented 11 months ago

closed by #46