4 "DZ\\plants",
"DZ\\plants_bliss",
"DZ\\plants_sakhal",
5 "DZ\\rocks",
"DZ\\rocks_bliss",
"DZ\\rocks_sakhal",
6 "DZ/plants",
"DZ/plants_bliss",
"DZ/plants_sakhal",
7 "DZ/rocks",
"DZ/rocks_bliss",
"DZ/rocks_sakhal",
16 foreach (
string spawnerFilePath: arr)
18 string path =
"$mission:" + spawnerFilePath;
22 if (JsonFileLoader<ObjectSpawnerJson>.LoadFile(
path, spawner, errorMessage))
37 float scale = item.scale;
41 if (item.name.Contains(
"\\") || item.name.Contains(
"/"))
44 object =
GetGame().CreateStaticObjectUsingP3D(item.name,
vector.ArrayToVec(item.pos),
vector.ArrayToVec(item.ypr),scale);
50 if (item.enableCEPersistency)
52 flags &= ~ECE_DYNAMIC_PERSISTENCY;
53 flags &= ~ECE_NOLIFETIME;
59 object.SetOrientation(
vector.ArrayToVec(item.ypr));
61 object.SetScale(scale);
63 object.OnSpawnByObjectSpawner(item);
68 PrintToRPT(
"Object spawner failed to spawn "+item.name);
76 GetGame().GetWorld().ProcessMarkedObjectsForPathgraphUpdate();
106 bool enableCEPersistency;
115 static string m_Path =
"$mission:myspawndata.json";
117 static void SpawnObjects()
125 if (!JsonFileLoader<ObjectSpawnerJson>.SaveFile(m_Path, j, errorMessage))
129 static void SpawnInit()
131 AddSpawnData(
"Land_Wall_Gate_FenR",
"8406.501953 107.736824 12782.338867",
"0.000000 0.000000 0.000000");
132 AddSpawnData(
"Land_Wall_Gate_FenR",
"8410.501953 107.736824 12782.338867",
"0.000000 0.000000 0.000000");
133 AddSpawnData(
"Land_Wall_Gate_FenR",
"8416.501953 107.736824 12782.338867",
"0.000000 0.000000 0.000000");
134 AddSpawnData(
"Land_Wall_Gate_FenR",
"8422.501953 107.736824 12782.338867",
"0.000000 0.000000 0.000000");
137 static void AddSpawnData(
string objectName,
vector position,
vector orientation)
140 obj.name = objectName;
141 obj.pos[0] = position[0];
142 obj.pos[1] = position[1];
143 obj.pos[2] = position[2];
145 obj.ypr[0] = orientation[0];
146 obj.ypr[1] = orientation[1];
147 obj.ypr[2] = orientation[2];
const int ECE_UPDATEPATHGRAPH
const int ECE_DYNAMIC_PERSISTENCY
const int ECE_CREATEPHYSICS
static void SpawnObject(ITEM_SpawnerObject item)
static bool ValidatePath(string path)
static const ref TStringArray VALID_PATHS
static void OnGameplayDataHandlerLoad()
static void SpawnObjects()
Utility class that converts init.c format type of spawn commands to a json file, fill in the SpawnIni...
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...