Safezone

meat147

New Member
Hey there . ;)

do you know how i can create a Safezone?

Following Featueres i want to have:
God - Mode
with : allowDamage false
no shooting
dont know the command right now. :(

Do i need a triger ?

i have tried it with this :
{If (_x distance thisTrigger < 50) Then {_x allowDamage false} else {_x allowDamage true}} forEach thislist;

When i exit the safezone i have godmode.
 
I've tried the same with no luck...:( The Trigger stays activated , no matter if i walk in our out..
Here are my settings:

activation by: anybody
activation type: present
repeatung: rapeatedly
type: switch
interruptable: timeout
name: _safez1
activation condition: round (time %1) ==1
act. expression:
{If (_x distance thisTrigger < 50) Then {_x allowDamage false} else {_x allowDamage true}} forEach thislist;

I tried doing st. like this in deactivation expression:

{If (_x distance thisTrigger > 50) Then {_x allowDamage true} else {_x allowDamage false}} forEach thislist;

does not work,too.


I've also tried to use this script: no_shooting.sqf
Code:
private ["_eh1","_inArea","_pos","_unit","_zone1","_zone2","_dis"];
 
_unit = _this select 0;
 
_zone1 = getMarkerPos "zone1"; // marker name for the areas you want to protect
_zone2 = getMarkerPos "zone2";
_dis = 200;                            // distance from area safe zone starts
 
 
 
if ((_zone1 distance _unit > _dis) or (_zone2 distance _unit > _dis)) then {        //check if unit is in zone when script starts
  _inArea = false;
}else{
  _inArea = true;
  _eh1 = _unit addEventHandler ["fired", {deleteVehicle (_this select 6);}];
};
 
 
 
while {true} do {
 
 
  if (((_zone1 distance _unit < _dis) or (_zone2 distance _unit < _dis)) && (!_inArea)) then {      // check if unit enters
 
      _eh1 = _unit addEventHandler ["fired", {deleteVehicle (_this select 6);}];
      _inArea = true;
      hint "safe zone";
  };
 
 
  if (((_zone1 distance _unit > _dis) or (_zone2 distance _unit > _dis)) && (_inArea)) then {      // check if unit exits
 
      _unit removeEventHandler ["fired", _eh1];
      _inArea = false;
      hint "You just left the safe zone";
  };
 
sleep 5;
 
};

executed in init.sqf with:
nul = [this] execVM "no_shooting.sqf";

It works fine, but only im the Arma2 Editor... after merging with my current mission no succes...againo_O

The thing i wanna do is to create a safe Zone for survivors to trade!

@xerxes: to set it up to remove all weapons once they enter the area sounds interesting!
Will the Survivor get back his Stuff when he leave?

Any help on this would be awesome!

Regards!
 
Aye, a safe trade zone is something i'd possibly use, depending on what the players want. What i'd like is areas that have humanity requirements. Bandit Den and Hero lounge.
 
Ok, i made it !!!
I simply based a trigger with name Basis_West or Basis_East and activation expression for

Center_West:
if (playerSide == WEST) then {[Basis_West] execVM "safezone.sqf"};
Center_East:
if (playerSide == EAST) then {[Basis_East] execVM "safezone.sqf"};

here is the Script i execute:

Code:
//Base protection for Players with Eventhandler
//
//requires Trigger with activation BLUEFOR and OPFOR with name Basis_West and Basis_East
//
// you can't fire out of your own Base
//
//Those who hit or kill Enemy in it's Base, will be killed
//
// Parameters: [name of the side trigger for the Base Area]
//
//Center_West:
//if (playerSide == WEST) then {[Basis_West] execVM "safezone.sqf"};
//
//Center_East:
//if (playerSide == EAST) then {[Basis_East] execVM "safezone.sqf"};
 
 
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
 
 
_Basis = _this select 0; //Basisname
 
while {true} do
  {
    //wait until Player is in base, then start Eventhandler
    waitUntil {vehicle player in list _Basis};
    player groupchat "i am in Baseshield!";
    _EH_Fired  = vehicle player addEventHandler ["Fired", { NearestObject [_this select 0,_this select 4] setPos[0,0,0]}];
    _EH_Hit    = vehicle player addEventHandler ["Hit",  {_this select 1 setdammage 1; player setDammage 0; vehicle player setDammage 0}];
    _EH_Killed = vehicle player addEventHandler ["Killed",{_this select 1 setdammage 1}];
    //wait until Player left base, then delete EventHandler
    waitUntil {! (vehicle player in list _Basis)};
    player groupchat "i have left Baseshield!";
    player removeEventHandler ["Fired", _EH_Fired];
    player removeEventHandler ["Hit",  _EH_Hit];
    player removeEventHandler ["Killed",_EH_Killed];
  }

I also placed a Marker on the map which fills out the protected area for my trading post.
If the player is equiped with a radio, the message occurs...i will add it to startgear ;)
I've also enabled radio in my missionfile, but not sure if it has to be done to be able to see the message..

I am actually thinking about how to handle detection of humanity values...

???a database request of humanity value would be needed for this???

but so far this is what i was searching for
to create a nice safe place, maybe with AI Survivors sitting around a fireplace and talking about anything ;)

Hope this helps , and maybe will be processed by anyone with a bit more "scripting knowlegde" than mine
for realize humanity value detection

.....my english isn't that good but i hope good enough to understand this so far....

Regards!
 
You can do it in the 2D Mission Editor placing a trigger. You will be able to define the Size of the trigger radius (x,y axis)
In the initialisation field you can enter the execution command:
if (playerSide == WEST) then {[Basis_West] execVM "safezone.sqf"};
remenber to have the safezone.sqf file in the current editing mission folder (documents/arma2 other profiles/your Name/MPMissions/name of your current Editor Session)
 
In my mission.sqm ist looks like this:

Code:
class Sensors
    {
        items=2;
        class Item0
        {
            position[]={11481.527,317.3009,11326.991};
            a=140;
            b=140;
            activationBy="ANY";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            text="Basis_West";
            name="Basis_West";
            expActiv="if (playerSide == WEST) then {[Basis_West] execVM ""safezone.sqf""};";
            class Effects
            {
            };
        };
        class Item1
        {
            position[]={11481.271,317.30008,11326.833};
            a=140;
            b=140;
            activationBy="ANY";
            interruptable=1;
            age="UNKNOWN";
            text="Basis_East";
            expActiv="if (playerSide == EAST) then {[Basis_East] execVM ""safezone.sqf""};";
            class Effects
            {
            };
        };
    };
};
 
Ok, i am working on my trading post right now and some new problems have occured...
I'm still using the safezone script on klen, but unfortunally zombies spawn at this location since the new update...and as expected the players who are in the safezone cannot kill zeds....but the zeds can kill the players :(

First i implemented AI with executing DayZ Factions and add_unit_server.sqf to make AI cleaning the area from Zeds, but when AI spawns the Safezone does not work anymore... I think this depends on the new definitions coming up with DayZ factions...
Maybe a zone restriction or Safe zone script-enhancement would fix that problem, but i actually have no idea how to do it.
Is it possible to make a dead zone for the Zeds Faction?
with st like this:

(Player in list Zone); as condition
Player setDamage 1; as action
Which Faction are the Zeds? Can i define a new faction for Zombies?

I also found a script normally used with a hack tool, which makes a Kill-Aura surrounding the player:

Code:
if (isNil "zombieshield") then {zombieshield = true;} else {zombieshield = !zombieshield};
if(zombieshield) then {titleText ["Zombie Spawning deactivated!","PLAIN DOWN"]; titleFadeOut 4;};
 
while {zombieshield} do {
 
_pos = getPos player;
_zombies = _pos nearEntities ["zZombie_Base",16000];
_count = count _zombies;
 
for "_i" from 0 to (_count -1) do
{
_zombie = _zombies select _i;
_zombie setDamage 1;
};
};
 
titleText ["Zombie Spawning Activated!","PLAIN DOWN"]; titleFadeOut 4;

Can i also execute it to surround a trigger?
What would be the execution command for that trigger?
I am bothering my head about a solution and would be greatful about any idea!

Regards
 
When i execute it, the zombieshield gets activated server-wide! A modification of this script would be needed to get it to work correctly!
May someone more scripting experienced would help me to do this?!?!:) This could be useful for everyone to make a trading post at a random location all over the map...
 
Ok, i am working on my trading post right now and some new problems have occured...
I'm still using the safezone script on klen, but unfortunally zombies spawn at this location since the new update...and as expected the players who are in the safezone cannot kill zeds....but the zeds can kill the players :(

First i implemented AI with executing DayZ Factions and add_unit_server.sqf to make AI cleaning the area from Zeds, but when AI spawns the Safezone does not work anymore... I think this depends on the new definitions coming up with DayZ factions...
Maybe a zone restriction or Safe zone script-enhancement would fix that problem, but i actually have no idea how to do it.
Is it possible to make a dead zone for the Zeds Faction?
with st like this:

(Player in list Zone); as condition
Player setDamage 1; as action
Which Faction are the Zeds? Can i define a new faction for Zombies?

I also found a script normally used with a hack tool, which makes a Kill-Aura surrounding the player:

Code:
if (isNil "zombieshield") then {zombieshield = true;} else {zombieshield = !zombieshield};
if(zombieshield) then {titleText ["Zombie Spawning deactivated!","PLAIN DOWN"]; titleFadeOut 4;};
 
while {zombieshield} do {
 
_pos = getPos player;
_zombies = _pos nearEntities ["zZombie_Base",16000];
_count = count _zombies;
 
for "_i" from 0 to (_count -1) do
{
_zombie = _zombies select _i;
_zombie setDamage 1;
};
};
 
titleText ["Zombie Spawning Activated!","PLAIN DOWN"]; titleFadeOut 4;

Can i also execute it to surround a trigger?
What would be the execution command for that trigger?
I am bothering my head about a solution and would be greatful about any idea!

Regards

Instead of _zombie setDamage 1;

use:

deleteVehicle _zombie;

Would be better, as there's no additional bodies to clear up (less lag) and no cheaters hanging around just to loot the already dead zeds!

I'm actually going to be adding a safe trading zone with no shooting and no zeds to my server by the end of next week, so I'll probably post it up here if I remember.
 
I may or may not also add one depending on feedback from my playerbase.

Big thing for me atm is finding out how to strip combat loggers of their equipment and putting them in a "prison" that i'm currently designing.... They'll have to play prison break with zombies and guards.
 
I may or may not also add one depending on feedback from my playerbase.

Big thing for me atm is finding out how to strip combat loggers of their equipment and putting them in a "prison" that i'm currently designing.... They'll have to play prison break with zombies and guards.

The prison code would be a welcome script to my collection. Have tried this in the past, but only got as far as removing all the players gear and forcing them to start from scratch (often right in the middle of the battle they tried to flee!!).
 
hmm anyone of you had problmes with the editor ?

When I place the trigger and look at the right side of the screen to see the position, I only see the first two numbers..
Running the editor in 1920*1080
 
Instead of _zombie setDamage 1;

use:

deleteVehicle _zombie;

Would be better, as there's no additional bodies to clear up (less lag) and no cheaters hanging around just to loot the already dead zeds!

I'm actually going to be adding a safe trading zone with no shooting and no zeds to my server by the end of next week, so I'll probably post it up here if I remember.

Wow! I cant wait to see this in action!!!!!!! :) Pls remember to post!!!!!
 
hmm anyone of you had problmes with the editor ?

When I place the trigger and look at the right side of the screen to see the position, I only see the first two numbers..
Running the editor in 1920*1080

Yes, i cant see the position too. but simply saving your mission and open it with for example Notepad ++ will let you see the position where u placed your trigger ;)
Remember: the position of your 3D Mission follows a different syntax than your 2D Mission!
 
Back
Top