0 votes

I'm making a .dll for godot, so far everything work if I only receive values from .dll, but now I need to send values to the .dll from godot, but ClassDB and D_METHOD aren't recognized by Visual Studio.

I've compiled the godot-cpp with headers generating the bindings and binaries, added the paths include, include/core, include/gen and the .libs in the project's properties, but only when I try to include "classdb.h" and make use of ClassDB::bindmethod(DMETHOD("myMethod", "argName"), &MYCustomClass::myMethod); Visual studio flags CLassDB and DMETHOD as undefined

I've tried including the path "C:\godot-3.2.2-stable\core" to the project properties but then other Classes are flagged as ambiguous if i try to rebuild the project.

What is the correct way to make use of ClassDB::bind_method in a visual studio project

Thank you.

in Engine by (29 points)

1 Answer

0 votes

My ClassDB doesn't have method bind_method, nor I don't get why do you need it.

What's your exact task?

To "pass values" back and forth you have to use methods. You should register them to make callable by GDScript. Additionally you could register a property, by providing setter and getter. This will also make this property visible in Godot's inspector.

Alternatively, you could simply get GDScript's variable at C++ side with

Variant value = someNode->get("gdscript_var");
by (1,594 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.