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"

How to load umap file?

Hi, Guys

I am a newbie to Unreal4, Wanna build a automation test to check whether the Game has loaded the Map, If not, load it. I can use the GEngine to get the UWorld and MapName. But I do not know how to load a new Umap file in C++. I have tried the AutomationOpenMap function, It does not work. Could you guys please help me about that?

Thanks.

Product Version: Not Selected
Tags:
more ▼

asked Aug 07 '18 at 05:30 AM in C++ Programming

avatar image

Yli327
17 2 3 8

avatar image Sveitar Aug 07 '18 at 06:02 AM

By loading umap file do you mean loading the package in memory or just open it to play?

avatar image Yli327 Aug 08 '18 at 07:12 AM

Hi Sveitar,

I just wanna open it to play. Do you know which function I should use?

Thanks

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

1 answer: sort voted first

The simplest way is to use UGameplayStatics::OpenLevel

 #include "Kismet/GameplayStatics.h"
 
 void YourClass::YourMethod()
 {
     UGameplayStatics::OpenLevel(GetWorld(), "YourMapName");
 }

Let me know if this was what you were looking for. And don't forget to mark the answer as correct.

Enjoy!

more ▼

answered Aug 08 '18 at 07:31 AM

avatar image

Sveitar
1k 8 24 28

avatar image Sveitar Aug 08 '18 at 07:33 AM

By the way, UGameplayStatics class is a blueprint library. You will find most of the blueprints exposed static methods there. Take a look at the header file, there's plenty of functions that serves as shortcuts for doing lots of things.

Enjoy!

avatar image Yli327 Aug 08 '18 at 10:42 PM

I have tried it, but it react nothing, I do not saw the map being changed something..Could you please teach me in detail? I am totally newbie to Unreal..

avatar image Yli327 Aug 08 '18 at 09:58 PM

May I ask a silly question? What is the default file path the OpenLevel uses? Thanks.

(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