PVP active in one or more areas

Post Reply
luizrpgluiz
Member
Posts: 20
Joined: Thu Mar 19, 2015 18:11
IRC: luizrpgluiz
In-game: luizinho

PVP active in one or more areas

by luizrpgluiz » Post

would be very good in some future update has just pvp activated in just in one or more areas in minetest.
cdb_HTWLEyTsySH8

User avatar
programmingchicken
Member
Posts: 540
Joined: Sat Apr 18, 2015 02:20
GitHub: pchicken
IRC: chicken pchicken
Location: not here
Contact:

Re: PVP active in one or more areas

by programmingchicken » Post

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.
<gamerdude> I apologize for the above content

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: PVP active in one or more areas

by orwell » Post

I implemented PvP active/inactive in areas in my mod:
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.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
programmingchicken
Member
Posts: 540
Joined: Sat Apr 18, 2015 02:20
GitHub: pchicken
IRC: chicken pchicken
Location: not here
Contact:

Re: PVP active in one or more areas

by programmingchicken » Post

Oh. I guess since I use dev it works for me. :3
<gamerdude> I apologize for the above content

User avatar
everamzah
Member
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: PVP active in one or more areas

by everamzah » Post

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.

User avatar
programmingchicken
Member
Posts: 540
Joined: Sat Apr 18, 2015 02:20
GitHub: pchicken
IRC: chicken pchicken
Location: not here
Contact:

Re: PVP active in one or more areas

by programmingchicken » Post

in 0.4.12-dev register_on_punchplayer you can return true to bypass damage.
<gamerdude> I apologize for the above content

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: PVP active in one or more areas

by Gael de Sailly » Post

May be used by servers to disable PvP in the spawn. I'll bring this idea to MinetestForFun's server.
Just realize how bored we would be if the world was perfect.

User avatar
TenPlus1
Member
Posts: 3728
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: PVP active in one or more areas

by TenPlus1 » Post

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

luizrpgluiz
Member
Posts: 20
Joined: Thu Mar 19, 2015 18:11
IRC: luizrpgluiz
In-game: luizinho

Re: PVP active in one or more areas

by luizrpgluiz » Post

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
cdb_HTWLEyTsySH8

User avatar
TenPlus1
Member
Posts: 3728
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: PVP active in one or more areas

by TenPlus1 » Post

luizrpgluiz: make sure the lines reads as follows (10 is radius protected around spawn):

protector_pvp = true
protector_pvp_spawn = 10

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: PVP active in one or more areas

by twoelk » Post

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.

User avatar
TenPlus1
Member
Posts: 3728
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: PVP active in one or more areas

by TenPlus1 » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests