Jump to content
  • 0

Indestructible buildings for militarized servers?


_Lance_

Question

Has anyone ever seen a script for, or know how to go about making all in-game structures indestructible? Problem I'm having is players get too rowdy in jets sometimes and will wreck a loot area and it's wrecked until next restart. I want them to have their fun but not ruin other's fun (too much) - Any ideas?

Link to comment
Share on other sites

23 answers to this question

Recommended Posts

  • 0

 try use this code

server_house_noDam.sqf

  Reveal hidden contents

init.sqf

  Reveal hidden contents

 

 

Link to comment
Share on other sites

  • 0

Sorry I thought I had turned on notifications - would this could affect all in-game buildings and nothing else? Say if I set the coordinates to stary sobor and made the damage radius/ratio 20km (hope I'm reading the code correctly) that would only affect buildings in that radius and no other objects right? 

Link to comment
Share on other sites

  • 0
  On 7/20/2017 at 5:01 AM, _Lance_ said:

Sorry I thought I had turned on notifications - would this could affect all in-game buildings and nothing else? Say if I set the coordinates to stary sobor and made the damage radius/ratio 20km (hope I'm reading the code correctly) that would only affect buildings in that radius and no other objects right? 

Expand  

yes, i use this code for damage "HouseBase" in a X ratio from X coords... not for not allow damage.. but you can try.

 

  Quote

Say if I set the coordinates to stary sobor and made the damage radius/ratio 20km

Expand  

Note that 20 is meters not Km.   20Km should be 20.000.

For example: Map houses do not take damage in a ratio of 800mts around stary trader.

_target = [6325,7807,0];//stary trader coord
_nodamage_ratio=800;

_server_houses= _target nearObjects ["HouseBase", _nodamage_ratio];
{
_x addEventHandler ["handleDamage", {false}];
} forEach _server_houses;

 

Link to comment
Share on other sites

  • 0

Yes you made it clear thanks I appreciate that :D 

I set it like this:

 

_target = [6326,7808,0]; //use a center coord
_nodamage_ratio=25000;

 

Which will hopefully make all houses on the map indestructible. I'm testing tonight at downtime, about 3.5 hours from now. I'll report back and let you know how it went, thanks a ton man I appreciate it.

 

Link to comment
Share on other sites

  • 0
  On 7/21/2017 at 1:22 AM, _Lance_ said:

Yes you made it clear thanks I appreciate that :D 

I set it like this:

 

_target = [6326,7808,0]; //use a center coord
_nodamage_ratio=25000;

 

Which will hopefully make all houses on the map indestructible. I'm testing tonight at downtime, about 3.5 hours from now. I'll report back and let you know how it went, thanks a ton man I appreciate it.

 

Expand  

If u wanna made all maps build indestructibles.. i think the center coord iS 0,0,0.. for each map or maybe

'center'
_target = 'center';
_nodamage_ratio=20000;

_server_houses= _target nearObjects ["HouseBase", _nodamage_ratio];
{
_x addEventHandler ["handleDamage", {false}];
} forEach _server_houses;

 

Link to comment
Share on other sites

  • 0

If you follow this example from @ebayShopper's Test kit: https://github.com/ebayShopper/TestKit/blob/2d9703d3d88a27715c0a7eecb06921aa98551581/testkit/ui/tk_mark.sqf#L2-L3

This code works (tested):

#define CENTER getMarkerPos "center"
#define RADIUS ((getMarkerSize "center") select 1)*2

_server_houses = CENTER nearObjects ["HouseBase",RADIUS];
{
	_x addEventHandler ["handleDamage", {false}];

} forEach _server_houses;

 

Link to comment
Share on other sites

  • 0

I fell asleep before getting to test the initial code - I'll look into this today and I have all weekend to test. Salival I'm looking at that code you provided and having trouble seeing where to edit the radius, do I replace some of that with coordinates and a radius value or is it already set to affect the whole map? I'm not sure what the select 1)*2 does..

Link to comment
Share on other sites

  • 0
  On 7/21/2017 at 12:17 PM, _Lance_ said:

I fell asleep before getting to test the initial code - I'll look into this today and I have all weekend to test. Salival I'm looking at that code you provided and having trouble seeing where to edit the radius, do I replace some of that with coordinates and a radius value or is it already set to affect the whole map? I'm not sure what the select 1)*2 does..

Expand  

Well you don't edit the radius, it does it for you based off the center marker so it's map independent.

Link to comment
Share on other sites

  • 0
  On 7/21/2017 at 12:46 PM, salival said:

Well you don't edit the radius, it does it for you based off the center marker so it's map independent.

Expand  

Ok I was kind of thinking that's what I was seeing but couldn't be 100% w/o asking. I'm still learning all this (almost one year since I started messing with dayz servers now) some code I can look at and pretty clearly see what it does, other code not so much. Thanks for clearing that up for me, I'll give it a spin tonight and test it out, thanks to both of you for the assistance I really appreciate it.

Link to comment
Share on other sites

  • 0

Ok both scripts worked 110% - I figured as much but I wanted to make sure Juan's was working as well since the other had already been proven working. It's pretty cool, can't even blow up a shed now which is what I wanted, now the jet guys can go nuts and not ruin loot areas below until a reboot.

I also want to test something this weekend, it looks like I could take Juan's script and make multiple god mode structure spots pretty much anywhere, so I want to see if I can god mode all the structures at all the trader areas for a test. You guys should post these in the mods section for sure, there's bound to be others with mili servers that want to protect loot buildings - anways thanks again guys you freakin' rock!

Link to comment
Share on other sites

  • 0
  On 7/21/2017 at 10:47 PM, _Lance_ said:

Ok both scripts worked 110% - I figured as much but I wanted to make sure Juan's was working as well since the other had already been proven working. It's pretty cool, can't even blow up a shed now which is what I wanted, now the jet guys can go nuts and not ruin loot areas below until a reboot.

I also want to test something this weekend, it looks like I could take Juan's script and make multiple god mode structure spots pretty much anywhere, so I want to see if I can god mode all the structures at all the trader areas for a test. You guys should post these in the mods section for sure, there's bound to be others with mili servers that want to protect loot buildings - anways thanks again guys you freakin' rock!

Expand  

Providing you have your DZE_safeZonePosArray set up correctly, you could use this code to loop all safe zones and set the houses inside that safezone as indestructible using this code (tested):

{
	_server_houses = (_x select 0) nearObjects ["HouseBase",_x select 1];
	{
		_x addEventHandler ["handleDamage", {false}];
	} forEach _server_houses;
} forEach DZE_SafeZonePosArray;

_x select 0 is the location in x,y,z format

_x select 1 is the radius of the safe zone

https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/configVariables.sqf#L28

Link to comment
Share on other sites

  • 0

So basically fit this:  _x addEventHandler ["handleDamage", {false}];

 

Somewhere into this?

  Reveal hidden contents
Link to comment
Share on other sites

  • 0

@_Lance_: Add it after this line: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_server/system/server_monitor.sqf#L504

So it looks like:

		{
			if (isClass (_cfgLootFile >> typeOf _x)) then {
				_buildingList set [count _buildingList,_x];
				_x addEventHandler ["handleDamage", {false}];
 			};
		} count (getMarkerPos "center" nearObjects ["building",((getMarkerSize "center") select 1)]);

 

Link to comment
Share on other sites

  • 0

Ok will try this today - you guys are incredible by the way lol - This would make the server load all buildings/houses as invincible during boot/loading and then be done with it right? - I like! I will try this out today. I'm also attempting to update the skins/items in the "skalisty island AI" (This one) mod today and test-loading that in about an hour so I'll try this out at the same time and report back, thanks again you guys I'm really glad I asked if this was possible, you guys knocked it out of the park.

 

Link to comment
Share on other sites

  • 0

I was hung at "waiting for server to start authentication" for quite a while (maybe 60s) and then it finally kicked through and started the hive/sql part of the logon process. This could be due to my "adaptation" of the skalisty AI mod loading as well though, I may have more to update etc, I'll take a close look at the RPT and update as soon as I have more info.

UPDATE: I was wrong, Invincible houses isn't working using the server monitor way of doing it, do I still need the other script running mission side? I'd removed it to try this method. Here's the edited server monitor:

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

Makes sense now. So would applying the damagehandler within the init.sqf (if that's what you meant) be any less strain on the server than the way I'm doing it now? For now I've gone back to the mission-side script - I just have a call at the bottom of init.sqf that points to this script in the "custom" folder in my mission root. Here it is:

  Reveal hidden contents

and it seems to be working fine but yes I'd like to do whatever will be the least amount of strain on the server if possible. Thanks for posting ebay.

Link to comment
Share on other sites

  • 0

An update for anyone that uses this. And a question - I've been using this:

{
	_server_houses = (_x select 0) nearObjects ["HouseBase",_x select 1];
	{
		_x addEventHandler ["handleDamage", {false}];
	} forEach _server_houses;
} forEach DZE_SafeZonePosArray;

with my DZE_SafeZonePosArray:

[[[6325.6772,7807.7412,0],150],[[4063.4226,11664.19,0],150],[[11447.472,11364.504,0],150],[[1606.6443,7803.5156,0],150],[[12944.227,12766.889,0],150],[[12062.4,12639.2,0],150]]; 

to make only the trader zones have invincible buildings. - I noticed when I tried to make the whole balota airstrip invincible that large areas don't seem to work. Like if I set the diameter to be 150m it works but if it's 700m it doesn't work - am I seeing a bug or is that by design once you go over a certain distance? 

Link to comment
Share on other sites

  • 0
  On 8/6/2017 at 8:34 AM, _Lance_ said:

An update for anyone that uses this. And a question - I've been using this:

{
	_server_houses = (_x select 0) nearObjects ["HouseBase",_x select 1];
	{
		_x addEventHandler ["handleDamage", {false}];
	} forEach _server_houses;
} forEach DZE_SafeZonePosArray;

with my DZE_SafeZonePosArray:

[[[6325.6772,7807.7412,0],150],[[4063.4226,11664.19,0],150],[[11447.472,11364.504,0],150],[[1606.6443,7803.5156,0],150],[[12944.227,12766.889,0],150],[[12062.4,12639.2,0],150]]; 

to make only the trader zones have invincible buildings. - I noticed when I tried to make the whole balota airstrip invincible that large areas don't seem to work. Like if I set the diameter to be 150m it works but if it's 700m it doesn't work - am I seeing a bug or is that by design once you go over a certain distance? 

Expand  

There should be no difference between 150 or 700 meter radius, it should work no problem. You could do 3000 and it would still work.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...