Page 1 of 1

[Mod] PvP Areas [pvp_areas]

PostPosted: Wed Sep 07, 2016 18:56
by everamzah
Description: Mark areas for PvP, but disallow elsewhere by default. The inversion of this can be achieved by setting Settings -> Mods -> pvp_areas -> PvP by Default.
Usage: /pvp_areas pos1 and /pvp_areas pos2, following by /pvp_areas set. /pvp_areas without argument lists areas. /pvp_areas remove n removes that entry.
Bugs: https://github.com/everamzah/pvp_areas/issues
Requires: 403dada (Sep. 9 2016) or later.

Areas are stored in the world path as "pvp_areas_store.dat".

This mod is a reply to viewtopic.php?f=10&t=15479

Download
Git repository: https://github.com/everamzah/pvp_areas
License: LGPL v2.1+

Re: [Mod] PvP Areas [pvp_areas]

PostPosted: Thu Sep 08, 2016 10:25
by taikedz
I added some things and sent a PR

When testing I found that I could not inflict damage either inside or outside the area... though looking at protector mod's code, it should indeed work.... will look further into that later....

Re: [Mod] PvP Areas [pvp_areas]

PostPosted: Thu Sep 08, 2016 12:06
by taikedz
Some additional changes have been made and my dev branch seems funcitonal..... beta tests to now be done ;-)

Re: [Mod] PvP Areas [pvp_areas]

PostPosted: Thu Sep 08, 2016 12:16
by everamzah
taikedz dev branch is here: https://github.com/taikedz/pvp_areas/tree/dev

I haven't made any changes to my version yet, still waiting to see if I can get the total number of entries in an AreaStore without tracking it separately. get_area(n), where n does not exist, crashes Minetest without error: https://github.com/minetest/minetest/issues/4507

Re: [Mod] PvP Areas [pvp_areas]

PostPosted: Fri Sep 09, 2016 13:17
by everamzah
Some preliminary management of the areas has been implemented. You may now /pvp_area remove n, where n is some AreaStore id number. For now, you'll have to count from 0 using the output of /pvp_areas with no arguments (sent to console). /pvp_areas now lists areas to chat, when issued without argument.

This update requires a change to the engine, for which there is a PR: https://github.com/minetest/minetest/pull/4508
Update: This change was merged. 403dada or later is required.

Also, PvP is now on off by default, and disallowed in set areas only. This can be toggled by going to Settings -> Mods -> pvp_areas and setting `PvP by Default' to false true, or by setting pvp_areas_enable_pvp = false true in minetest.conf.

Edit: I should probably invert that default so the name of the mod makes sense.
Edit: Done.

Re: [Mod] PvP Areas [pvp_areas]

PostPosted: Wed Nov 09, 2016 16:24
by Fixerol