Source Code - Where to find?

Hi there! I want to ask… we have a school competition and teachers request a Source Code from our project… where should I find it? And another question, when I’m working in Blueprints, is there somewhere writing a code? :smiley:

hello

I will answer your question in reverse because you need to first understand blueprints work. There are two ways to work with Unreal Engine 4 from a coding perspective. The first and most common is Blueprints, this is the easy visual scripting system most know and love. The second is C++ code, the traditional way of coding. A single project can use both at the same time. With that in mind one very important thing to know is that Blueprints is not C++, so if you are developing in Blueprints THAT IS your code. Now there are ways to have blueprints and C++ communicate with each other, but they are not the same.

To answer your first question, if you are working with a C++ project your code will be located under the Source folder within your project’s folder. If you are not working with a C++ project, I believe you can change your current project into a C++ project by simply going to File → New C++ Class. This will NOT “translate” your blueprints to C++, you will have to do that manually.

Hope this helps

Hi ArcainOne! Thanks for your answer! So that means… if we want to have everything in that source code, we have to write it by ourselves? Becuase I think, that the entire competition is about writing that code so it’s the thing that matters

That is correct, if you want to utilize a “source code” then you will need to write it in C++ without using blueprints. Of course it will also depend on how strict your competition is. Blueprint is technically a coding language and can be equated to a visual form of Java or C#.

Well… in this case… if it’s equated to Java or C#… i think they might accept it, but they probably had to see the blueprints right? I mean… there’s not specified the language or engine so I believe they’ll accept it. Thanks man !

Bimbaw,

There is another way to see a blueprint (besides the visual nodes), open up a function that you have written (the Event graph and Construction script are essentially functions as well). When you see the “nodes”, click on one to select it, then press Ctrl+A, then Ctrl+C. Open a text editor, and then Ctrl+V.

Essentially you are copy and pasting, the “directives”, declarations, etc, that the blue print compiler is using. You might try showing that to your teacher as well. It will look far more “codish”, but there is a lot of information in there about constructing the “nodes” themselves.

just a thought,

So that would technically mean that it would look like a C++?

Like I said, Technically is the keyword there. I would carefully read the rules of your competition to ensure there are not specifics reguarding the “type” of programming they are looking for. If they did not specify then I would think blueprints are totally acceptable, to be sure I would contact someone who knows more about the competition and ask them, maybe show them a screen shot or the text base blueprint described by @. Otherwise the safe route would be C++

Hello ,

As ArcainOne previously stated, you should really check with the people running this competition to ensure what type of project is required. In the case of a coding competition, they may require only C++ and, unless the competition is strictly using UE4, they most likely won’t accept blueprints.

As for 's comment, the code that is output from copying the nodes to a text file is a very rough version of C++ code but can give you a loose interpretation. The code that is output ignores all execution and the order of how the nodes are linked up or how they are related in the blueprint. It will only give you the code that is contained within each node. In short, the code output from that method would never compile and most likely would not be accepted as-is.

The competition is not very strictly based, they said : you can choose your own engine, and own programming language, or combination of both. So that would technically mean that we can do it in Blueprints right?

I’m not in the position to confirm or not. I would suggest asking them directly to take a look at blueprints and ensure that they’ll accept it. From that description, it seems like they would, but it doesn’t hurt to be sure.