Dear Community,
The code in node was first presented by Epic staff, Marc Audy, as code used in Fortnite.
I’ve fully implemented the code as well as making it user-friendly.
In particular I’ve presented a solution for ensuring you can spawn multiple instances of the same UE4 level, by giving you an “Instance Number” that you should increment each you spawn an instance of a level.
allows me to enable you to easily create as many uniquely translated and rotated instances of a level as you want!
is ideal for Dynamic Level Generation!
**Can Include Landscapes and Other Fancy Level Features!**
In my demo I included a landscape in my level "tile."
Level Scripting / Level Blueprint
You can also include level scripting that will run uniquely per level isntance!
**Victory Load Level Instance**

C++ Code For You
Here’s my implemenation of the code Marc Audy originally presented to the Community, exactly as it is in my Victory BP Library:
bool UVictoryBPFunctionLibrary::VictoryLoadLevelInstance(
UObject* WorldContextObject,
FString MapFolderOffOfContent,
FString LevelName,
int32 InstanceNumber,
FVector Location, FRotator Rotation)
{
if(!WorldContextObject) return false;
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject);
if(!World) return false;
//~~~~~~~~~~~
//Full Name
FString FullName = "/Game/" + MapFolderOffOfContent + "/" + LevelName;
FName LevelFName = FName(*FullName);
FString PackageFileName = FullName;
ULevelStreamingKismet* StreamingLevel = NewObject<ULevelStreamingKismet>((UObject*)GetTransientPackage(), ULevelStreamingKismet::StaticClass());
if(!StreamingLevel)
{
return false;
}
//Long Package Name
FString LongLevelPackageName = FPackageName::FilenameToLongPackageName(PackageFileName);
**//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Here is where a unique name is chosen for the new level asset
// Ensure unique names to gain ability to have multiple instances of same level!
// <3**
//Create Unique Name based on BP-supplied instance value
FString UniqueLevelPackageName = LongLevelPackageName;
UniqueLevelPackageName += "_VictoryInstance_" + FString::FromInt(InstanceNumber);
//Set!
StreamingLevel->SetWorldAssetByPackageName(FName(*UniqueLevelPackageName));
**//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**
if (World->IsPlayInEditor())
{
FWorldContext WorldContext = GEngine->GetWorldContextFromWorldChecked(World);
StreamingLevel->RenameForPIE(WorldContext.PIEInstance);
}
StreamingLevel->LevelColor = FColor::MakeRandomColor();
StreamingLevel->bShouldBeLoaded = true;
StreamingLevel->bShouldBeVisible = true;
StreamingLevel->bShouldBlockOnLoad = false;
StreamingLevel->bInitiallyLoaded = true;
StreamingLevel->bInitiallyVisible = true;
//Transform
StreamingLevel->LevelTransform = FTransform(Rotation,Location);
StreamingLevel->PackageNameToLoad = LevelFName;
if (!FPackageName::DoesPackageExist(StreamingLevel->PackageNameToLoad.ToString(), NULL, &PackageFileName))
{
return false;
}
//~~~
//Actual map package to load
StreamingLevel->PackageNameToLoad = FName(*LongLevelPackageName);
//~~~
// Add the new level to world.
World->StreamingLevels.Add(StreamingLevel);
return true;
}
**Latest plugin download on the UE4 Wiki: **
https://wiki.unrealengine.com/File:VictoryPlugin.zip
**Latest plugin packaged binaries, Win32 Shipping and Win64 Development on UE4 Wiki: **
https://wiki.unrealengine.com/File:VictoryPluginPackaged.zip
Victory Plugin on Media Fire
If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!
Please note clicking link will not start a download instantly, it will just take you to the Media Fire file description.
Editor binaries and Packaged binaries in one file:
Win32 Shipping and Win64 Development Supported
VictoryPlugin
**Note on Packaging Victory Plugin**
https://forums.unrealengine.com/showthread.php?3851-(39)--s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=368790&viewfull=1#post368790
Enjoy!
:)