AcademyCross-Project DLC (Pak) Loading | Unreal Engine 5 Advanced Tutorials
Deep DiveAdvanced

Cross-Project DLC (Pak) Loading | Unreal Engine 5 Advanced Tutorials

Learn how to build DLCs (UE paks) like Steam or Android downloadable content in Unreal Engine 5.

September 1, 2024
Cyrus 365
1 min read
Unreal EngineDLCPak FilesAdvanced

Learn how to build DLCs (UE paks) like Steam or Android downloadable content.

Building the Plugin as DLC

powershell
.\RunUAT.bat BuildPlugin -plugin="C:\XXXXXXXXXXXXX.uplugin" -package="C:\XXXXXXXX"

Example: .\RunUAT.bat BuildPlugin -plugin="D:\_Cyrus\2_Plugin_Original\CustomSketchfab\Sketchfab.uplugin" -package="D:\_Cyrus\2_Plugin_New\CustomSketchfab"

Loading DLC at Runtime (C++ Code)

C++
/**
 * Input the full path of the pak file to mount and register it. E.g. C:...\\MyGame\\Content\\Paks\\MyPak.pak
 * @param InPakFilename "C:\\_EduTec_Pk\\DLCs\\Windows\\DebugDLCs\\Content\\Paks\\pakchunk1-Windows.pak" 
 * @return 
 */
UFUNCTION(BlueprintCallable, Category = "DLCs|Debug")
bool DebugMountDLC(const FString& InPakFilename);
C++
{
  // Try to mount(Load) the pak file, by input the absolute path of the pak file
  if (UC3_KBP_Paks_FL::MountAndRegisterPak(InPakFilename))
  {
    UE_LOG(LogTemp, Warning, TEXT("DLC Mounted Successfully!"));
    return true;
  }
  return false;
}