3 protected static const ref
TStringArray VALID_PATHS = {
"DZ\\plants",
"DZ\\plants_bliss",
"DZ\\rocks",
"DZ\\rocks_bliss",
"DZ/plants",
"DZ/plants_bliss",
"DZ/rocks",
"DZ/rocks_bliss"};
5 static void SpawnObjects()
10 foreach (
string spawnerFilePath: arr)
12 string path =
"$mission:" + spawnerFilePath;
16 if (JsonFileLoader<ObjectSpawnerJson>.LoadFile(
path, spawner, errorMessage))
31 float scale = item.scale;
35 if (item.name.Contains(
"\\") || item.name.Contains(
"/"))
37 if (ValidatePath(item.name))
38 object =
GetGame().CreateStaticObjectUsingP3D(item.name,
vector.ArrayToVec(item.pos),
vector.ArrayToVec(item.ypr),scale);
44 if (item.enableCEPersistency)
53 object.SetOrientation(
vector.ArrayToVec(item.ypr));
55 object.SetScale(scale);
60 PrintToRPT(
"Object spawner failed to spawn "+item.name);
63 static void OnGameplayDataHandlerLoad()
66 GetGame().GetWorld().ProcessMarkedObjectsForPathgraphUpdate();
70 static bool ValidatePath(
string path)
72 foreach (
string p: VALID_PATHS)
93 bool enableCEPersistency;
101 static string m_Path =
"$mission:myspawndata.json";
103 static void SpawnObjects()
111 if (!JsonFileLoader<ObjectSpawnerJson>.SaveFile(m_Path, j, errorMessage))
115 static void SpawnInit()
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");
123 static void AddSpawnData(
string objectName,
vector position,
vector orientation)
126 obj.name = objectName;
127 obj.pos[0] = position[0];
128 obj.pos[1] = position[1];
129 obj.pos[2] = position[2];
131 obj.ypr[0] = orientation[0];
132 obj.ypr[1] = orientation[1];
133 obj.ypr[2] = orientation[2];