easy way to convert blueprints to c++?


since most of the documentation and tutorials are blueprint only, and most of my game is in c++, its incredibly frustrating and time consuming to look up blueprint functions and copy/mash code together.
it would be great if when you ‘add code to project’ you could select a blueprint as a base class, since thats not there,

is there an easy/easier way to do it?


I’m not sure if you mean convert a blueprint to c++, or just to be able to select a blueprint as a base class.

I think you just want to be able to select a base class, however if you mean convert a actual blueprint to c++, then in 4.6 if you change your engine.ini file so that it has “bNativeCodeGenerationTool=true” under the “[kismet]” section (by default bNativeCodeGenerationToo is set to false), then when you open a blueprint in the editor, at the bottom of the file menu will be a “Developer” option, click that and a side menu opens, and at the bottom of that is “Generate Native code” , click that and you get a window where you set where the c++ files will be saved to.

Now currently not everything is converted properly and some of the blueprint function seem to be setup so that can’t be called from external modules, so I am getting linking problems. However the classes can still be a good starting point if you want to convert a blueprint you have created into c++.

thats is a good start at least, thanks :slight_smile:

blueprints are so messy and ugly, hope epic get the c++ versions of the tutorials done soon, would save a lot of messing.

If you blueprints are messy your c++ code will be messy. :smiley:

i mean visually messy,
compared to a couple of lines of code, 20 fat ugly rounded boxes splattered with tiny coloured circles joined by coloured feathery wavy lines…
really not keen on blueprints at all, maybe if there was a ‘clean and simple’ visual option for them to take away some of the gaudyness or something.

Why would you want to program in C++ if you’re not able to find your way around a C++ project? Finding the C++ function behind a blueprint function is trivial. Most of the time it’s the exact same name minus spaces, sometimes you might have to look up a DisplayName instead.

This kind of goes without saying nowadays, but get yourself Visual Assist X if you haven’t. Learn to use Open File (Alt+Shift+O), Find Symbol (Alt+Shift+S), Goto Related (Alt+Shift+G), etc. I can easily look at an unknown node in a blueprint example, hit Alt+Shift+S, then type in the first few letters of the node to instantly find it.

The look of blueprints has evolved over time and with lots and lots of UX feedback. The current look isn’t just a whim, I’m pretty certain this is what Epic has found works best over time. There are many options in the Graph Editors preferences tab where you can tweak the look as well.

Graphical scripting is always going to look a bit like spaghetti. Just like there are many coding styles, there will be different blueprint graph styles. But don’t discredit the entire concept on the simple basis of “it’s visually messy”. Even as a heavy C++ user, I still use blueprint a lot in some cases when it can severly reduce the amount of boilerplate required. After a while you start getting used to making quick judgment calls as to whether something would be faster to make in C++ or in blueprint.

EDIT: This choice of wording just kind of clicked in my head:

Surely you’re not directly copying the contents of blueprint functions into your own code? All blueprint functions can be called in native and you are doing yourself a huge disservice if you’re not making use of this.

as you might have guessed im still doing tutorials, still getting to know how to do things in ue4.

i can find my way round c++ just fine, and have no problem with visual scripting either, ive been doing both literally for years.
ive also seen the evolution of blueprints from the beta tests to present day, and i have seen how they have bloated and become visually heavy too.
messing around joining boxes is way overkill for most things, once i am familiar enough with ue4 code base to only use them where appropriate i will.

however, the problem is that most of the tutorials are in blueprint with no c++ equivalent yet, which is why i asked for an easy way to convert them to c++.

Having C++ derive from blueprint isn’t realistic, because the blueprint is runtime dynamic. You can’t change a C++ base class without recompiling.

Meanwhile, the experimental native code generation tool seems to be the best option for you.

@ cmartel
‘copy/mash’ is the way of the future! lol
sorry if that term was not taken the right way, no offense meant