Jump to content
mrwolv

Dayz map mod

Recommended Posts

would anyone know how to add building or edit the dayz map i know it can be done as ive seen it but im unsure how to thanks

Share this post


Link to post
Share on other sites
1 hour ago, mrwolv said:

would anyone know how to add building or edit the dayz map i know it can be done as ive seen it but im unsure how to thanks

You could try this 

vector spawnPos = "x y z"; GetGame().CreateObject( "buidling name", spawnPos, false );

Add it to the init.c

 

 

Share this post


Link to post
Share on other sites
7 hours ago, Aussie Cleetus said:

There are rotation functions too. Because not all houses face the same way

For this you got the "x y z" posotions (dont know it now exactly which for what but its 'up,down' 'left,right' 'rotation' from the perspective if you look at the map    just try it "learning by doing ;) )

 

Greetz Gondalf

Share this post


Link to post
Share on other sites
8 hours ago, XxFri3ndlyxX said:

You could try this 


vector spawnPos = "x y z"; GetGame().CreateObject( "buidling name", spawnPos, false );

Add it to the init.c

 

 

this dosent seem to work it just throws errors up on server start  http://prntscr.com/l4t928

Edited by mrwolv

Share this post


Link to post
Share on other sites
29 minutes ago, mrwolv said:

this dosent seem to work it just throws errors up on server start  http://prntscr.com/l4t928

Sorry i'm very new to this. I am trying to learn 

But do it like this.

void main()
{

	Hive ce = CreateHive();
	if ( ce )
		ce.InitOffline();

	Weather weather = g_Game.GetWeather();

	weather.GetOvercast().SetLimits( 0.0 , 1.0 );
	weather.GetRain().SetLimits( 0.0 , 1.0 );
	weather.GetFog().SetLimits( 0.0 , 1.0 );

	weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.2 );
	weather.GetRain().SetForecastChangeLimits( 0.0, 0.1 );
	weather.GetFog().SetForecastChangeLimits( 0.15, 0.45 );

	weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
	weather.GetRain().SetForecastTimeLimits( 600 , 600 );
	weather.GetFog().SetForecastTimeLimits( 1800 , 1800 );

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.3), 0, 0);
	weather.GetRain().Set( Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
	
	weather.SetWindMaximumSpeed(15);
	weather.SetWindFunctionParams(0.1, 0.3, 50);
	
	vector spawnPos = "10719 6.7829 2450.65";
	GetGame().CreateObject( "Land_Wreck_Volha_Grey", spawnPos, false );
}

So i added the code with the weather and this will work. I tried it and worked. As for the rotation i'll check later to see how this works but right now it's school time.

Youll have to tweak the z to make it higher cause it will sunk if you use the exact same z as the debug. Good luck have fun

Edited by XxFri3ndlyxX

Share this post


Link to post
Share on other sites
4 minutes ago, XxFri3ndlyxX said:

Sorry i'm very new to this. I am trying to learn 

But do it like this.


void main()
{

	Hive ce = CreateHive();
	if ( ce )
		ce.InitOffline();

	Weather weather = g_Game.GetWeather();

	weather.GetOvercast().SetLimits( 0.0 , 1.0 );
	weather.GetRain().SetLimits( 0.0 , 1.0 );
	weather.GetFog().SetLimits( 0.0 , 1.0 );

	weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.2 );
	weather.GetRain().SetForecastChangeLimits( 0.0, 0.1 );
	weather.GetFog().SetForecastChangeLimits( 0.15, 0.45 );

	weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
	weather.GetRain().SetForecastTimeLimits( 600 , 600 );
	weather.GetFog().SetForecastTimeLimits( 1800 , 1800 );

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.3), 0, 0);
	weather.GetRain().Set( Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
	
	weather.SetWindMaximumSpeed(15);
	weather.SetWindFunctionParams(0.1, 0.3, 50);
	
	vector spawnPos = "10719 6.7829 2450.65";
	GetGame().CreateObject( "Land_Wreck_Volha_Grey", spawnPos, false );
}

So i added the code with the weather and this will work. I tried it and worked. As for the rotation i'll check later to see how this works but right now it's school time.

ahh that worked so how to i control the height of the item ?

Share this post


Link to post
Share on other sites
1 minute ago, mrwolv said:

ahh that worked so how to i control the height of the item ?

Youll have to tweak the z to make it higher cause it will sunk if you use the exact same z as the debug. Good luck have fun

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, XxFri3ndlyxX said:

Youll have to tweak the z to make it higher cause it will sunk if you use the exact same z as the debug. Good luck have fun

last question where are you finding your building names/item names for the map

also if i try to add this more than 1 time it wont work is there a way to declare multy objects or a map editor i can use to place building down to get the correct cords

 

vector spawnPos = "10719 6.7829 2450.65";

GetGame().CreateObject( "Land_Wreck_Volha_Grey", spawnPos, false );

Edited by mrwolv

Share this post


Link to post
Share on other sites

For the building it was in one of the xml file in your mission file. I'm not home as i'm at school so i dont have server files on my laptop. 

Humm as for more than one. i haven't tested it. 

I thought that if they were a space between them would work. 

vector spawnPos = "x y z";

GetGame().CreateObject( "building", spawnPos, false );


vector spawnPos = "x y z";

GetGame().CreateObject( "anotherbuilding", spawnPos, false );

I will have a look when im back home. You could check http://lystic.net/dayzwiki/  This site is an enforce script API and this is how i find piece of code and make it work. Very useful.

Share this post


Link to post
Share on other sites

So I can get a building to spawn, but there is not loot in it. I also can use thisline of code once.

 

vector spawnPos = "10719 6.7829 2450.65";

GetGame().CreateObject( "Land_Wreck_Volha_Grey", spawnPos, false );

 

I spawned in something totally different, but It says there is a error with spawnPos used to many times if I use it more than once.

Share this post


Link to post
Share on other sites
5 hours ago, Clint Baldwin said:

So I can get a building to spawn, but there is not loot in it. I also can use thisline of code once.

 

vector spawnPos = "10719 6.7829 2450.65";

GetGame().CreateObject( "Land_Wreck_Volha_Grey", spawnPos, false );

 

I spawned in something totally different, but It says there is a error with spawnPos used to many times if I use it more than once.

that's because in all programming in the history of programming, you cannot have 2 variables with the same name without major consequences.

 

The easiest way to do multiples with above statement is to remove the vector spawnPos and manually add those into the CreateObject method, though that might get tedious.

Bouncing an idea here:

// THIS IS A THEORY, UNTESTED AND MAY NOT WORK.

Object[] myBuildings;

void CustomSpawnBuilding(string buildingName, vector buildingLocation, vector buildingRotation, int index) {
    myBuildings[index] = GetGame().CreateObject(buildingName, buildingLocation, false);
    myBuildings[index].SetRotation(buildingRotation);
}

// Usage:
// CustomSpawnBuilding("Land_Wreck_Volha_Grey", "10719 6.7829 2450.65", "14.6 0 0", 0);
// CustomSpawnBuilding("Land_Wreck_Volha_Grey", "10719 6.7829 2450.65", "41.2 0 0", 1);
// CustomSpawnBuilding("Land_Wreck_Volha_Grey", "10719 6.7829 2450.65", "12.3 0 0", 2);
// CustomSpawnBuilding("Land_Wreck_Volha_Grey", "10719 6.7829 2450.65", "2.2 0 0", 3);
// CustomSpawnBuilding("Land_Wreck_Volha_Grey", "10719 6.7829 2450.65", "10.9 0 0", 4);

 

Edited by Aussie Cleetus

Share this post


Link to post
Share on other sites

I will try this tonight! Any reason loot might not be spawning in the building. I am sure I have to adjust some other file.

Share this post


Link to post
Share on other sites

You have to add the building to the mapgrouppos.xml with the same position. then you should have loot spawning in there.

Share this post


Link to post
Share on other sites

<group name="Land_Misc_FeedShack" pos="647.718506 71.955666 2313.115723" rpy="-0.000000 0.000000 39.351330" a="50.648666" />

I have no clue what rpy = or A=?

Share this post


Link to post
Share on other sites

the a might stand for angle
like the building spawns pointing north so you can adjust the angle to fit for you?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×