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 get the current player level while using World Composition?

Hi, I'm using World Composition in a dedicated server setup. My world is made of sublevels. The main level is called "Yliakum", and sublevels are named like: "Yliakum_X01_Y01", "Yliakum_X01_Y02", ....

I need to know in which of the sublevels my player currently is.

Using this code, unfortunately I get the top level (persistent level) and not the current sublevel

 FString MapPackageLongName = GetWorld()->GetCurrentLevel()->GetOutermost()->GetName();

The print out says just "Yliakum".

Screenshot attached shows the setup.

alt text

To explain why I need it, I want to trigger different weather based on the level the player is in. Getting the current player level I can then render around the player rain or snow particles.

Product Version: UE 4.18
Tags:
more ▼

asked May 20 '18 at 03:52 PM in C++ Programming

avatar image

Talad
121 5 8 13

avatar image TigerFish89 May 16 '19 at 05:47 AM

I want to know too. Do you have a answer?

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

2 answers: sort voted first

If your maps are assembled in a grid like fashion why not just use the X/Y coordinates of the player to figure it out? Other than that It may be difficult to get what level they are in, you could possible get the level from the object they are currently standing on.

more ▼

answered May 21 '18 at 02:15 PM

avatar image

HarryHighDef
1.4k 2 14 17

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

Hi, Did you found something usefull about this?

more ▼

answered Jun 08 '18 at 04:11 PM

avatar image

Haoris
174 8 14 25

(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