Download

[4.13] Loading screen questions

Hi everyone, I’ve lately been trying to make a classic loading screen with background music, random tips, and all the other good stuff, like the Deus Ex: MD one for example. I followed this tutorial and got it working without problems. I’ve also managed to make it use self-made UMG widgets but now i’m stuck as I couldn’t find any info to help me with the following things:

1. Background music:
I first tried doing this in the widget by using the “play sound 2D” blueprint node but that, and all other music-related BP nodes, didn’t work. I later discovered that the buttons in my loading screen widget also didn’t make any sounds when hovered or clicked but those sounds all played at once when the loading screen dissapeared and the level started. I guess this means there is no audio thread or something like that active during loading screens. Can anyone confirm if it’s possible to play audio during this type of loading screen directly from the widget? If so, how?

2. Movieplayer:
Right now i do have music on my loading screen thanks to the movieplayer. It doesn’t loop though and the only filetype that’s worked for me so far is an .mp4. Does anyone know what filetypes are supported by the movieplayer (not the mediaplayer!), because i’d really prefer to just have it play a sound file instead of an actual video. Is there a simple way to make them loop?

3. Dynamic multicast delegates:
This problem isn’t really inherent to C++ loading screens but I still need help with it anyway :p. I tried to make the .mp4 file loop by using OnMoviePlaybackFinished() and PlayMovie() but wanted to actually understand delegates first, so I tried to make my own Dynamic multicast delegate to be able to tell my widget when the level has finished loading, without calling IsLoadingFinished() every tick. The following code gives me the dreaded intellisense red lines of doom though:



// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "Engine/GameInstance.h"
#include "UpdatingInEditorWidget.h"
#include "LoadingScreenGameInstance.generated.h"




/**
 *  !!! Don't forget to set this as the gameinstance !!!
 */

 
//Multi cast delegate can bind multiple functions, use AddDynamic(...) to add function to multicast bind

DECLARE_DYNAMIC_MULTICAST_DELEGATE(FbpPostLoadDelegateSignature);

UCLASS()
class U2DMENUTEMPLATE_API ULoadingScreenGameInstance : public UGameInstance
{
	GENERATED_BODY()


        ...


	UPROPERTY(BlueprintAssignable, Category = "LoadingScreen")
		FbpPostLoadDelegateSignature OnPostLoadMap;

	UFUNCTION()
		virtual void BroadcastpostLoadMap();

	
	
};



I get an error for DECLARE_DYNAMIC_MULTICAST_DELEGATE(FbpPostLoadDelegateSignature); and it says “this declaration has no storage class or type specifier”. I’ve been following almost every guide on (dynamic multicast) delegates but i keep getting this error. Does anyone know what I’m doing wrong?

4. Texture pop-in:
I figured a good loading screen should also be able to avoid the ugly texture pop-in you get when loading a new level and tried using StreamAllResources() as this guy recommends. I’d prefer not to call this function at begin play for every level and have it built in in the loading screen instead. I’d also like having some sort of nonblocking way to stop the texture pop-in because nobody likes having their screen frozen for a few seconds. Does anyone know how to implement something like that?

That’s all the questions I have at the moment. If somebody could help me with these i’d greatly appreciate it and i’d probably be able to make a video guide or something so people won’t have to search so hard to make a proper loading screen anymore.