Page 1 of 1

PVP active in one or more areas

PostPosted: Thu Aug 13, 2015 23:07
by luizrpgluiz
would be very good in some future update has just pvp activated in just in one or more areas in minetest.

Re: PVP active in one or more areas

PostPosted: Thu Aug 13, 2015 23:39
by programmingchicken
there is minetest.register_on_punch() to disable damage, you can easily check the position of the puncher and punchee to see if they are in an area.

Re: PVP active in one or more areas

PostPosted: Tue Aug 18, 2015 08:39
by orwell
I implemented PvP active/inactive in areas in my mod:
https://forum.minetest.net/viewtopic.php?f=9&t=12754
Either use my mod or write your own mod.

Remember that the register_on_punchplayer() does not exist yet in stable 0.4.12, it is available in 0.4.12-dev only.

Re: PVP active in one or more areas

PostPosted: Tue Aug 18, 2015 14:47
by programmingchicken
Oh. I guess since I use dev it works for me. :3

Re: PVP active in one or more areas

PostPosted: Tue Aug 18, 2015 16:22
by everamzah
I use an AreaStore to mark an area and check if a player is in it on punch: https://github.com/everamzah/dcb/blob/m ... /nopvp.lua -- I imagine this is the entirely wrong way to use AreaStore but it seems to work. I invert the damage instead of disabling it. The red tint shows on the punch, and I wonder if there's a real good way to disable PVP such that no damage is even registered, so that the screen doesn't tint red.

Re: PVP active in one or more areas

PostPosted: Tue Aug 18, 2015 22:04
by programmingchicken
in 0.4.12-dev register_on_punchplayer you can return true to bypass damage.

Re: PVP active in one or more areas

PostPosted: Mon Aug 24, 2015 22:02
by Gael de Sailly
May be used by servers to disable PvP in the spawn. I'll bring this idea to MinetestForFun's server.

Re: PVP active in one or more areas

PostPosted: Tue Aug 25, 2015 06:37
by TenPlus1
The latest Protector Redo allows for PVP to be disabled inside protected areas and a separate setting to protect an area around spawn so noobs don't end up killing one another :)

viewtopic.php?f=9&t=9376#p143164

Re: PVP active in one or more areas

PostPosted: Tue Nov 24, 2015 17:15
by luizrpgluiz
TenPlus1 wrote:The latest Protector Redo allows for PVP to be disabled inside protected areas and a separate setting to protect an area around spawn so noobs don't end up killing one another :)

viewtopic.php?f=9&t=9376#p143164



TenPlus1, I auditioned placing the line of protective pvp = true in minetest.conf and is not working to pvp protection on protected land and I'm using the latest version of minetest which is the 0.4.13

Re: PVP active in one or more areas

PostPosted: Tue Nov 24, 2015 17:53
by TenPlus1
luizrpgluiz: make sure the lines reads as follows (10 is radius protected around spawn):

protector_pvp = true
protector_pvp_spawn = 10

Re: PVP active in one or more areas

PostPosted: Wed Nov 25, 2015 09:18
by twoelk
TenPlus1 wrote:The latest Protector Redo allows for PVP to be disabled inside protected areas and a separate setting to protect an area around spawn so noobs don't end up killing one another :)

viewtopic.php?f=9&t=9376#p143164
...
make sure the lines reads as follows (10 is radius protected around spawn):

protector_pvp = true
protector_pvp_spawn = 10


I might be missing something but could you document these functions in the first post of the mod thread please?

some other thoughts that came to me was wether this mod would allow multiple spawns such as some servers use or even allow a list of coordinates as safe-place input.

Re: PVP active in one or more areas

PostPosted: Sun Nov 29, 2015 09:40
by TenPlus1
For multiple spawns simple place protection blocks around that area which has the same effect of disabling PVP in that area apart from the owner of the protectors.