How do you include additional files or directories in a plugin?

Asking for a licensee

I have a plugin that needs to copy some data files into the final build for our game. For instance, say we have a Data directory that contains a set .dat files. How do we get those copied as part of the build step?

You can do this by adding a runtime dependency in your *.Build.cs. Here’s some code to copy the Data directory

    RuntimeDependencies.Add(new RuntimeDependency("$(ProjectDir)/Plugins/SamplePlugin/Data/..."));
  • Doesn’t perform folder translation so it gets the same path that it had in the plugin
  • It will expand $(EngineDir), $(ProjectDir), etc.
  • You can specify single files or all files in the directory by using DirName/…
  • You can mark the files as UFS (UnrealFileSystem) or NonUFS. UFS will place the files into a pak file. NonUFS copies them as part of the install but does not place them inside the PAK file. If you don’t specify the parameter, it defaults to NonUFS
2 Likes