Jump to content

Sensors (triggers) in Epoch possible ?


nedfox

Recommended Posts

(This is the old A2 post) :

 

I have put this in my mpmissions/pathera3.pbo (Just below the markers class):

 

class Sensors
{
  items = 1;
  class Item0
  {
      name="dino";
   position[] = {9073.572,18.866203,8503.228};
   a = 1700;
   b = 1200;
   angle = -130.966;
   activationBy = "ANY";
   repeating = 1;
   interruptable = 1;
   age = "UNKNOWN";
   expActiv = "titleText [""Dino area ahead"", ""PLAIN DOWN"", 3];";
   class Effects
   {
   };
  };
};

 

In editor mode, this shows a message when entering the area. When deployed to my test server it does NOT.

 

Is there either AH or EPOCH cpode preventing this, or am I making a mistake somewhere?

 

Link to comment
Share on other sites

Yes, in the end I had to tweak things; I had too much going on, but in the end this worked :

 

Entering/leaving area : text message every time

 

Entering (once) : Short music.

 

class Sensors
{
  items = 2;
  class Item0
  {
   name = "dino_t";
   position[] = {9073.572,18.866203,8503.228};
   a = 1700;
   b = 1200;
   angle = -130.966;
   activationBy = "ANY";
   repeating = 1;
   interruptable = 1;
   age = "UNKNOWN";
   expCond = "(vehicle player) in thislist;";
   expActiv = "titleText [""You are entering a DEADLY area where dinosaurs roam!"", ""PLAIN DOWN"", 3];";
   expDesactiv = "titleText [""You've left the dinosaur area "", ""PLAIN DOWN"", 3];";
   class Effects{};
  };
  class Item1
  {
   name = "dino_s";
   position[] = {9074.572,18.866203,8503.228};
   a = 1700;
   b = 1200;
   angle = -130.966;
   activationBy = "ANY";
   repeating = 0;
   interruptable = 1;
   age = "UNKNOWN";
   expCond = "(vehicle player) in thislist;";
   expActiv = "playSound ""01""";
   class Effects{};
  };
};
Link to comment
Share on other sites

Thanks for posting your trigger script nedfox  :)

It seems clear that you are planning on using this with a dino script and I have been thinking it would be nice to add the odd roaming velociraptor to my server so is this the pack that you intend to use ?

 

http://makearmanotwar.com/entry/ec2EDrOCkM#.VKwETyusVp9

 

 

I am a noob at adding script only having small forays into this so would appreciate any incite you have from your project.

Link to comment
Share on other sites

@nedfox

interested for this thing:

need explain 

   expCond = "(vehicle player) in thislist;";

   expActiv = "playSound ""01""";

   class Effects{};

 

When the player as person or the player in a vehicle  is in a global variable list then he play a local sound : )

 

But strange tho ? since it are dino areas? why don't  you do distance player areanam < 300 ) or something?

Link to comment
Share on other sites

Allright, explaining a little bit (and also some questions that remain open since I don't want to toch stuff that works :)

 

Adding sounds to your mission files requires a few things :

 

1] An OGG file (Audacity freeware is very good at exporting MP3 to OGG)

2] A reference in description.ext (which resides in the <yourmap>.PBO in mpmissions

3] A trigger (Sensor) which makes the sound play.

 

1] You can find that out yourself, pretty easy.

 

2] Edit your description.ext :

class CfgSounds
{
    sounds[] = {01};
    class 01
    {
        name = "01";
        sound[] = {"JP.ogg", db+25, 1.0};
        titles[] = {0,""};
    };
};

This bit goes in straight after your "Class Header" declaration.

 

Edit : Forgot : Repack the mission.PBO with the edited descriptsion.ext AND the OGG file !! So just drop the OGG in the PBO with pbomanager.

 

3] The sensor. I have spent a whole evening trying out sensors until I found one that worked (the one I posted).. There's more way to do it Like Zupa posted, but I'm not too familiar with sensors to try another whole evening to get the same result :)

 

Details of the sensor variables :

name = "dino_s"; // Every object needs an unique name.
   position[] = {9074.572,18.866203,8503.228};  //this is the location of the center of the sensor.
   a = 1700; //width
   b = 1200; //height
   angle = -130.966; //rotate the oval a bit to cover the island better
   activationBy = "ANY"; //Could be CIV in our case since we play on CIV, but ANY works too.
   repeating = 0; //Only play the music ONCE
   interruptable = 1; //Leaving the area makes the sensor go dormant (although the music keeps playing)
   age = "UNKNOWN"; //no idea
   expCond = "(vehicle player) in thislist;";  //WHEN must the sensor trigger?  In this case, when a player enters the area.
   expActiv = "playSound ""01"""; //WHAT to do when someone enters? Like do text, play music etc etc
   class Effects{};  /no extra effects.

That's about it.

Link to comment
Share on other sites

Thanks for posting your trigger script nedfox  :)

It seems clear that you are planning on using this with a dino script and I have been thinking it would be nice to add the odd roaming velociraptor to my server so is this the pack that you intend to use ?

 

http://makearmanotwar.com/entry/ec2EDrOCkM#.VKwETyusVp9

 

 

I am a noob at adding script only having small forays into this so would appreciate any incite you have from your project.

 

yes it's that raptor pack. But we modified it to do less damage to make it possible to survive the packs :)

Link to comment
Share on other sites

  • 2 weeks later...

Hi my safe zone by Altis :)

	class Sensors {
		items = 3;
		class Item0 {
			name = "bazar1_m";
			position[] = {13321.2,-0.127439,14504.7};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "titleText [""YOU ENTERING GREEN ZONE! NOT KILL -BANNED!!!"", ""PLAIN DOWN"", 3];";
			expDesactiv = "titleText [""YOU EXIT GREEN ZONE) "", ""PLAIN DOWN"", 3];";
			class Effects{};
	};
		class Item1 {
			name = "bazar2_m";
			position[] = {18454.9,0.148972,14272.8};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "titleText [""YOU ENTERING GREEN ZONE! NOT KILL -BANNED!!!"", ""PLAIN DOWN"", 3];";
			expDesactiv = "titleText [""YOU EXIT GREEN ZONE) "", ""PLAIN DOWN"", 3];";
			class Effects{};
	};
		class Item2 {
			name = "bazar3_m";
			position[] = {6193.35,-0.210175,16834};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "titleText [""YOU ENTERING GREEN ZONE! NOT KILL -BANNED!!!"", ""PLAIN DOWN"", 3];";
			expDesactiv = "titleText [""YOU EXIT GREEN ZONE) "", ""PLAIN DOWN"", 3];";
			class Effects{};
	};
};
	class Markers {
		items = 6;
		
		class Item0 {
			position[] = {14939.9, 0.0534991, 15083.3};
			name = "center";
			type = "Empty";
		};
		
		class Item1 {
			position[] = {23600.6, 3.19, 18000.7};
			name = "respawn_east";
			type = "Empty";
		};
		
		class Item2 {
			position[] = {23600.6, 3.19, 18000.8};
			name = "respawn_west";
			type = "Empty";
		};
		class Item3
		{
			position[]={13321.2,-0.127439,14504.7};
			name="GREEN ZONE1";
			text="GREEN ZONE";
			markerType="ELLIPSE";
			type="respawn_unknown";
			colorName="ColorGUER";
			a=150;
			b=150;
		};
		class Item4
		{
			position[]={6193.35,-0.210175,16834};
			name="GREEN ZONE2";
			text="GREEN ZONE";
			markerType="ELLIPSE";
			type="respawn_unknown";
			colorName="ColorGUER";
			a=150;
			b=150;
		};
		class Item5
		{
			position[]={18454.9,0.148972,14272.8};
			name="GREEN ZONE3";
			text="GREEN ZONE";
			markerType="ELLIPSE";
			type="respawn_unknown";
			colorName="ColorGUER";
			a=150;
			b=150;
		};
	};
};

Link to comment
Share on other sites

 

Hi my safe zone by Altis :)

	class Sensors {
		items = 3;
		class Item0 {
			name = "bazar1_m";
			position[] = {13321.2,-0.127439,14504.7};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "titleText [""YOU ENTERING GREEN ZONE! NOT KILL -BANNED!!!"", ""PLAIN DOWN"", 3];";
			expDesactiv = "titleText [""YOU EXIT GREEN ZONE) "", ""PLAIN DOWN"", 3];";
			class Effects{};
	};
		class Item1 {
			name = "bazar2_m";
			position[] = {18454.9,0.148972,14272.8};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "titleText [""YOU ENTERING GREEN ZONE! NOT KILL -BANNED!!!"", ""PLAIN DOWN"", 3];";
			expDesactiv = "titleText [""YOU EXIT GREEN ZONE) "", ""PLAIN DOWN"", 3];";
			class Effects{};
	};
		class Item2 {
			name = "bazar3_m";
			position[] = {6193.35,-0.210175,16834};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "titleText [""YOU ENTERING GREEN ZONE! NOT KILL -BANNED!!!"", ""PLAIN DOWN"", 3];";
			expDesactiv = "titleText [""YOU EXIT GREEN ZONE) "", ""PLAIN DOWN"", 3];";
			class Effects{};
	};
};
	class Markers {
		items = 6;
		
		class Item0 {
			position[] = {14939.9, 0.0534991, 15083.3};
			name = "center";
			type = "Empty";
		};
		
		class Item1 {
			position[] = {23600.6, 3.19, 18000.7};
			name = "respawn_east";
			type = "Empty";
		};
		
		class Item2 {
			position[] = {23600.6, 3.19, 18000.8};
			name = "respawn_west";
			type = "Empty";
		};
		class Item3
		{
			position[]={13321.2,-0.127439,14504.7};
			name="GREEN ZONE1";
			text="GREEN ZONE";
			markerType="ELLIPSE";
			type="respawn_unknown";
			colorName="ColorGUER";
			a=150;
			b=150;
		};
		class Item4
		{
			position[]={6193.35,-0.210175,16834};
			name="GREEN ZONE2";
			text="GREEN ZONE";
			markerType="ELLIPSE";
			type="respawn_unknown";
			colorName="ColorGUER";
			a=150;
			b=150;
		};
		class Item5
		{
			position[]={18454.9,0.148972,14272.8};
			name="GREEN ZONE3";
			text="GREEN ZONE";
			markerType="ELLIPSE";
			type="respawn_unknown";
			colorName="ColorGUER";
			a=150;
			b=150;
		};
	};
};

Do you need to whitelist for Epoch ?

Link to comment
Share on other sites

Anyone know if there is a way to do save zones with god mode on like in arma 2 dayz epoch 

 

I'm not really sure about that, but try this out:

In your \@epochhive\addons\a3_epoch_server_settings\config.cpp search for the part of your map, lets take Altis for now:

class Altis : Default
	{
		worldSize = 20000;
		traderBlds[] = { "Land_...........................
                .
                .
                .
                .
         propsPos[] = {
		//trader city #1
		{"Land_MarketShelter_F", { 13315.3, 14512.4, 0.0361125 }, 119.966},
		{ "Land_ScrapHeap_2_F", { 13315.9, 14499, 0.00584948 }, 255.706 },
		{ "Land_HBarrier_Big_F", { 13313.7, 14494.8, 0.050712 }, 352.447 },
		{ "Land_spp_Mirror_Broken_F", { 13303.6, 14516.4, 0 }, 300.644 },
                .
                .

Add after the "propsPos[] = {" a new Line like the other and use as classname: ProtectionZone_Invisible_F

The line should look like this:

{ "ProtectionZone_Invisible_F", { 13344.1, 14483.7, 0.00191855 }, 359.768 },

Change the Coords to the Zone you want, the last Number could also be a 0, cause its the direction. Didnt tested this for Godmode, but I know that this is a "NoBuild-Area" like in the Trader-Cities, maybe there is Godmod too.

Dont forget, if you add this as the last line... every line needs a comma, but NOT the last line....

Link to comment
Share on other sites

  • 2 weeks later...

my simple safe zone ver 0.2:)

 
STEP #1 
add you init.sqf 


if (isServer) then {
    [] execVM "Greenzone\greenzone.sqf";
};
STEP #2
create folder ./mpmission/greenzone
 
STEP #3
create file ./mpmission/greenzone/greenzone.sqf
 
USE_GREENZONE = true; //use scripts true/false
SET_MARKER = true;    //set visual markers on the map true/false

// _zonecoord =  [[_center],_radius,_name,_string],[[_center],_radius,_name,_string]];
_zonecoord =
[
	[[13326.5,14515.2,0],150, 'Center', true],// Center GreenZone
	[[6192.46,16834,0],150, 'West', true],// West GreenZone
	[[18451.9,14278.1,0],150, 'East', true]// East GreenZone
];

// Sign_Sphere200cm_F - big orange sphere
// Sign_Arrow_Green_F - big green down arrow
// Sign_Arrow_Direction_Green_F - mid green center arrow

if (isServer) exitWith 
{
	if (USE_GREENZONE) then // check true
	{
		{
			_center = _x select 0;
			_radius = _x select 1;
			_name = _x select 2;	
			_arrow = _x select 3;

			if (_arrow) then // check true
			{
				for '_i' from 0 to 360 step (270 / _radius)*2 do
				{
					_location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
					_dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
					_object = createVehicle ['Sign_Arrow_Direction_Green_F', _location, [], 0, 'CAN_COLLIDE'];  // set sign model
					_object setDir _dir;
				};

			if (SET_MARKER) then { // check true

				_marker = createMarker [format["GreenZone:%1", _name], _center];
				_marker setMarkerType "selector_selectedMission";
				_marker setMarkerText " Safe green zone";
				_marker setMarkerColor "ColorRed";
				_marker = createMarker [format["GreenZone1:%1", _name], _center];
				_marker setMarkerShapeLocal "ELLIPSE";
				_marker setMarkerTypeLocal  "Empty";
				_marker setMarkerColorLocal "ColorGUER";
				_marker setMarkerBrushLocal "Solid";
				_marker setMarkerSize [_radius, _radius];
			};
		};
	 } forEach _zonecoord ; 
    };                                                                                       
};

STEP #4
create file ./mpmission/greenzone/notification.hpp
class CfgNotifications
{
// On Entering safe zone
	class WestSpawn
	{
	title = "Green safe zone - west";
	iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";  // notification icon
	color[] = {0,0.8,0,1};  // text color
	description = "%1";
	duration = 10; // time notification on screen in sec.
	priority = 0;
       	};
	class MidSpawn
	{
	title = "Green safe zone - center";
	iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
	color[] = {0,0.8,0,1};
	description = "%1";
	duration = 10;
	priority = 0;
	};
	class EastSpawn
	{
	title = "Green safe zone - east";
	iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
	color[] = {0,0.8,0,1};
	description = "%1";
	duration = 10;
	priority = 0;
	};
// Exit safe zone notification
	class EWestSpawn
	{
	title = "You exit safe zone!";
	iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
	color[] = {1,0.4,0,1};
	description = "%1";
	duration = 10;
	priority = 0;
	};
	class EMidSpawn
	{
	title = "You exit safe zone!";
	iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
	color[] = {1,0.4,0,1};
	description = "%1";
	duration = 10;
	priority = 0;
	};
	class EEastSpawn
	{
	title = "You exit safe zone";
	iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
	color[] = {1,0.4,0,1};
	description = "%1";
	duration = 10;
	priority = 0;
	};
};

STEP #5:
Add you miision.sqf above class markers:
	class Sensors {
		class Item0 {
			name = "bazar1_m";
			position[] = {13321.2,-0.127439,14504.7};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "[""MidSpawn"",[""Kill on greenzone = BAN""]] call bis_fnc_showNotification; player allowDamage false; player addEventHandler [""HandleDamage"",{false}];";
			expDesactiv = "[""EMidSpawn"",[""You may die""]] call bis_fnc_showNotification; player allowDamage true; player addEventHandler [""HandleDamage"",{true}];";
			class Effects{};
	};
		class Item1 {
			name = "bazar2_m";
			position[] = {18454.9,0.148972,14272.8};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "[""EastSpawn"",[""Kill on greenzone = BAN""]] call bis_fnc_showNotification; player allowDamage false; player addEventHandler [""HandleDamage"",{false}];";
			expDesactiv = "[""EEastSpawn"",[""You may die""]] call bis_fnc_showNotification; player allowDamage true; player addEventHandler [""HandleDamage"",{true}];";
			class Effects{};
	};
		class Item2 {
			name = "bazar3_m";
			position[] = {6193.35,-0.210175,16834};
			a = 150;
			b = 150;
			angle = -130.966;
			activationBy = "ANY";
			repeating = 1;
			interruptable = 1;
			age = "UNKNOWN";
			expCond = "(vehicle player) in thislist;";
			expActiv = "[""WestSpawn"",[""Kill on greenzone = BAN""]] call bis_fnc_showNotification; player allowDamage false; player addEventHandler [""HandleDamage"",{false}];";
			expDesactiv = "[""EWestSpawn"",[""You may die""]] call bis_fnc_showNotification; player allowDamage true; player addEventHandler [""HandleDamage"",{true}];";
			class Effects{};
	};
};

STEP#6 
Go to you description.ext and place in bottom link to notification.hpp
#include "greenzone/notification.hpp
Warning !!! in you use infistar, go to 
 
/*  Notification check   */ _UNC = true;    /* true or false */ 
and change false
/*  Notification check   */ _UNC = false;    /* true or false */ 
 
/*  Check Global Markers */ _CGM = true; /* true or false */ 
/*  Check Local Markers  */ _CLM = true; /* true or false */
/*  Use _aLocalM array   */ _UMW = true; /* true or false */ 


change false 


/*  Check Global Markers */ _CGM = false; /* true or false */ 
/*  Check Local Markers  */ _CLM = false; /* true or false */
/*  Use _aLocalM array   */ _UMW = false; /* true or false */
 
and check you Batleye file:
 
1.  7 "BIS_fnc_"      add !="showNotification"
20. 7 allowDamage     add !="allowDamage false" !="allowDamage true"
52 .7 addEventHandler add !="HandleDamage"
Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...