Jump to content

[RELEASE] Area Maintenance for Player Bases (Script)


Axe Cop

Recommended Posts

yes, well if you remove the menu nobody can activate it, so no area maintenance. :D

but keep in mind that will not deactivate the need to maintain, bases will despawn if you don't disable all other things for natural base "decay", you should know that?

Link to comment
Share on other sites

Question for this default script. I know it default now but for some odd reason it is saying 0 buildings in range? why is this if i havent touched this at all. Does it need to be turned on? Or do i have to wait so many restarts? i used admin tools to spawn in the floors and walls to test it. They are staying after server restart so idk what is going on.  Please help as i need to get this done it irritating me. 

Link to comment
Share on other sites

because, if you have no items that need maintaining, it says 0. only when damage is applied to it, will it say it needs maintaining. if your server doesnt have a do X damage every so many days or whatever via SQL, then you will never have it.

Link to comment
Share on other sites

i have the problem that the maintenance option not works for sandbags, vault, storages, tanktraps,..........

for all walls and floor it works correct.

i have this in my init.sqf

DZE_maintainClasses = ["ModularItems","DZE_Housebase","BuiltItems","Fortifications"];

i tried the classname for all (for exemple: StorageShed_DZ) and it will not work, too.

Link to comment
Share on other sites

  • 2 months later...

Do I need to do anything to get this working with the new Epoch version? I can see maintain area and maintain area preview but it always says 0.

You may need the database events to damage players bases, so they can be maintained. see the Epoch wiki

Link to comment
Share on other sites

  • 2 weeks later...

As you made this Axe Cop, I have a question.

 

My building area is roughly 200m (diameter), radius isnt really a problem as the cost of bigger bases forces players to either NEED the space for large groups to maintain it or they just build sensibly but what I'd like to do is prevent maintenance of objects above a certain height, is this possible?

Link to comment
Share on other sites

so you want to prevent maintenance above a certain high? why I don't get it, sorry :D

then everyone would just build high enough to bypass the maintenance?

it would make more sense if you could maintain your base no matter how high it gets from a single plotpole form the ground, but it doesn't sound like you mean something like that, do you? atm the plot pole area is a sphere around the pole

Link to comment
Share on other sites

not to prevent maintenance, to prevent building :D

well toejam wrote "prevent maintenance of objects above a certain height".. so what is it now? :D

of course you can also limit the building to a certain height, should be easy in the building script of epoch when a player tries to place an object?

Link to comment
Share on other sites

cen put this in your player_build.sqf

 

// disallow building if player is higher than 18m
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
if (((getPosATL _vehicle) select 2) > 18) exitWith {DZE_ActionInProgress = false; cutText ["You cannot build this high.","PLAIN DOWN"];};

 

below 

 

// disallow building if too many objects are found within 30m
if((count ((getPosATL player) nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];};

 

With this script above, remember that Epoch allows for 5m movement up or down.. so this is 23m height restriction, roughly the equivalent of 6.5 walls (each wall is 3.5m tall according to ingame height)

 

What I mean is, I have buildables over the height I want to block (which you can block the building height with that change above) but they will still be maintained due to being within the plotpole radius and I want to make a seperate value for height on maintain.. so after a certain date people cant maintain it and I dont have to go and delete it manually.

 

This way I have building blocked to stop future buildables above a certain height but I want to make it automatic that anything above the height doesnt get maintained when due and gets removed automatically, people have had fair warning on my server that towers are going :)

Link to comment
Share on other sites

yeah I understand now why you want this, it should be possible if you just add another filter to the object list that should be maintained.

see here: https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/actions/maintain_area.sqf#L16

_objects = nearestObjects [_target, _objectClasses, _range];

//filter to only those that have 10% damage
_objects_filtered = [];
{
    if (damage _x >= DZE_DamageBeforeMaint) then {
        _objects_filtered set [count _objects_filtered, _x];
   };
} count _objects;
_objects = _objects_filtered; 

you can add another filter to that code to exclude all objects above a certain height.

e.g. replace the "if" above with this

if ((damage _x >= DZE_DamageBeforeMaint) && (((getPosATL _x) select 2) < _maxHeight)) then {

the second part after && checks that the object is not above your max height "_maxHeight". this should work, not tested but I think it will help you. :)

 

note: I used getPosATL to get the height of the object, that function might not work for bases build over water (some people do that), thee is a special function to get the height above water (getPosASL) but I don't think there is a general function for both ways, "getPos" only gets the position above the object below, so that cannot be used in this case I think.

Link to comment
Share on other sites

Nice will give it a test as I'll have to fiddle with a few things to actually test it!

 

Most of the major towers are now gone from my server and there is a huge gameplay increase already but it would be nice to prevent anyone who thinks they are being sneaky by building over the building limit either by exploiting or other means.

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...