x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.19
Tags:
more ▼

asked Apr 29 '18 at 11:44 AM in C++ Programming

avatar image

Merkaber
1 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Merkaber,

I think you are searching for this:
https://wiki.unrealengine.com/Procedural_Mesh_Component_in_C%2B%2B:Getting_Started
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);

more ▼

answered May 01 '18 at 02:44 PM

avatar image

RobbiTheFox
8 1 2 3

avatar image Merkaber May 01 '18 at 03:10 PM

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.

avatar image RobbiTheFox May 01 '18 at 03:41 PM

I think you should try this one to get a basic knowledge of UE4:
https://www.youtube.com/watch?v=a0qNO6_xPx0

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question