[Mod] raz - Region, area, zone Protection

Downad
Member
 
Posts: 16
Joined: Tue Oct 03, 2017 08:54
Location: Germany
GitHub: downad
In-game: downad

[Mod] raz - Region, area, zone Protection

by Downad » Tue May 07, 2019 15:39

raz - Protect your Region, areas or zones
Regions, Areas and Zones protection for Minetest

A new Mod for the old idea of protected regions. This mod is inspired by
areas - ShadowNinja - https://github.com/minetest-mods/areas
pvp_areas - everamzah - https://github.com/everamzah/pvp_areas
landrush - Bremaweb - https://github.com/Bremaweb/landrush

It is a try to do them all! It allows players {depending on privilegs}

- to mark their (region / areas / zones) with name
- to protect / open their (region / areas / zones)
- to invite / ban other players to interact in own protected (region / areas / zones)
- to allow / disallow PvP in own (region / areas / zones)
- to allow / disable Mobdamage {Mobdamage vs. Player - MvP} in own (region / areas / zones)
- to set own (region / areas / zones) with an effect like hot, dot, holy, evil


As admin you can name a region and set the "city"-attribute. Now place there new regions/zone with the builing-"plot"-attribute.
As world owner you can allow PvP in special PvP-Zones or all over the world. (pvp_only_in_pvp_regions = true/false)
All player with the region_mark-privileg can now set ther region in the city.
A Player can only modify his own region {depending on privilegs}.
A hud is shown all over the world, the color is depending on region attributs like protection, effect or PvP


If you want some effect on your world like
- hot heal over time
- bot restore breath over time
- holy both: heal an breath over time
- dot damage over time
- choke reduve breath over time
- evil both: damage and choke over time
you can make this, e.g. an holy place in a temple or an evil-zone in a dungeon.

Raz works with downads-marker (forked from Sokomine/markers) https://github.com/downad/raz


Image

Privilegs:
"region_admin" ==> modify all regions, import, export regions, convert areas.dat, ...
"region_effect" ==> Can set and remove effects for own regions.
"region_mvp" ==> Can enable/disable MvP for own regions.
"region_pvp" ==> Can enable/disable PvP for own regions.
"region_set" ==> Can invite/ban guests or change owner of own regions.
"region_mark" ==> Can set, remove and rename own regions and protect and open them.


command:
/region help {command} - to get some more infos about a command. [privileg: interact]
/region status - to get some more infos about the region at your position. [privileg: interact]
/region border - to make your region visible. [privileg: interact]
/region border {name} - to make the region of player name visible. [privileg: region_admin]
/region border {id} - to make the regionwith the id visible. [privileg: region_admin]
/region own - show a list of all your regions. [privileg: region_mark]
/region pos1 - to set your position, this is needed to '/region set' your region. Go to one edge and call the command \'region pos1\'
/region pos2 - to set your position, this is needed to '/region set' your region. If not done, go to one edge and call the command \'region pos2\'
/region mark - to select positions by punching two nodes. [privileg: region_mark]
/region max_y - to set the y-values of your region to 90% of the raz.max_height. 1/3 down and 2/3 up. [privileg: region_mark]
/region set {region_name} - to mark a region with the name {region_name}. This regions is NOT protected! [privileg: region_mark]
/region remove {id} - to remove YOUR region with the ID = {id}! [privileg: region_mark]
/region remove {id/all} - to remove {ID orALL} regions! A backup of th regions will be created \'raz_backup_{DATE}\'. Rename the backup to reimport the regions. [privileg: region_admin]
/region protect {id} - to protect your own region. [privileg: region_mark]
/region open {id} - to open your region for ALL players. [privileg: region_mark]
/region invite {id} {player_name} - to invite this player into your region. Now the players can interact in the region and 'dig'. [privileg: region_set]
/region ban {id} {player_name} - to ban this player from interacting in your region. [privileg: region_set]
/region change_owner" {id} {player_name} - to transfet YOUR region to an new player. The player must invite you if you want to interact in his NEW region. [privileg: region_set]
/region pvp {id} {+ or -} - to enable (+) or disable (-) PvP in your region. [privileg: region_pvp]
/region mvp {id} {+ or -} - to enable (+) or disable (-) MvP in your region. Disable MvP if mobs can not harm player! [privileg: region_mvp]
/region effect {hot,bot,holy,dor,choke,evil} - to set an effect in his region. Effects are hot {heal ofer time}, bot {breath over time}, holy, dot, choke, evil! [privileg: region_effect]
/region export - to export the AreaStore to an file! [privileg: region_admin]
/region import - to import a region-export-file! [privileg: region_admin]
/region convert_areas - to convert an area from ShadowNinja areas to an export-file for raz! [privileg: region_admin]
/region import_areas - to import areas-export-file! [privileg: region_admin]
/region plot {id} {+ or -} - to enable (+) or disable (-). If the plot-attribut is set, a player can mark regions 'in' there. So a city can be protected and named but players can place there own regions in there. [privileg: region_admin]
/region city {id} {+ or -} - to enable (+) or disable (-). If the city-attribut is set, the region_admin can mark regions 'in' there with the building plot-attribute. So a city can be protected and named (by region_admin) but players can place there own regions. [privileg: region_admin]
/region player {player_name} - to show a list of all regions of this player! [privileg: region_admin]

Licence
GNU General Public License v3.0

Textures and Models
Bremaweb/landrush textures
landrush_landclaim.png
landrush_showarea.png
Bremaweb/landrush models
landrush_showarea.x
ShadowNinja/areas textures
areas_pos1.png
areas_pos2.png


code on github: https://github.com/downad/raz
 

Troodon
Member
 
Posts: 11
Joined: Wed Nov 21, 2018 18:52
Location: Angers/France
IRC: Troodon
In-game: Troodon

Re: [Mod] raz - Region, area, zone Protection

by Troodon » Sat Oct 05, 2019 13:23

Hello
Is there a way to change the radius of the protect block and if possible a command that would protect the entire map?
otherwise nice mod

Troodon
 

User avatar
Visitor247
Member
 
Posts: 18
Joined: Tue Dec 03, 2019 11:09

Re: [Mod] raz - Region, area, zone Protection

by Visitor247 » Sun Dec 08, 2019 09:36

Since I didn't get along with Areas, I tried your Mod and it works really well for what I need.

I had a few crashes, though. I remember one occured, when I tried to write /region set name_of_region instead of ID.

Also region set_y seems not to work. It's asking for pos1. I saw in one of your files region max_y. Did you change the name? Is it something different?
As I understand this should automatically set the y-parameters of your zone, so I can set pos1 and pos2 on the surface. Then I use set_y and if the max height I set in the lua file is 90, y will go -30 down and 60 up from where I stand? Or from pos1? Or how will it work?

Otherwise, finally a documentation that goes from a to z, a not just hints because everyone knows how everything works.
 

Downad
Member
 
Posts: 16
Joined: Tue Oct 03, 2017 08:54
Location: Germany
GitHub: downad
In-game: downad

Re: [Mod] raz - Region, area, zone Protection

by Downad » Mon Dec 09, 2019 21:42

Thanks.
i must look at the files - give me some day please
 

Bastrabun
Member
 
Posts: 35
Joined: Mon Nov 04, 2019 19:48

Re: [Mod] raz - Region, area, zone Protection

by Bastrabun » Fri Jan 03, 2020 23:40

This mod is huge, if possible I'd like to use it on a public server :)

Currently, I'm testing as much as possible. When issues arise, where would you like to have them? Here, or on github?

Asking, because I ran into my first Shutdown.

Repro:

> Minetest 5.1.0, Win10
> Default game + raz
> Account1 has all neccessary privileges (region_mark)

1. Give a string to /region protect, like this: "/region protect SomeAreaName"

=> Server Shutdown
=> Debug.log

Code: Select all
2020-01-04 00:24:53: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback on_chat_message(): ..._minetest-5.1.0-experimental\bin\..\mods\raz/raz_lib.lua:866: bad argument #1 to 'get_area' (number expected, got string)
2020-01-04 00:24:53: ERROR[Main]: stack traceback:
2020-01-04 00:24:53: ERROR[Main]:    [C]: in function 'get_area'
2020-01-04 00:24:53: ERROR[Main]:    ..._minetest-5.1.0-experimental\bin\..\mods\raz/raz_lib.lua:866: in function 'region_set_attribute'
2020-01-04 00:24:53: ERROR[Main]:    ...test-5.1.0-experimental\bin\..\mods\raz/command_func.lua:442: in function 'command_protect'
2020-01-04 00:24:53: ERROR[Main]:    ...est-5.1.0-experimental\bin\..\mods\raz/privs_command.lua:97: in function 'func'
2020-01-04 00:24:53: ERROR[Main]:    ...minetest-5.1.0-experimental\bin\..\builtin\game\chat.lua:55: in function <...minetest-5.1.0-experimental\bin\..\builtin\game\chat.lua:34>
2020-01-04 00:24:53: ERROR[Main]:    ...test-5.1.0-experimental\bin\..\builtin\game\register.lua:429: in function <...test-5.1.0-experimental\bin\..\builtin\game\register.lua:413>


Edit: Initially I thought the shutdown had to do with two areas intersecting, but it also happens without any intersection at all. Here's the initial "Repro", only for reference:

> Minetest 5.1.0, Win10
> Default game + raz
> Account1 and Account2 have all neccessary privileges (region_mark)

1. Claim a piece of land with the Land Rush Land Claim Block on account1
2. Mark two positions with /region pos1 and /region pos2 on account2, so that the new area would intersect with the are claimed in step 1
3. Claim the marked area on account2 with /region protect SomeAreaName
 

Bastrabun
Member
 
Posts: 35
Joined: Mon Nov 04, 2019 19:48

Re: [Mod] raz - Region, area, zone Protection

by Bastrabun » Mon Jan 20, 2020 16:30

Since the owner didn't reappear for a while, I tried my hand on some fixes. Since I am VERY new to modding, I'd be happy if someone looked over my fixes and pointed out my mistakes and how to make it better. I simply beat it with a stick until it worked. Here's the link:

https://github.com/Bastrabun/raz

Dear Downad, if you see this, I'd be happy if you took over again and finished that mod, since I intend to use it on my server and can't get the city feature done ;)
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 11 guests