Hello Guys....
I try to add some Buildings to the map, server side - but i still dont understand it...
Way 1
https://github.com/Arkensor/DayZCommunityOfflineMode
https://github.com/Arkensor/DayZCommunityOfflineMode/wiki/Add-custom-objects-to-your-server-or-mission
//Spawn helper function
void SpawnObject( string type, vector position, vector orientation )
{
auto obj = GetGame().CreateObject( type, position );
obj.SetPosition( position );
obj.SetOrientation( orientation );
//Force collision update
vector roll = obj.GetOrientation();
roll [ 2 ] = roll [ 2 ] - 1;
obj.SetOrientation( roll );
roll [ 2 ] = roll [ 2 ] + 1;
obj.SetOrientation( roll );
}
//Your custom spawned objects
SpawnObject("Land_Misc_Well_Pump_Yellow", "8680.280508 8.368828 2488.218850", "0.000000 0.000000 0.000000");
SpawnObject("Land_BusStop_City", "8612.080313 8.583845 2463.600586", "64.000008 0.000000 0.000000");
SpawnObject("Land_Misc_Toilet_Mobile", "8613.688811 8.814821 2451.216064", "64.000008 0.000000 0.000000");
This is maybe the best way....but it doesn't really work....because i dont know how to edit the init.c (errors@start)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Way 2
BI add some trees on the map,some days ago with this code....
//-----------------------X-mas
array<vector> treePositions = { "6560.29 0 2462.12",
"1652.66 0 14230.71",
};
Object treeEntity;
for ( int i=0; i < treePositions.Count(); i++ )
{
vector treePos = treePositions[i];
float posY = GetGame().SurfaceY(treePos[0], treePos[2]);
treeEntity = GetGame().CreateObject("ChristmasTree", Vector( treePos[0], posY, treePos[2]), false);
}
}
Looks like a complicated copy paste spam job with different item/building ID´s...
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Way 3.
Object obj;
obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "13211.099609 -0.615631 3355.631592");
obj.SetOrientation("-112.999969 0.000000 0.000000");
obj.SetPosition("13211.099609 -0.615631 3355.631592");
obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "13203.280273 -0.615631 3374.040771");
obj.SetOrientation("-112.999992 0.000000 0.000000");
obj.SetPosition("13203.280273 -0.615631 3374.040771");
obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "13195.469727 -0.615631 3392.459717");
obj.SetOrientation("-112.999992 0.000000 0.000000");
obj.SetPosition("13195.469727 -0.615631 3392.459717");
Its a piece from the Skalisty bridge script....
Should i edit the "way 1 code with commands like "createiobject" and "setposition" ?