DayZ mod inspired crash sites for DayZ standalone
init.c
- Include
CrashSite.c
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\CrashSite\\CrashSite.c"
- Create a member variable for the crashsite spawner.
class CustomMission : MissionServer
{
ref CrashSite m_crashSiteSpawner;
// ...
- Create the instance in the OnInit method in your implementation of
MissionServer
. Spawn the crash sites.
class CustomMission : MissionServer
{
override void OnInit()
{
m_crashSiteSpawner = new CrashSite();
m_crashSiteSpawner.SpawnCrashSites();
}
// ...
- Implement this to the OnUpdate method in your implementation of
MissionServer
.
override void OnUpdate(float timeslice) {
super.OnUpdate( timeslice );
m_crashSiteSpawner.PollCrashSite();
}
- Done.
There are arrays of crash site positions and loot tables in the CrashSite.c
file. You can modify those to your own liking.
- The crash sites are not deleted on server restart, so the server might spawn new crash sites on top of the old ones. If you know a way to create objects without them being saved on restart, make a PR or let me know!