Safe Bases - Almost Complete

TorZar

New Member
Ok.. What I wanted to accomplish is 98% complete.. All seems to be working as intended except for one part.. Which is driving me crazy now.

The Idea: Player/Groups have a base/camp to store their gear or vehicles.. pvp and gear loss is an option anywhere outside of these areas. So far completed and working: Only selected players are allowed in designated area.. while inside your small area you have temporary 'god-mode' and a slight repair to a few damages you may have upon entry. (working on disabling firing from inside base). Any other survivors with/without a vehicle entering the area will be givin a warning and then teleported to just outside the safe zone. Air vehicles are calculated in so they do not crash and are only detected within a vertical range so not to trigger as passing over.

The problem: We need vehicles inside this area to be immune to damage of all kinds.. whether a player is present or not. I don't know if its the route i need to take but the vehicle damage handlers seem to be listed as such:

Code:
vehicle_handleDamage    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
vehicle_handleKilled    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";

I've tried disabling/enabling vehicle damage handler in my own manner. Through script and through triggers. I may have just formatted incorrectly, not sure at this point. If anybody has any info on any ways to do this WITHOUT a loop i would greatly appreciate any info. Anything at all to point in a direction i haven't tried or flip that switch in my head that says "why didn't i think of that"..
 
Very interested. This is literally something we've been looking for; for our FactionZ game mode.

We have Factions of 2-6 (depending) and each are given a zone/area for their items/vehicles that cannot be touched by other Factions. We need a way to allow for people to shoot out of their own Faction Area but disallow them to take any damage while inside... also; disallowing non-faction members the ability to steal/use anything in a Faction Safe Zone.

Sooooo you've got me interested... though I doubt I can help much.
 
Very interested. This is literally something we've been looking for; for our FactionZ game mode.

We have Factions of 2-6 (depending) and each are given a zone/area for their items/vehicles that cannot be touched by other Factions. We need a way to allow for people to shoot out of their own Faction Area but disallow them to take any damage while inside... also; disallowing non-faction members the ability to steal/use anything in a Faction Safe Zone.

Sooooo you've got me interested... though I doubt I can help much.

everything you specified there is currently what it is doing.. they can still shoot from inside the safe area. I'm still battling in my head whether that should be allowed in our situation atm.. And the warning, teleporting outside of the safe zone is fully functional. players currently take no damage while inside. I'm only missing the vehicles immune to damage feature. once that is takin care of I don't mind releasing + info needed to setup.
 
Outstanding TorZar.

In our situation we need players able to shoot out of their base (to stop/prevent base camping) but no shots go in; as you stated. I'm curious how you're assigning players to their particular safe zone; as a person that would use what you're creating. Just an assignment in the DB once they log into the server?

You would certainly be given full credit if we were able to use this as well and appreciate the work and sharing of your endeavor.
 
As of right now it checks a list of UID's per safe zone. So some small amounts of manual labor involved on that part adding them in to get started. If anyone willing to improve the system and add DB integration that's always a bonus. But at this point I just wanted something functional

EDIT: this would be more for common individuals that are regular to the server. After some time establishing a safe area. (was the original intent on the design)
 
Can someone share with me just how to make the areas that are only enter-able by specific players? I've looked all over for something like this, and I simply cannot find it.

I'd also like to make lockable gates instead, but I'm not interested in all the base building stuff.
 
yes it can. to an extent without some of the features i needed. for a price and with compatibility for only specific servers. i needed something a little more versatile.
 
thesilentwarrior antihack program. probably the best anti hack program I have used to date.

Also do you plan on releasing this to the public at all? I am really interested in this since if tsw crashes for me and im not around, the base is completely vulnerable. Is this server side or a program that runs and just connects to the DB?
 
Its completely server side. Once I finish this last part of making the vehicles immune to damage inside the bases i'll be glad to release and give needed info. Just been trying to get that last little bit before i actually do a code cleanup and move some of the files around to work more efficiently. I've got a couple more tricks to try tomorrow to see if i can get that part working if there's not anybody around that could throw a few hints in the right direction.
 
yes it can. to an extent without some of the features i needed. for a price and with compatibility for only specific servers. i needed something a little more versatile.

You can make a dome that only certain GUID can enter. Or certain Humanity if you like.
 
TY, and you are very correct.. DayZ was not designed for many of the things available these dayz.. BUT.. You throw a game like this out with unlimited possibilities into the hands of guys like us where your imagination and coding abilities are the only thing stopping you.. We will manage to tweak it to our own liking.. We tend to draw a specific or unique crowd that is looking for somethin different to our servers and get our dedicated members that stick around for quite some time. It's most definitely not vanilla DayZ, but rather a few things added that people getting bored with vanilla are seeking.
 
The idea of having zones is cool, I'd personally want a zone for deeply negative and positive humanity levels, but remove the immunities or something. Either way - I'm interested.
 
Ok.. an update to try and completely explain specifically where i'm stuck as to possibly draw some answers.. I rambled on to a friend in skype that doesn't really know wth i'm talking about but is willing to listen and give ideas to make me think differently about it.. And mainly so i could actually type out the problem and possibly catch it just by exposing it all at once.. talk myself through it maybe. I'll just copy/paste my ramblings about how I THINK it works and what the prob is.. that also has bits of code involving where i'm stuck.. I know somebody out there has the right noob stick to slap me with.. i'm sure its simple..

TorZar: I've narrowed it down to what i'm doing wrong or assume what is goin wrong.... its just figuring out the exact syntax to make the script that the trigger calls know that i'm talking about the vehicle that entered the trigger

TorZar: this removes all damage handling from a vehicle and makes it immune

TorZar:
Code:
private ["_this", "_vehic"];
_vehic = _this select 2;
player globalChat format["Attempting to remove vehicle immunity from.. %1", _vehic];
_vehic removeEventHandler ["Killed", 0];
_vehic removeEventHandler ["HandleDamage", 0];
_vehic allowDamage false;
TorZar: and this turns it back on:

TorZar:
Code:
private ["_this", "_vehic"];
_vehic = _this select 2;
player globalChat format["Attempting vehicle immunity on.. %1", _vehic];
_vehic addEventHandler ["Killed", { _this call vehicle_handleKilled }];
_vehic addEventHandler ["HandleDamage", { _this call vehicle_handleDamage }];
_vehic allowDamage true;
[WALL-OF-TEXT VICTOM]: what if u make it where anyone near makes it immune...

TorZar: the problem is assigning "_vehic" to the specific vehicle that actually entered the trigger.. (one sec on what u mentioned as its deff an idea)

TorZar: heres the part of the trigger that says "ok.. a vehicle entered my area.. i'm firing your script"

TorZar:
Code:
_BaseTrigger1 setTriggerStatements["{_x iskindof 'LandVehicle' || _x isKindOf 'air'} count thislist > 0","nul=[_this] execVM 'scripts\TorZar_Security\vehicIn.sqf';","nul=[_this] execVM 'scripts\TorZar_Security\vehicOut.sqf';"];
TorZar: the "[_this] execVM" is supposed to send the result of the trigger to the script that is being executed

TorZar: my problem is i don't know how to pull the vehicle name (or that specific object) out of the array "_this" (if thats the part i'm screwing up) that is sent to it.. i know HOW to select each individual parameter within the array.. inside the called script it goes "_vehic = _this select 0'" (or 1 or 2 or 3.. whichever variable you're looking for) i've tried 0 and 1 so far.. which i assumed should have been the culprit.. but no luck

I tried some debug output to globalChat and got back the _vehic being "ANY" and not a specific object.. idk if i have to narrow that down even more once i've got it selected correctly or what. I'm sure i'm just using the passed over variables wrong or just passing them over incorrectly in the first place.. but not 100%

I am sure though that the add/remove damage handlers scripts are correct as i was able to switch them off/on locally using cursorTarget to set the object for a quick test on a Hummer.. I could not personally destroy the vehicle by any normal means. Being local, another easily damaged with small arms fire.

Yes, the full script package is being run server-side on the test server. (currently through mission file to be run separately on clients. but will move to be executed by server when complete)

Back to testing. looking forward to replies. Thnx!
 
man i wish I could help you figure it out but have absolutely no clue of anything you need an answer for.
What about if we dont need it to protect the vehicles from damage? does this work fine like that? also is the barrier able to be increased/decreased in size?

I am for sure following this right now and eager for its release.
 
Yes, for the original design and the needs of our server and the whole purpose of the project to begin with. I would like this to function as intended. But of course can be modified for personal needs once finished and released. And Ya, it can all be adjusted easily within the script. Just a matter of changing the size value.

BUT .. Good news.. we're officially at 99% Working!

The following now removes possibility of vehicles being damaged once it enters the secured area..

Code:
_BaseTrigger1 setTriggerStatements["{_x isKindOf 'AllVehicles'} count thisList > 0","{_x removeEventHandler ['Killed', 0]; _x removeEventHandler ['HandleDamage', 0]; _x allowDamage false;} foreach thisList;","{_x addEventHandler ['HandleDamage', { _x call vehicle_handleDamage }]; _x addEventHandler ['Killed', { _x call vehicle_handleKilled }]; _x allowDamage true;} foreach thisList;"];

BUT.. The second part isn't working yet. The part that reassigns the damage handlers upon exiting the secure area. We're getting there.. Just one more little adjustment I need to figure out..
 
Sorry I can't help you but I really wish I could, I'm a noob at coding. But I'm highly interested in your script, because I want to make a safe zone where me and other admins can help newbies or anyone in need.
 
Back
Top