Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Sign in to follow this  
Fun Automat

Map modding + init.c

Recommended Posts

Hello Guys...

I take some time and try to add  some objects to the map.

This works fine with the offline editor....   ->>>>>     https://github.com/Arkensor/DayZCommunityOfflineMode

But i dont really understand how i should add the code to the init   ->>>  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 very easy..but i dont get it...

Can someone show me a demo please ?

 

Regards

 

Spoiler

 

Spoiler
Spoiler

 

 

Edited by Fun Automat

Share this post


Link to post
Share on other sites
Sign in to follow this  

×