Game fails to launch after a few runs #15

Closed
opened 2023-05-11 18:40:33 +00:00 by Koanyaku · 15 comments
Koanyaku commented 2023-05-11 18:40:33 +00:00 (Migrated from github.com)

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]

I downloaded the 1.2 version of the addon and created this simple script: ```gdscript 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: ```gdscript 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]

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?

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?

And also linux or windows?

And also linux or windows?
Koanyaku commented 2023-05-11 19:20:07 +00:00 (Migrated from github.com)

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.

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: ```gdscript 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.
Koanyaku commented 2023-05-11 19:23:16 +00:00 (Migrated from github.com)

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.

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.

did you completely remove all the files?

did you completely remove all the files?
Koanyaku commented 2023-05-11 19:28:56 +00:00 (Migrated from github.com)

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.

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.

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

Yeah but it shouldn't work at all when the function is running but i'll look further into this tommorow
Koanyaku commented 2023-05-11 20:15:22 +00:00 (Migrated from github.com)

Alright.

Alright.

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

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
Koanyaku commented 2023-05-12 14:05:26 +00:00 (Migrated from github.com)

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

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

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

Great! Thats a relief :) Do you have a link or something to find your game when its finished?
Koanyaku commented 2023-05-12 15:54:55 +00:00 (Migrated from github.com)

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

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

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

That update shouldnt work i thought i fixed it but is the activity even showing for you?
Koanyaku commented 2023-05-12 17:05:15 +00:00 (Migrated from github.com)

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

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

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

Huh weird now it doesn't work for me lmao but thanks
Sign in to join this conversation.
No description provided.