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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to get current map name with world composition?

Hi I am looking to get current map name when using world composition. I will use it to create folder and organize data for each sub-map.

I try to use : GetWorld()->WorldComposition->GetWorld()->GetMapName() or GetWorld()->GetMapName()

but I only get the name of the parent of the world composition.

Is there a way to know which level is the current active one?

Thanks

Product Version: Not Selected
Tags:
more ▼

asked Apr 24 '15 at 08:46 AM in C++ Programming

avatar image

bahamutdragoon
1 1 2 4

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

1 answer: sort voted first

Hi,

You need map package name. GetWorld()->GetOutermost()->GetName(); In PIE map name will have special prefix like: 'Game/Maps/UEDPIE0_MyMapName'

more ▼

answered Apr 24 '15 at 09:06 AM

avatar image

ddvlost STAFF
1.3k 18 7 48

avatar image bahamutdragoon Apr 24 '15 at 09:33 AM

I think you misunderstood what I mean.

Your solution always give me the parent name but with the hierarchy of the folder.

But I don't need the hierarchy of the map. I need the name of the current sub level.

For example:

My main level is "desert" (with world composition active)

I have a multiple sublevel with the name :

-"desert_landscape"

-"desert_props01"

...

If "desert_landscape" is the active level for editing, I would like to get it's name (e.g "desert_landscape").

After that, I'd like to use his name to create folder in the world hierarchy.

avatar image ddvlost STAFF Apr 24 '15 at 09:48 AM

Active level in the editor is a "Current Level", so you code should be like

 FString MapPackageLongName = GetWorld()->GetCurrentLevel()->GetOutermost()->GetName();
 FString MapPackageShortName = FPackageName::GetShortName(MapPackageLongName);




avatar image Talad May 20 '18 at 03:41 PM

The code above for me doesn't return the sublevel, but just the top (persistent level).

(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