Safe Bases - Almost Complete

Discussion in 'Scripting Discussions' started by TorZar, Jan 29, 2013.

  1. TorZar

    TorZar New Member

    Joined:
    Nov 2, 2012
    Messages:
    12
    Likes Received:
    5
    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"..
     
    Manatee Hunter, 3djoker and Strikes like this.
  2. Strikes

    Strikes Well-Known Member

    Joined:
    Jan 7, 2013
    Messages:
    154
    Likes Received:
    4
    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.
     
  3. TorZar

    TorZar New Member

    Joined:
    Nov 2, 2012
    Messages:
    12
    Likes Received:
    5
    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.
     
  4. Strikes

    Strikes Well-Known Member

    Joined:
    Jan 7, 2013
    Messages:
    154
    Likes Received:
    4
    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.
     
  5. TorZar

    TorZar New Member

    Joined:
    Nov 2, 2012
    Messages:
    12
    Likes Received:
    5
    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)
     
  6. HumbleUK

    HumbleUK Member

    Joined:
    Oct 27, 2012
    Messages:
    72
    Likes Received:
    3
    idea seems alright, god luck.
     
  7. Calzaghe

    Calzaghe New Member

    Joined:
    Jan 22, 2013
    Messages:
    24
    Likes Received:
    3
    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.
     
  8. Excelsior

    Excelsior Valued Member!

    Joined:
    Nov 5, 2012
    Messages:
    238
    Likes Received:
    53
    TSW can do that with domes now.
     
  9. TorZar

    TorZar New Member

    Joined:
    Nov 2, 2012
    Messages:
    12
    Likes Received:
    5
    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.
     
  10. Calzaghe

    Calzaghe New Member

    Joined:
    Jan 22, 2013
    Messages:
    24
    Likes Received:
    3
    What is TSW?
     
  11. 3djoker

    3djoker Member

    Joined:
    Jan 18, 2013
    Messages:
    48
    Likes Received:
    7
    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?
     
    Calzaghe likes this.
  12. TorZar

    TorZar New Member

    Joined:
    Nov 2, 2012
    Messages:
    12
    Likes Received:
    5
    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.
     
  13. Excelsior

    Excelsior Valued Member!

    Joined:
    Nov 5, 2012
    Messages:
    238
    Likes Received:
    53
    You can make a dome that only certain GUID can enter. Or certain Humanity if you like.
     
  14. Calzaghe

    Calzaghe New Member

    Joined:
    Jan 22, 2013
    Messages:
    24
    Likes Received:
    3
    That sounds like something that is really cool, but not quite in theme with the game.
     
  15. TorZar

    TorZar New Member

    Joined:
    Nov 2, 2012
    Messages:
    12
    Likes Received:
    5
    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.
     
  16. Manatee Hunter

    Manatee Hunter Valued Member!

    Joined:
    Dec 24, 2012
    Messages:
    620
    Likes Received:
    90
    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.
     
  17. TorZar

    TorZar New Member

    Joined:
    Nov 2, 2012
    Messages:
    12
    Likes Received:
    5
    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..

    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!
     
  18. 3djoker

    3djoker Member

    Joined:
    Jan 18, 2013
    Messages:
    48
    Likes Received:
    7
    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.
     
  19. TorZar

    TorZar New Member

    Joined:
    Nov 2, 2012
    Messages:
    12
    Likes Received:
    5
    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..
     
  20. drmagnumwolf

    drmagnumwolf New Member

    Joined:
    Jan 25, 2013
    Messages:
    24
    Likes Received:
    1
    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.
     

Share This Page