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. 

FLoadingScreenAttributes during SeamlessTravel

Hello, I have a problem with SeamlessTravel and TranstionMaps.

-Player flow is as follows: MenuMap ->(FLoadingScreenAttributes) -> LobbyMap -> SeamlessTravel(FLoadingScreenAttributes or UUserWidget) + TransitionMap -> MatchMap.

-When player moves from MenuMap to LobbyMap, I can use a slate widget (FLoadingScreenAttributes) to display a loading screen or a movie, and it works smooth and perfectly.

-But when player moves from LobbyMap to MatchMap using a SeamlessTravel+TransitionMap, the same loading screen with the same FLoadingScreenAttributes is never seen (I can see a BP_SkySphere on the TransitionMap).

The loading screen code in both transitions is this:

  //AMyPlayerController.h
 UFUNCTION(Reliable, Client)
 void ShowLoadingScreen();
 UFUNCTION(Reliable, Client)
 void EndLoadingScreen();

 //AMyPlayerController.cpp
 #include "MoviePlayer.h"
 ...
 void AMyPlayerController::ShowLoadingScreen_Implementation()
 {
      FLoadingScreenAttributes LoadingScreen;
      LoadingScreen.bAutoCompleteWhenLoadingCompletes = true;
      LoadingScreen.MinimumLoadingScreenDisplayTime = 0.1f;
      LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
      GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
 }
 
 void AMyPlayerController::EndLoadingScreen_Implementation()
 {
     GetMoviePlayer()->StopMovie();
 }

-Is not possible to use loading screens (FLoadingScreenAttributes) during SeamlessTravel and TransitionMaps?

-However, I am able to use as an alternative a UUserWidget and add to Viewport but the animation freezes for a few seconds during the SeamlessTravel+TransitionMap:

 //AMyPlayerController.h
 UPROPERTY(EditDefaultsOnly, Category = "Widget")
 TSubclassOf<class UUserWidget> LoadingWidget;

 UFUNCTION(Reliable, Client)
 void ShowLoadingScreen();
 UFUNCTION(Reliable, Client)
 void EndLoadingScreen();

 //AMyPlayerController.cpp
 void AMyPlayerController::ShowLoadingScreen_Implementation()
 {
       UUsertWidget* Widget = CreateWidget<UUserWidget>(this, LoadingWidget);
       if (Widget)
      {
             Widget->AddToViewport();
      }
 }
 
 void AMyPlayerController::EndLoadingScreen_Implementation()
 {
     //GetAllWidgetsOfClass UUserWidget -> RemoveFromParent();
 }


Any tips? Thx!

Product Version: UE 4.11 Preview
Tags:
more ▼

asked Feb 27 '16 at 08:12 PM in C++ Programming

avatar image

Helghast
102 11 15 69

avatar image Helghast Mar 09 '16 at 08:52 AM

Anyone know any advice? Thx!

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

1 answer: sort voted first

Whenever absolute travel occurs, if there is a valid loading screen, it will play the movies and widgets you've specified in GetMoviePlayer()->SetupLoadingScreen(LoadingScreen) in a separate thread when the game thread blocks to load. During seamless travel, the game thread never blocks during loading, so the specified loading screen never appears.

It should be possible to manually start and stop the loading screen in your ShowLoadingScreen and EndLoadingScreen functions using PlayMovie and StopMovie.

 void AMyPlayerController::ShowLoadingScreen_Implementation()
 {
   GetMoviePlayer()->PlayMovie();
 }
 
 void AMyPlayerController::EndLoadingScreen_Implementation()
 {
   GetMoviePlayer()->StopMovie();
 }
more ▼

answered Aug 23 '16 at 08:22 PM

avatar image

ZacharyLewis
44 2 5 8

avatar image JohnnyDale Feb 07 '19 at 02:35 AM

I have this... and it will never stop for some reason

 #include "CustomGameInstance.h"
 #include "MoviePlayer.h"
 
 void UCustomGameInstance::Init()
 {
     Super::Init();
 
     FCoreUObjectDelegates::PreLoadMap.AddUObject(this, &UCustomGameInstance::OnPreLoadMap);
     FCoreUObjectDelegates::PostLoadMapWithWorld.AddUObject(this, &UCustomGameInstance::OnPostLoadMapWithWorld);
 }
 
 void UCustomGameInstance::OnPreLoadMap(const FString& InMapName)
 {
     BeginLoadingScreen();
 }
 
 void UCustomGameInstance::OnPostLoadMapWithWorld(UWorld* InLoadedWorld)
 {
     EndLoadingScreen();
 }
 
 void UCustomGameInstance::BeginLoadingScreen()
 {
     if (!IsRunningDedicatedServer())
     {
         FLoadingScreenAttributes LoadingScreen;
         LoadingScreen.bAutoCompleteWhenLoadingCompletes = true;
         LoadingScreen.MinimumLoadingScreenDisplayTime = 3;
         LoadingScreen.bMoviesAreSkippable = false;
         LoadingScreen.bWaitForManualStop = true;
         LoadingScreen.MoviePaths.Init("LoadingScreen", 1);
         LoadingScreen.PlaybackType = EMoviePlaybackType::MT_Looped;
         //LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
 
         GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
     }
     OnPreLoadMapEvent();
 }
 
 void UCustomGameInstance::EndLoadingScreen()
 {
     GetMoviePlayer()->StopMovie();
     OnPostLoadMapWithWorldEvent();
 }

(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