Jump to content
  • 0

Create a PvP zone in a PvE server


LadyVal

Question

I have a server in GTX, epoch 1.0.6.2, with the traders, safe zones, wai, dzai, one currency system...  The server is PvE completely so no player can be hurt by another player.  But, we want to allow some areas to be able to have pvp (f. ex.: Chernogorsk)... I set a Marker with a notification that says "you are entering in a pvp area" but I still have the damage disabled there.

I was told that it is like the code for safezones but inverse... I was looking the safezone code and it is totally out of my reach to be able to do that.   If anybody can help with that, I would be greatly thankfull.  

Thanks a lot.

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

If you are using Salival's solution then you should be able to just add a third condition:

if (_isPlayer && !_falling && !InPVPZone) exitWith {};

Add this to your custom variables.sqf to initialize the variable:

InPVPZone = false;

If you are using a sensor in mission.sqf, then just toggle the variable by changing the variable to true when you enter and false when you leave.

Link to comment
Share on other sites

  • 0

Sorry... I forgot to enable the notification.

I am using Salivan solution for the pve (all server is pve) and the marker in the map is using sensor (I didnt know how to do it, and Tempted helped me in that one)

So, having Salivan pve option, and sensor for the marker... what should I do?

Should be something like this (I comment the TRGDEF function that is define above and is calling the function that is disabling the pvp), so I added "init" that I saw is the one defining the able or disable damage... how wrong am I?... jajajaj (i know, terrible)

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0
  On 4/29/2018 at 4:40 PM, LadyVal said:

Sorry... I forgot to enable the notification.

I am using Salivan solution for the pve (all server is pve) and the marker in the map is using sensor (I didnt know how to do it, and Tempted helped me in that one)

So, having Salivan pve option, and sensor for the marker... what should I do?

Should be something like this (I comment the TRGDEF function that is define above and is calling the function that is disabling the pvp), so I added "init" that I saw is the one defining the able or disable damage... how wrong am I?... jajajaj (i know, terrible)

  Reveal hidden contents

 

Expand  

@JasonTMis on the money here, use this in your mission.sqm:

        class Item6
        {
        position[]={6656.21,0,2620.96}; 
                     //TRGDEF
                    name="zonepvp";
                    expCond="(player distance zonepvp) < 200;";
                    expActiv="inPVPZone = true; systemChat (format [""You are entering PVP zone.""]);";
                    expDesactiv="inPVPZone = false; systemChat (format [""You are leaving PVP zone.""]);";
                    init="this enableSimulation false;this allowDamage true;this enableAI 'FSM';this enableAI 'ANIM';this enableAI 'MOVE';";                    
        };

Then add the line he also suggested to your custom fn_damageHandler.sqf:

Replace this line: 

if (_isPlayer && !_falling) exitWith {};

With this line:

if (_isPlayer && {!_falling} && {!inPVPZone}) exitWith {};

 

Link to comment
Share on other sites

  • 0

Thanks for that!!

One more question about this pvp zone:  
I was asking about the calling rolling messages because I would like to have a message like you have when you are entering in safezone (but in red), but I couldnt find where that STR are safe so I try to see if I can create one for the PVP area.

And one only for the "looking"... how can the circle/mark can be expanded to be way much more bigger?

Again, thanks a lot for all the help.

_______________________________________

I did that change and it is giving me these errors (console error and rpt, obviously)

https://gyazo.com/01df40142ad82d1eeaecc8f52ce0091f 

(this is in Mission.sqm... when I comment those lines, everything is resolved.

And the following one is in the fn_damagehandler... when I use the original one, everything is working.

https://gyazo.com/f8ed3946c2561a2dc3ddb33468974204

BUT WHEN I REMOVE THE MISSION.SQM ENTRY, I HAVE NO MORE ERROR FROM THE DAMAGEHANDLER.  ??

this is the part of the script where that was changed

  Reveal hidden contents
Link to comment
Share on other sites

  • 0
  On 4/30/2018 at 1:26 PM, LadyVal said:

Thanks for that!!

One more question about this pvp zone:  
I was asking about the calling rolling messages because I would like to have a message like you have when you are entering in safezone (but in red), but I couldnt find where that STR are safe so I try to see if I can create one for the PVP area.

And one only for the "looking"... how can the circle/mark can be expanded to be way much more bigger?

Again, thanks a lot for all the help.

_______________________________________

I did that change and it is giving me these errors (console error and rpt, obviously)

https://gyazo.com/01df40142ad82d1eeaecc8f52ce0091f 

(this is in Mission.sqm... when I comment those lines, everything is resolved.

And the following one is in the fn_damagehandler... when I use the original one, everything is working.

https://gyazo.com/f8ed3946c2561a2dc3ddb33468974204

BUT WHEN I REMOVE THE MISSION.SQM ENTRY, I HAVE NO MORE ERROR FROM THE DAMAGEHANDLER.  ??

this is the part of the script where that was changed

  Reveal hidden contents
Expand  

y wrong create trigger in missioan.sqm

show me mission.sqm

Link to comment
Share on other sites

  • 0

sorry Tanita... I didnt open Epoch forum, I was busy on the local server.

This is the Mision.sqm

 

  Reveal hidden contents

I couldnt make it work at all.

And some of our guys want to have pvp... and others, dont want it.

I would be greatfull if you help me in the solution.

Link to comment
Share on other sites

  • 0
  On 5/12/2018 at 9:09 PM, LadyVal said:

sorry Tanita... I didnt open Epoch forum, I was busy on the local server.

This is the Mision.sqm

 

  Reveal hidden contents

I couldnt make it work at all.

And some of our guys want to have pvp... and others, dont want it.

I would be greatfull if you help me in the solution.

Expand  

You PvP position zone coordinate is wrong, is different of default Trade zone.   This is yours "position[]={6656.21,0,2620.96};" and this is  "position[]={6325,304,7807};" default. Feel deffernt? Numbers cords. 
But, i did't know WHERE and HOW get necessary coords at same default. It need me too.

Link to comment
Share on other sites

  • 0

Hey there,

I'm trying to get a PVP Zone set up on my Epoch 1.0.7 server and have tried to make it happen using the configs recommended in this message string. So far here's what I've done:

1. In mission.sqm added this zone:

  Reveal hidden contents

2. Also in mission.sqm added this map marker:

  Reveal hidden contents

3. Pulled the fn_damageHandler.sqf out of the dayz_code pbo and placed it into the mission dayz_code\compile folder.

4. Added this line in my compiles.sqf to call the fn_damageHandler.sqf:

call compile preprocessFileLineNumbers "dayz_code\compile\fn_damageHandler.sqf";

5. In fn_damageHandler.sqf changed this: if (DZE_PVE_Mode && {_isPlayer} && {!_falling})) exitWith {};

To this: if (DZE_PVE_Mode && {_isPlayer} && {!_falling} && {!inPVPZone})) exitWith {};

That's it. That's all I could gather to do from the message string above. A couple of things:

1. When joining, I get a "cannot load mission" error but after clicking ok it goes away and let's me in.

2.  Nothing happens when I enter the PVP zone, which is in the middle of Cherno. The Anti PVE is still on and you cannot damage a player.

3. The map icon shows up fine but I would like to know if there is a way to make the map icon circle as large as the PVP zone itself so that it shows the borders of the zone.

Anyway, if anyone has some time to point me in the right direction on this I would very much appreciate it.

Thanks!

Vlad

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...