Skip to content
Orbdale

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

NameTypeDefaultMeaning
Pathconst FString&—

Absolute file path to write; the temporary file is beside it.

DoneFOnTerrainFileSaved—

Called from Tick on the game thread when the write ends, only if this returns Ok.

Optionsconst FOrbdaleTerrainSaveOptions&FOrbdaleTerrainSaveOptions()

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).