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)

Home Page:https://docs.vaporvee.com/discord-rpc-godot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game fails to launch after a few runs

Koanyaku opened this issue · comments

I downloaded the 1.2 version of the addon and created this simple script:

func _ready():
      if Discord_Activity.get_is_discord_working():
            print("Discord is working")
            Discord_Activity.app_id = <my id>
            Discord_Activity.large_image = "main_icon"
            Discord_Activity.start_timestamp = int(Time.get_unix_time_from_system())
            Discord_Activity.refresh()
      else:
            print("Discord is not working")

Everything worked fine, but after running the project a few times, opening the game from any scene would show a black screen and the game would crash without any error in the console or debugger. I then tested only this code:

func _ready():
      Discord_Activity.app_id = <my id>
      Discord_Activity.refresh()

But it did the same thing. Then I tried removing the code entirely, yet the same thing kept happening. I then disabled the addon, but it still kept crashing. I tried restarting the editor, but that didn't help. It wasn't until i completely removed the addon files that I could finally launch the game again with no problems.

Godot version: v4.0.2.stable.official [7a0977ce2]

commented

Yeah the gdextension doesn't get fully disabled when disabling the gdscript plugin. I really can't say what causes this. I did try another library wich didn't work out so i'm back at making 1.3 wich should fix a lot of issues. Btw setting app_id is initializing everything (also is_discord_working wich is dumb sorry). And did you try to reinstall it completely?

commented

And also linux or windows?

I'm using Windows 10 Version 22H2 (OS Build 19045.2965)

Alright, I reinstalled it, but now the game is crashing just by having the addon files installed. I tried running the game with this code:

func _ready():
        Discord_Activity.app_id = <my id>
	Discord_Activity.large_image = "main_icon"
	Discord_Activity.start_timestamp = int(Time.get_unix_time_from_system())
	Discord_Activity.refresh()

But it crashed. I tried removing the code, and crash. I then disabled the addon and reloaded the editor, and it worked fine, even with the plugin files still in there. However, enabling the addon, restarting the editor and running the game again resulted in a black screen crash.

Hmm, this is weird. I just did the same thing as before (disabled the addon and reloaded the editor), but now it is crashing again despite it working before when disabled.

commented

did you completely remove all the files?

Yes, I did.

However, I did find something. I think it has something to do with the coreupdate function in Discord_Activity being added as an Autoload script (the discord_coreupdater.gd file). When it is an autoload script, the game crashes, but when I removed it from Autoload, the game ran fine. Adding it again crashed the game again. This applies both when the addon is enabled or disabled.

commented

Yeah but it shouldn't work at all when the function is running but i'll look further into this tommorow

Alright.

commented

Can you disable the plugin and add Discord_Activity.coreupdate() in a _process(_delta) function? When disabling the addon the autoload gets removed and a export plugin in the background wich ships the discord_game_sd.[dll/.so] to the export folder.

The issue is i long term tested it and it obviously works fine so we have to pin point in your project wich i think isn't open source.

And there is 1.3 out now maybe test that

Okay, I downloaded the 1.3 version and did some tests, and I'm experiencing no more crashes.

commented

Great! Thats a relief :) Do you have a link or something to find your game when its finished?

Well, it's a private project for now, but I do plan on releasing it publicly someday :)

commented

That update shouldnt work i thought i fixed it but is the activity even showing for you?

Yeah, it works for me. Everything is showing correctly.

commented

Huh weird now it doesn't work for me lmao but thanks