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"};
11 foreach (
string spawner_json: arr)
13 string path =
"$mission:"+spawner_json;
19 JsonFileLoader<ObjectSpawnerJson>.JsonLoadFile(
path, spawner );
38 float scale = item.
scale;
53 flags &= ~ECE_DYNAMIC_PERSISTENCY;
54 flags &= ~ECE_NOLIFETIME;
62 object.SetScale(scale);
108 static string m_Path =
"$mission:MySpawnData.json";
116 JsonFileLoader<ObjectSpawnerJson>.JsonSaveFile(
m_Path, j );
121 AddSpawnData(
"Land_Wall_Gate_FenR",
"8406.501953 107.736824 12782.338867",
"0.000000 0.000000 0.000000" );
122 AddSpawnData(
"Land_Wall_Gate_FenR",
"8410.501953 107.736824 12782.338867",
"0.000000 0.000000 0.000000" );
123 AddSpawnData(
"Land_Wall_Gate_FenR",
"8416.501953 107.736824 12782.338867",
"0.000000 0.000000 0.000000" );
124 AddSpawnData(
"Land_Wall_Gate_FenR",
"8422.501953 107.736824 12782.338867",
"0.000000 0.000000 0.000000" );
130 obj.
name = objectName;
131 obj.
pos[0] = position[0];
132 obj.
pos[1] = position[1];
133 obj.
pos[2] = position[2];
135 obj.
ypr[0] = orientation[0];
136 obj.
ypr[1] = orientation[1];
137 obj.
ypr[2] = orientation[2];
const int ECE_UPDATEPATHGRAPH
const int ECE_DYNAMIC_PERSISTENCY
const int ECE_CREATEPHYSICS
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
proto native Object CreateStaticObjectUsingP3D(string p3dFilename, vector position, vector orientation, float scale=1.0, bool createLocal=false)
proto native World GetWorld()
static TStringArray GetObjectSpawnersArr()
static void OnGameplayDataHandlerLoad()
static void SpawnObjects()
static void SpawnObject(ITEM_SpawnerObject item)
static bool ValidatePath(string path)
static protected const ref TStringArray VALID_PATHS
ref array< ref ITEM_SpawnerObject > Objects
Utility class that converts init.c format type of spawn commands to a json file, fill in the SpawnIni...
static ref array< ref ITEM_SpawnerObject > Objects
static void SpawnObjects()
static void AddSpawnData(string objectName, vector position, vector orientation)
proto native void ProcessMarkedObjectsForPathgraphUpdate()
static vector ArrayToVec(float arr[])
Convert static array of floats into a vector.
proto native CGame GetGame()
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
proto bool FileExist(string name)
Check existence of file.
bool Contains(string sample)
Returns true if sample is substring of string.