Orbdale Terrain · OrbdaleTerrain module · member function
UOrbdaleTerrainSubsystem::
SaveTerrainToFile
Write the terrain's save file: a snapshot pinned now (the world may go on changing), streamed on a task into <Path>.tmp, flushed and renamed over Path.
Declaration
EOrbdaleTerrainSaveResult SaveTerrainToFile(const FString& Path, FOnTerrainFileSaved Done,
const FOrbdaleTerrainSaveOptions& Options = FOrbdaleTerrainSaveOptions());- Header
#include "OrbdaleTerrainSubsystem.h"- Module
PublicDependencyModuleNames.Add("OrbdaleTerrain");in your module’s Build.cs.- Stability
- Stable: changes within a major version only add.
- Thread
- Every member function is game thread unless it says otherwise. (the rule of UOrbdaleTerrainSubsystem)
Description
Any size; nothing is held whole in memory. Allowed on a read-only terrain. The game's own save keeps the result's Path, FileHash and StateHash (FOrbdaleTerrainSaveRef, <slot>.<n>.tsterrain).
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
Path | const FString& | — | Absolute file path to write; the temporary file is beside it. |
Done | FOn | — | Called from Tick on the game thread when the write ends, only if this returns Ok. |
Options | const FOrbdale | FOrbdale | What the save keeps. |
Returns
Ok when the write started; NoTerrain; Busy while a save is in flight; WriteFailed when Path is the file this terrain pages from (save to a new name, then delete the old one).