Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_WorldFilesHelper Interface Reference

Static Public Member Functions

static string CreateWorld (string relativeWorldDirectory, string worldName, array< ResourceName > defaultLayerEntities=null, bool overwriteWorldFile=false, bool overwriteDefaultLayerFile=false)
 Create a world and registers it through Resource Manager.
 
static bool DuplicateWorld (string absoluteSourceFilePath, string absoluteDestinationFilePath)
 Create a copy of the provided world's directory.
 
static bool ReplaceWorldEntity (string relativeWorldFilePath, ResourceName newWorldEntityPrefab)
 Replaces the current WorldEntity (GenericWorldEntity or Prefab) by the provided Prefab.
 

Static Protected Member Functions

static void ReRegisterMetaFiles (notnull ResourceManager resourceManager, string dir)
 
static string GetDefaultLayerAbsoluteFilePath (string relativeWorldFilePath)
 Get the absolute path to the default layer (worldDir/worldName_Layers/default.layer)
 

Static Protected Attributes

static const string GENERIC_WORLD_ENTITY_CLASS = "GenericWorldEntity"
 
static const string LAYERS_DIR = "%1_Layers"
 
static const string DEFAULT_LAYER = "default.layer"
 
static const ref array< string > COPY_SUB_DIRECTORIES = { ".Rivers", ".Shore", "SurfaceMasks", "Terrain", "%1", LAYERS_DIR }
 
static const ref array< string > COPY_DIR_FILES = { "%1.ent", "%1.smap", "%1.smd", "%1.topo", "%1_SMD.conf" }
 
static const ref array< bool > COPY_DIR_FILES_REGISTER = { 1, 1, 0, 1, 1 }
 

Member Function Documentation

◆ CreateWorld()

static string SCR_WorldFilesHelper.CreateWorld ( string relativeWorldDirectory,
string worldName,
array< ResourceName > defaultLayerEntities = null,
bool overwriteWorldFile = false,
bool overwriteDefaultLayerFile = false )
static

Create a world and registers it through Resource Manager.

Parameters
[in]relativeWorldDirectoryaddon-prefixed path
[in]worldNamecreated files will be based on this name
[in]defaultLayerEntitiesentities to be created in the default layer - if no GenericWorldEntity Prefab is provided, a default one will be created
[in]overwriteWorldFileif set to true, deletes and rewrites world file if it exists
[in]overwriteDefaultLayerFileif set to true, deletes and rewrites default layer file if it exists
Returns
addon-prefixed world .ent RELATIVE file path on success, empty string on failure

◆ DuplicateWorld()

static bool SCR_WorldFilesHelper.DuplicateWorld ( string absoluteSourceFilePath,
string absoluteDestinationFilePath )
static

Create a copy of the provided world's directory.

Parameters
[in]absoluteSourceFilePathabsolute source world ent file path
[in]absoluteDestinationFilePathabsolute destination world ent file path
Returns
true on success, false otherwise

◆ GetDefaultLayerAbsoluteFilePath()

static string SCR_WorldFilesHelper.GetDefaultLayerAbsoluteFilePath ( string relativeWorldFilePath)
staticprotected

Get the absolute path to the default layer (worldDir/worldName_Layers/default.layer)

Parameters
[in]relativeWorldFilePathaddon-prefixed .ent file path in which to replace the GenericWorldEntity
Returns
path to the default layer or empty string on error

◆ ReplaceWorldEntity()

static bool SCR_WorldFilesHelper.ReplaceWorldEntity ( string relativeWorldFilePath,
ResourceName newWorldEntityPrefab )
static

Replaces the current WorldEntity (GenericWorldEntity or Prefab) by the provided Prefab.

Parameters
[in]relativeWorldFilePathaddon-prefixed .ent file path in which to replace the GenericWorldEntity
[in]newWorldEntityPrefabthe new WorldEntity Prefab; if empty, default GenericWorldEntity is be used
Returns
true on success, false otherwise

◆ ReRegisterMetaFiles()

static void SCR_WorldFilesHelper.ReRegisterMetaFiles ( notnull ResourceManager resourceManager,
string dir )
staticprotected

Member Data Documentation

◆ COPY_DIR_FILES

const ref array<string> SCR_WorldFilesHelper.COPY_DIR_FILES = { "%1.ent", "%1.smap", "%1.smd", "%1.topo", "%1_SMD.conf" }
staticprotected

◆ COPY_DIR_FILES_REGISTER

const ref array<bool> SCR_WorldFilesHelper.COPY_DIR_FILES_REGISTER = { 1, 1, 0, 1, 1 }
staticprotected

◆ COPY_SUB_DIRECTORIES

const ref array<string> SCR_WorldFilesHelper.COPY_SUB_DIRECTORIES = { ".Rivers", ".Shore", "SurfaceMasks", "Terrain", "%1", LAYERS_DIR }
staticprotected

◆ DEFAULT_LAYER

const string SCR_WorldFilesHelper.DEFAULT_LAYER = "default.layer"
staticprotected

◆ GENERIC_WORLD_ENTITY_CLASS

const string SCR_WorldFilesHelper.GENERIC_WORLD_ENTITY_CLASS = "GenericWorldEntity"
staticprotected

◆ LAYERS_DIR

const string SCR_WorldFilesHelper.LAYERS_DIR = "%1_Layers"
staticprotected

The documentation for this interface was generated from the following file: