DayZ 1.24
Loading...
Searching...
No Matches
SpawnDataConverter Class Reference

Utility class that converts init.c format type of spawn commands to a json file, fill in the SpawnInit() with your data and call SpawnDataConverter.SpawnObjects() through script editor console, result is a json file. More...

Collaboration diagram for SpawnDataConverter:
[legend]

Static Private Member Functions

static void SpawnObjects ()
 
static void SpawnInit ()
 
static void AddSpawnData (string objectName, vector position, vector orientation)
 

Static Private Attributes

static ref array< ref ITEM_SpawnerObjectObjects = new array<ref ITEM_SpawnerObject>
 
static string m_Path = "$mission:myspawndata.json"
 

Detailed Description

Utility class that converts init.c format type of spawn commands to a json file, fill in the SpawnInit() with your data and call SpawnDataConverter.SpawnObjects() through script editor console, result is a json file.

Definition at line 98 of file ObjectSpawner.c.

Member Function Documentation

◆ AddSpawnData()

static void SpawnDataConverter::AddSpawnData ( string objectName,
vector position,
vector orientation )
inlinestaticprivate

Definition at line 123 of file ObjectSpawner.c.

124 {
126 obj.name = objectName;
127 obj.pos[0] = position[0];
128 obj.pos[1] = position[1];
129 obj.pos[2] = position[2];
130
131 obj.ypr[0] = orientation[0];
132 obj.ypr[1] = orientation[1];
133 obj.ypr[2] = orientation[2];
134
135 Objects.Insert(obj);
136 }
static ref array< ref ITEM_SpawnerObject > Objects

References ITEM_SpawnerObject::name, Objects, ITEM_SpawnerObject::pos, and ITEM_SpawnerObject::ypr.

Referenced by SpawnInit().

◆ SpawnInit()

static void SpawnDataConverter::SpawnInit ( )
inlinestaticprivate

Definition at line 115 of file ObjectSpawner.c.

116 {
117 AddSpawnData("Land_Wall_Gate_FenR", "8406.501953 107.736824 12782.338867", "0.000000 0.000000 0.000000");
118 AddSpawnData("Land_Wall_Gate_FenR", "8410.501953 107.736824 12782.338867", "0.000000 0.000000 0.000000");
119 AddSpawnData("Land_Wall_Gate_FenR", "8416.501953 107.736824 12782.338867", "0.000000 0.000000 0.000000");
120 AddSpawnData("Land_Wall_Gate_FenR", "8422.501953 107.736824 12782.338867", "0.000000 0.000000 0.000000");
121 }
static void AddSpawnData(string objectName, vector position, vector orientation)

References AddSpawnData().

Referenced by SpawnObjects().

◆ SpawnObjects()

static void SpawnDataConverter::SpawnObjects ( )
inlinestaticprivate

Definition at line 103 of file ObjectSpawner.c.

104 {
105 Objects.Clear();
106 SpawnInit();
108 j.Objects = Objects;
109
110 string errorMessage;
113 }
static string m_Path
static void SpawnInit()
enum ShapeType ErrorEx

References ErrorEx, m_Path, Objects, and SpawnInit().

Member Data Documentation

◆ m_Path

string SpawnDataConverter::m_Path = "$mission:myspawndata.json"
staticprivate

Definition at line 101 of file ObjectSpawner.c.

Referenced by SpawnObjects().

◆ Objects

ref array<ref ITEM_SpawnerObject> SpawnDataConverter::Objects = new array<ref ITEM_SpawnerObject>
staticprivate

Definition at line 100 of file ObjectSpawner.c.

Referenced by AddSpawnData(), and SpawnObjects().


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