vaporvee / discord-rpc-godot

Discord RPC Plugin for GDScript with an easy-to-use code pattern in Godot Engine 4, with optional Editor Rich Presence! (Compatible with Linux, Windows, & MacOS)
https://docs.vaporvee.com/discord-rpc-godot
MIT License
198 stars 10 forks source link

[Bug/Crash]: Editor Presence setting cannot be enabled #40

Closed amuck-gorilla closed 11 months ago

amuck-gorilla commented 1 year ago

What happened?

When I turn on the Editor Presence setting and click on the "Save and Restart" button, the editor closes, does not start back up, and when I start it back up manually and open Project Settings, the setting has turned itself back off.

I expected the editor to start back up with Editor Presence enabled.

I tried reinstalling the addon and got a bunch of Parse Errors. The first time I tried to enable the setting the editor did reopen, even though the setting remained off, but after that first time it went back to failing in the same way.

Version

3.2

Godot Version

v4.1.1.stable.official

GDScript

# No files open

Godot output

Godot Engine v4.1.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
  modules/gltf/register_types.cpp:73 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started ---
Add Autoload

# When restarted after plugin was enabled again after re-installing

Godot Engine v4.1.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
  modules/gltf/register_types.cpp:73 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started ---
  gdscript://-9223370559637626267.gd:4 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:7 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:49 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:52 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:55 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:58 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:62 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:64 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370559637626267.gd:67 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  Script does not inherit from Node: res://addons/discord-sdk-gd/nodes/core_updater.gd.
  editor/editor_autoload_settings.cpp:551 - Condition "!info->node" is true. Continuing.
Add Autoload

Additional information

No response

Checks

amuck-gorilla commented 1 year ago

I hope you can fix this. Editor Presence seemed like a really great feature.

vaporvee commented 1 year ago

Please give me the current OS you are on. Did you enable the plugin and restart and saw the popup? a restart dialog with the plugin logo should appear

vaporvee commented 1 year ago

what happens is that the gdextension didn't load. but that should give you more error messages then just not declared

amuck-gorilla commented 1 year ago

I am on Microsoft Windows 11 Home, version 10.0.22631 Build 22631

  1. I installed the plugin
  2. I enabled it
  3. I saw the popup (It had text covering the buttons to "Restart" and "Save and Restart", preventing me from clicking them, but when I closed the window Godot restarted just fine)
  4. Godot restarted
  5. I went to settings
  6. I enabled the Editor Rich Presence setting
  7. The "Save and Restart" button wouldn't work, so I closed Godot manually and reopened the project.
vaporvee commented 1 year ago

huh thats really weird... could you make a project how you would set it up with the plugin and send it to me? I'll take a look myself

amuck-gorilla commented 1 year ago

The error happened while I was trying to set the extension up for this project: amuck-gorilla/Game-Off-arena-prototype

RemoteCodeExecution commented 12 months ago

Having the same issue on Windows 10 19045.3693. Godot 4.1.3

  1. Installed the plugin (tried from the AssetStore and manual install)
  2. Enabled the plugin, got a pop up prompting me to restart or save & restart in order to fully enable this plugin
  3. Restarted then went to settings and enabled editor rich presence
  4. Save and restart button did work
  5. Godot restarted
  6. Went to settings but editor rich presence is still set to OFF
  7. Enabled it again and restarted
  8. This time Godot does not restart by itself

I tried on a brand new project and the results are the same.

If I try to enable Editor presence again after that, this error pop-up in the output tab right after I enable it :

res://addons/discord-sdk-gd/nodes/core_updater.gd:17 - Invalid get index 'scene_file_path' (on base: 'null instance').

amuck-gorilla commented 12 months ago

Having the same issue on Windows 10 19045.3693. Godot 4.1.3

Your description seems to describe the same problem as mine.

If I try to enable Editor presence again after that, this error pop-up in the output tab right after I enable it :

res://addons/discord-sdk-gd/nodes/core_updater.gd:17 - Invalid get index 'scene_file_path' (on base: 'null instance').

I'm pretty sure I never got that error though.

vaporvee commented 12 months ago

will help you as soon as possible sorry

vaporvee commented 12 months ago

The error happened while I was trying to set the extension up for this project: amuck-gorilla/Game-Off-arena-prototype

theres no branch with my plugin

yusdacra commented 12 months ago

I am also experiencing a crash after turning on editor presence and clicking on "save and restart", on NixOS. Here is the backtrace of the crash:

handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.3.stable.nixpkgs (fc79201851a16215f9554884aa242ed957801b10)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib64/libc.so.6(+0x3da70) [0x7f02486d7a70] (??:0)
[2] godot::Object::emit_signal_internal(godot::Variant const**, long) (??:0)
[3] <proj>/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk_binding_debug.so(+0x208e69) [0x7f023eddfe69] (??:0)
[4] discord::RelationshipEvents::OnRefresh(void*) (??:0)
[5] <proj>/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk.so(+0x11215a) [0x7f023e71215a] (??:0)
[6] <proj>/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk.so(+0x1156c6) [0x7f023e7156c6] (??:0)
[7] <proj>/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk.so(+0x86c65) [0x7f023e686c65] (??:0)
[8] <proj>/addons/discord-sdk-gd/bin/linux/libdiscord_game_sdk.so(+0x68f7b) [0x7f023e668f7b] (??:0)
[9] discord::Core::~Core() (??:0)
[10] discord_sdk::~discord_sdk() (??:0)
[11] discord_sdk::free(void*, void*) (??:0)
[12] /nix/store/6cbq0ki1y473g8kxg0xvkw0jdxqwizsl-godot-4.1.3-stable/bin/godot4() [0x46b3d99] (??:0)
[13] /nix/store/6cbq0ki1y473g8kxg0xvkw0jdxqwizsl-godot-4.1.3-stable/bin/godot4() [0xed767f] (??:0)
[14] godot::GDExtensionBinding::deinitialize_level(void*, GDExtensionInitializationLevel) (??:0)
[15] /nix/store/6cbq0ki1y473g8kxg0xvkw0jdxqwizsl-godot-4.1.3-stable/bin/godot4() [0x465603c] (??:0)
[16] /nix/store/6cbq0ki1y473g8kxg0xvkw0jdxqwizsl-godot-4.1.3-stable/bin/godot4() [0xe8285c] (??:0)
[17] /lib64/libc.so.6(+0x27fce) [0x7f02486c1fce] (??:0)
[18] /lib64/libc.so.6(__libc_start_main+0x89) [0x7f02486c2089] (??:0)
[19] /nix/store/6cbq0ki1y473g8kxg0xvkw0jdxqwizsl-godot-4.1.3-stable/bin/godot4() [0xe8f295] (??:0)
-- END OF BACKTRACE --

(replaced project path as <proj> for privacy reasons)

Note, i tried with both the Steam version of Godot and NixOS native, both have the same problem. I am not necessarily sure if this is a NixOS specific issue (libraries do have quirks sometimes on here specifically) but upon seeing this issue i thought i'd report it anyway.

vaporvee commented 11 months ago

@yusdacra

has nothing todo with this issue please make a new one

vaporvee commented 11 months ago

Having the same issue on Windows 10 19045.3693. Godot 4.1.3

1. Installed the plugin (tried from the AssetStore and manual install)

2. Enabled the plugin, got a pop up prompting me to restart or save & restart in order to fully enable this plugin

3. Restarted then went to settings and enabled editor rich presence

4. Save and restart button did work

5. Godot restarted

6. Went to settings but editor rich presence is still set to OFF

7. Enabled it again and restarted

8. This time Godot does not restart by itself

I tried on a brand new project and the results are the same.

If I try to enable Editor presence again after that, this error pop-up in the output tab right after I enable it :

res://addons/discord-sdk-gd/nodes/core_updater.gd:17 - Invalid get index 'scene_file_path' (on base: 'null instance').

could you then maybe send me a fresh project zipped how you wpuld setup the plugin?

RemoteCodeExecution commented 11 months ago

Having the same issue on Windows 10 19045.3693. Godot 4.1.3

1. Installed the plugin (tried from the AssetStore and manual install)

2. Enabled the plugin, got a pop up prompting me to restart or save & restart in order to fully enable this plugin

3. Restarted then went to settings and enabled editor rich presence

4. Save and restart button did work

5. Godot restarted

6. Went to settings but editor rich presence is still set to OFF

7. Enabled it again and restarted

8. This time Godot does not restart by itself

I tried on a brand new project and the results are the same. If I try to enable Editor presence again after that, this error pop-up in the output tab right after I enable it : res://addons/discord-sdk-gd/nodes/core_updater.gd:17 - Invalid get index 'scene_file_path' (on base: 'null instance').

could you then maybe send me a fresh project zipped how you wpuld setup the plugin?

Sure.

Here is a zip file containing a fresh project with your add-on installed and enabled. https://github.com/RemoteCodeExecution/Fresh_Project_Godot

The plugin indeed seem to load as I was able to add my own application to Discord following your "Quick Start" guide, and upon running the project it indeed show up on my Discord profile.

The issue seem to be only with the EditorPresence feature. No matter what I do, it just won't stay enabled upon restarting Godot, and no editor presence will show up on my Discord profile.

vaporvee commented 11 months ago

did you got parse errors?

RemoteCodeExecution commented 11 months ago

did you got parse errors?

This errors pop-up after installing the plugin : install

This ones pop-up as soon as I enable the plugin : plugin_enabled

And this errors after restarting as asked by the plugin pop-up : plugin_after_restart

I get no error after that if I try to enable Editor Presence, but upon restarting it's disabled.

If I then try to enable it again, Godot won't restart by itself when using the save and restart option after enabling Editor Presence. Have to manually restart it and Editor Presence is still set to off.

vaporvee commented 11 months ago

the first 2 errors are normal thats why restarting is required but the third one i investigate when I'm home. but i will do an update soon where i will redo stuff i made in gdscript with gdextension/cpp that will hopefully run more reliable. Also i will make seperate nodes loaded in background instead of this weird single gdscript autoload.

vaporvee commented 11 months ago

okay you don't need to restart godot and a crash that was undiscovered happens actually everytime on close. until the next update do not press the save and restart button, save the project and editorpresence should just work

yunylz commented 11 months ago

ur saying "click" restart when you cant even do that

Screenshot 2023-12-14 00 02 47
yunylz commented 11 months ago
Godot Engine v4.2.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
  modules/gltf/register_types.cpp:63 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started on port 6008 ---
  Cannot get class 'GitPlugin'.
  Received a nullptr VCS extension instance during construction.
  gdscript://-9223370518231456116.gd:4 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:7 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:39 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:49 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:52 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:55 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:58 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:62 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:64 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  gdscript://-9223370518231456116.gd:67 - Parse Error: Identifier "discord_sdk" not declared in the current scope.
  Script does not inherit from Node: res://addons/discord-sdk-gd/nodes/core_updater.gd.
  editor/editor_autoload_settings.cpp:551 - Condition "!info->node" is true. Continuing.
Add Autoload
  Can't open dynamic library: /Users/batin/Desktop/DanceHits/Game/addons/discord-sdk-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib. Error: dlopen(/Users/batin/Desktop/DanceHits/Game/addons/discord-sdk-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib, 0x0002): symbol not found in flat namespace '_DiscordCreate'.
  core/extension/gdextension.cpp:719 - GDExtension dynamic library not found: /Users/batin/Desktop/DanceHits/Game/addons/discord-sdk-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib
  Failed loading resource: res://addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
  Can't open dynamic library: /Users/batin/Desktop/DanceHits/Game/addons/discord-sdk-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib. Error: dlopen(/Users/batin/Desktop/DanceHits/Game/addons/discord-sdk-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib, 0x0002): symbol not found in flat namespace '_DiscordCreate'.
  core/extension/gdextension.cpp:719 - GDExtension dynamic library not found: /Users/batin/Desktop/DanceHits/Game/addons/discord-sdk-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib
  Failed loading resource: res://addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
vaporvee commented 11 months ago

make your own issue