Me and my brother are developing a game that has to store user data into a database. For example their level, exp amount, amount of health, things like that. We both however come from a webdevelopment background and have no experience in C++ whatsoever, which is why we went with blueprints.
I’ve searched across all of the interwebz but I haven’t been able to find out how to ‘do a call to C++’ from a blueprint to make a connection to something like MySQL. Is something like this even possible to do, and if so… how?
If this isn’t possible, could you then perhaps supply me with alternatives? I would really like to avoid having to learn C++ from scratch.
You likely shouldn’t be connecting to the DB directly through C++ to begin with. It’s likely best to setup a PHP API/REST to handle DB communication. Doing that you should be able to use the Blueprint nodes for communicating via PHP to store info in MySQL.
If the server executable is the only thing that has access to this code then sure.
In that case writing a plugin for UE4 that can interact with the MySQL C++ driver. With that said the MySQL C++ driver is blocking and as such any communication with the DB needs to be done in a thread so that it doesn’t cause the game to stop and wait.
You can’t call external native code (because at that point they aren’t C++ anymore) from blueprint, instead you need to write BlueprintCallable C++ code that will bind some external library to blueprint. I know some people been interested in DB support in UE4 so you might find some ready plugins