Creating a dynamic map with c++ from existing data

Hello everyone. I am targeting to make a map which is generated by existing data. Therefore I need to know how do I place static meshes into my level and transform them by using c++ or the blueprint system (preferable c++); creating own mashes by given variables, such as vectors and size; and creating a dynamic terrain. I want to read the data from a database / xml file.

Since all tutorials I have found explain how you place objects by drag and drop within the editor and editing them within the editor, I do not know where I can get information regarding my question. Even the c++ programming tutorials end up with drag and drop the new created actors into the level.

I tried to load a sample project (e.g. first person) and analyse the created .cpp and .h files in order to understand how UE4 works, but it looks like there is no implementation for the static mashes and everything else.

The map should be loaded before the player get into it. It is going to be a “open world”. One level.

I will be very thankful, if you have any links to tutorials explaining how UE4 editor works together with c++ and how you can change code or implement own things into your game project by using c++ or the blueprint system! It might be the case that I do not search for the correct terms.

Hey Merkaber,

I think you are searching for this:

If so, I would recommend having a look at the Runtime Mesh Component PlugIn which is a faster version of the previous link.

To spawn “MyActor” directly from c++ use:
AMyActor *pointerToYourObject = GetWorld()->SpawnActor<AMyActor>(AMyActor::StaticClass(), FVector location, FRotator rotation, FActorSpawnParameters spawnParameters);

Thank you very much for answering! I already came across this post but it didn’t help yet. I think the biggest problem is that I don’t understand C++ combined with the blueprint system. For example, after choosing one of the default levels, several cpp files are created. However there is no “main” function which starts the level/game and therefore I don’t know where to put my code, where to call a new class or even where to place your suggested code above. I just don’t understand the workflow.

I think you should try this one to get a basic knowledge of UE4: