DAYZ| Community Offline Mode| Part 2| Adding The Objects Into Your Server

Subscribers:
1,640
Published on ● Video Link: https://www.youtube.com/watch?v=dxGKuNODbmI



Duration: 19:37
6,042 views
66


Command line to add items for spawning - //GetCEApi().ExportProxyData( "7500 0 7500", 10000 ); //Center of map, radius of how far to go out and find buildings.

Use this helper function- dont use what offline mode gives you

void SpawnObject(string objectName, vector position, vector orientation)
{
Object obj;
obj = Object.Cast(GetGame().CreateObject(objectName, "0 0 0"));
obj.SetPosition(position);
obj.SetOrientation(orientation);

// Force update collisions
if (obj.CanAffectPathgraph())
{
obj.SetAffectPathgraph(true, false);
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj);
}
}

Rememeber to remove the 2 // from command line when first adding it into your server init.c to get the mapgrouppos.xml file from your export folder but add it back after you have copied the file.