drachenfrucht1 / godotcord Goto Github PK
View Code? Open in Web Editor NEWA Discord Game SDK integration for Godot
Home Page: https://drachenfrucht1.github.io/godotcord
License: MIT License
A Discord Game SDK integration for Godot
Home Page: https://drachenfrucht1.github.io/godotcord
License: MIT License
What's your expectation for this compiling successfully into Godot 3.2.4 once it comes out? I can do it, just is there anything you foresee being a problem?
Thanks for this btw. This is going to be a huge time savor for me and my team's project.
I feel like Signals has lots of advantages over function references.
Advantages:
yield
function.Disadvantages:
I don't feel any advantages and disadvantages though. Maybe we could discuss further on it.
Thank you.
Problem:
When I add the following line to any project with Godotcord and run the project, the game exits without any message or error.
peer.create_lobby(port, public)
Running Machine:
ArchLinux
File Structure:
res://addons/my_path/plugin.gd
tool
extends EditorPlugin
func _enter_tree() -> void:
add_custom_type(
"MyCustomServerNode",
"Node",
load('res://addons/my_path/server.gd'),
load('res://addons/my_path/assets/server.png')
)
if (not Engine.is_editor_hint()):
Godotcord.init(902336646891069450, Godotcord.CreateFlags_DEFAULT)
func _process(delta: float) -> void:
if (not Engine.is_editor_hint()):
Godotcord.run_callbacks()
func _exit_tree() -> void:
remove_custom_type(
"MyCustomServerNode"
)
res://addons/my_path/server.gd
extends Node
export(int) var port : int = 8000
export(bool) var public : bool = false
var tree : SceneTree = SceneTree.new()
var peer : NetworkedMultiplayerGodotcord = NetworkedMultiplayerGodotcord.new()
func _ready() -> void:
peer.create_lobby(port, public)
tree.network_peer = peer
func _exit_tree() -> void:
peer.close_connection()
tree.network_peer = null
res://server.tscn
Includes MyCustomServerNode
Terminal Console Output:
Running: /my/custom/godot/path/bin/godot.editor.64 --path /my/project/path --remote-debug 127.0.0.1:6007 --allow_focus_steal_pid 000000 --position 768,420 res://server.tscn
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x3cda0) [0x7fc8839a2da0] (??:0)
[2] discord::LobbyManager::GetLobbyCreateTransaction(discord::LobbyTransaction*) (/my/custom/godot/path/modules/godotcord/discord-files/lobby_manager.cpp:131)
[3] NetworkedMultiplayerGodotcord::create_lobby(int, bool) (/my/custom/godot/path/modules/godotcord/godotcord_network_peer.cpp:38)
[4] MethodBind2R<Error, int, bool>::call(Object*, Variant const**, int, Variant::CallError&) (/my/custom/godot/path/./core/method_bind.gen.inc:1717 (discriminator 12))
[5] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/another/custom/godot/path/core/object.cpp:921 (discriminator 1))
[6] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/another/custom/godot/path/core/variant_call.cpp:1112 (discriminator 1))
[7] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/another/custom/godot/path/modules/gdscript/gdscript_function.cpp:1091)
[8] GDScriptInstance::_ml_call_reversed(GDScript*, StringName const&, Variant const**, int) (/another/custom/godot/path/modules/gdscript/gdscript.cpp:1233)
[9] GDScriptInstance::call_multilevel_reversed(StringName const&, Variant const**, int) (/another/custom/godot/path/modules/gdscript/gdscript.cpp:1242)
[10] Node::_notification(int) (/another/custom/godot/path/scene/main/node.cpp:152)
[11] Node::_notificationv(int, bool) (/another/custom/godot/path/./scene/main/node.h:46 (discriminator 14))
[12] Object::notification(int, bool) (/another/custom/godot/path/core/object.cpp:933)
[13] Node::_propagate_ready() (/another/custom/godot/path/scene/main/node.cpp:197)
[14] Node::_propagate_ready() (/another/custom/godot/path/scene/main/node.cpp:186 (discriminator 3))
[15] Node::_propagate_ready() (/another/custom/godot/path/scene/main/node.cpp:186 (discriminator 3))
[16] Node::_set_tree(SceneTree*) (/another/custom/godot/path/scene/main/node.cpp:2565)
[17] SceneTree::init() (/another/custom/godot/path/scene/main/scene_tree.cpp:464)
[18] OS_X11::run() (/another/custom/godot/path/platform/x11/os_x11.cpp:3237)
[19] /my/custom/godot/path/bin/godot.editor.64(main+0x12d) [0x146f6f3] (/another/custom/godot/path/platform/x11/godot_x11.cpp:57)
[20] /usr/lib/libc.so.6(__libc_start_main+0xd5) [0x7fc88398db25] (??:0)
[21] /my/custom/godot/path/bin/godot.editor.64(_start+0x2e) [0x146f50e] (??:?)
What I Need:
I need either an explanation as to what I am doing wrong, or a patch to fix a possible bug. Thank you.
Right now, it's really difficult to read docs in raw format.
It would be cool to see some lines that differentiate sections in the docs.
Thank you.
I have this code in my script:
func _ready():
Godotcord.init(CLIENT_ID, Godotcord.CreateFlags_NO_REQUIRE_DISCORD)
var acv = GodotcordActivity.new()
acv.state = "just"
acv.details = "a test"
acv.large_image = "512"
acv.large_text = "Left Out"
GodotcordActivityManager.set_activity(acv)
func _process(delta):
Godotcord.run_callbacks()
When I run the game inside the editor, it works fine, but when I export it, I get this:
All the dlls are in the same game's directory.
Docs at github pages seems to be broken, I'm hoping that it gets some love.
As per the GDScript guidelines, please change the names of the functions and attributes that are in camelCase to snake_case.
Thank you.
The Windows Download Artifact is missing the discord_game_sdk.dll
Would you like to fix it?
Hey, why not use ReadTheDocs, it's what Godot uses, and I'd recommend using it. Currently, I know you're using GitHub Pages, but it's better to use ReadTheDocs instead.
After removing all parts of the GameSDK that use std::
(for example std::int32_t
becomes int32_t
) and adding using namespace std;
to types.h
(to fix #20), the engine compiles successfully. But when I try to run an empty scene in an empty project, I get the following error:
Even though the file structure is correct:
Hello, I need to use this for production purposes, because I can't find any other discord game sdk wrapper, would you like to implement other stuffs as well?
Thank you very much for your help!
Stuff needs to be implemented in godotcord:
This error happens on the main one.
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
At: core\io\multiplayer_api.cpp:204
And this one happens on the alt one.
ERROR: Node not found: Spatial/Players/1. At: scene\main\node.cpp:1381 ERROR: MultiplayerAPI::_process_get_node: Failed to get cached path from RPC: Spatial/Players/1. At: core\io\multiplayer_api.cpp:272 ERROR: Invalid packet received. Requested node was not found. At: core\io\multiplayer_api.cpp:204 ERROR: Node not found: Spatial/Players/1. At: scene\main\node.cpp:1381 ERROR: MultiplayerAPI::_process_get_node: Failed to get cached path from RPC: Spatial/Players/1. At: core\io\multiplayer_api.cpp:272 ERROR: Invalid packet received. Requested node was not found. At: core\io\multiplayer_api.cpp:204 ERROR: Node not found: Spatial/Players/1. At: scene\main\node.cpp:1381 ERROR: MultiplayerAPI::_process_get_node: Failed to get cached path from RPC: Spatial/Players/1. At: core\io\multiplayer_api.cpp:272 ERROR: Invalid packet received. Requested node was not found. At: core\io\multiplayer_api.cpp:204 ERROR: Node not found: Spatial/Players/1. At: scene\main\node.cpp:1381 ERROR: MultiplayerAPI::_process_get_node: Failed to get cached path from RPC: Spatial/Players/1. At: core\io\multiplayer_api.cpp:272 ERROR: Invalid packet received. Requested node was not found. At: core\io\multiplayer_api.cpp:204 ERROR: Node not found: Spatial/Players/1.
Here's the project, if you want to debug.
DiscordMultiplayerGame.zip
I'm thinking this is something wrong I did wrong but I figured I mention it here. I've gotten everything working in a 3.2.1 build. In the editor it works like a charm and is real easy to work with but once exported I haven't been able to get it past start up. Godot tosses out a "This code execution cannot proceed because discord_game_sdk.dll was not found." I've built export templates for it that have compiled fine and I've confirmed that the cpp and headers have made it in. Am I missing something?
Game crashes with this error.
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] <couldn't map PC to fn name>
[1] <couldn't map PC to fn name>
[2] DiscordVersion
[3] DiscordVersion
[4] DiscordVersion
[5] DiscordVersion
[6] <couldn't map PC to fn name>
[7] <couldn't map PC to fn name>
[8] <couldn't map PC to fn name>
[9] <couldn't map PC to fn name>
[10] <couldn't map PC to fn name>
[11] <couldn't map PC to fn name>
[12] <couldn't map PC to fn name>
[13] <couldn't map PC to fn name>
[14] <couldn't map PC to fn name>
[15] <couldn't map PC to fn name>
[16] <couldn't map PC to fn name>
[17] <couldn't map PC to fn name>
[18] <couldn't map PC to fn name>
[19] <couldn't map PC to fn name>
[20] <couldn't map PC to fn name>
[21] <couldn't map PC to fn name>
[22] BaseThreadInitThunk
-- END OF BACKTRACE --
Can you please help me out?
Edit: Only sometimes.
Right now I'm trying to get the members in the lobby, but I can't find on how to do that, there's no documentation on how to do that or am I just being ignorant?
If I don't have discord running when I launch the game, I got this:
ERROR: Godotcord::init: Condition "result != discord::Result::Ok" is true. Returned: ERR_CANT_CONNECT
At: modules\godotcord\godotcord.cpp:45
CrashHandlerException: Program crashed
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] <couldn't map PC to fn name>
[1] <couldn't map PC to fn name>
[2] <couldn't map PC to fn name>
[3] <couldn't map PC to fn name>
[4] <couldn't map PC to fn name>
[5] <couldn't map PC to fn name>
[6] <couldn't map PC to fn name>
[7] <couldn't map PC to fn name>
[8] <couldn't map PC to fn name>
[9] <couldn't map PC to fn name>
[10] <couldn't map PC to fn name>
[11] <couldn't map PC to fn name>
[12] <couldn't map PC to fn name>
[13] <couldn't map PC to fn name>
[14] <couldn't map PC to fn name>
[15] <couldn't map PC to fn name>
[16] <couldn't map PC to fn name>
[17] <couldn't map PC to fn name>
[18] <couldn't map PC to fn name>
[19] <couldn't map PC to fn name>
[20] <couldn't map PC to fn name>
[21] <couldn't map PC to fn name>
[22] BaseThreadInitThunk
-- END OF BACKTRACE --
My code is very simple:
func _ready():
var _transition = tween.interpolate_property(
transition, "cutoff", 0.0, 1.0, 2.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT
)
var _start = tween.start()
Godotcord.init(CLIENT_ID, Godotcord.CreateFlags_NO_REQUIRE_DISCORD)
var acv = GodotcordActivity.new()
acv.state = "In title screen"
acv.large_image = "512"
acv.large_text = "Left Out"
GodotcordActivityManager.set_activity(acv)
func _process(delta):
Godotcord.run_callbacks()
As Godot is reaching 3.3, the current release 3.3rc9 went online 3 days ago, I'd recommend checking if Godotcord works with Godot version 3.3rc9 as well.
Thank you.
I didn't understand how I can compile the library, scons
doesn't work, so what is the way to run SCsub?
I'm experiencing errors when trying to compile Godot 3.2.4 with Godotcord on Ubuntu 20.10
This is with a fresh clone of both Godot and Godotcord, after running setup.sh
I built with scons -j6 platform=x11 target=release_debug use_lto=yes tools=yes
Could this be an issue with Godotcord or with the Game SDK?
Does this compile on Linux for you @Drachenfrucht1?
Specs:
Godot 3.2.4 beta 4
Ubuntu 20.10
I would like to use GDNative, because I can't compile Godot myself.
It would be nice to have this as a GDNative library.
Hi everyone, I just wanted to make a PR to update the version of Godot to 3.3.2-stable, but it doesn't seem to compile properly. Could someone look into it? Windows does compiles, Mac OS seem to have problems with linking and Linux build got cancelled because of the failure in Compilation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.