Page 1 of 1

Request to alter this mod slightly (no idea how to myself)

PostPosted: Tue Nov 27, 2012 17:52
by yohoho
I'm not exactly a new Minetest user but I still cannot grasp lua. There is a mod that I used to use a lot awhile back called node_ownership but someone had modded it for me. In the updated node_ownership mod I cannot figure out how to edit it to do as needed.

The alteration should be simple enough. I want it to by default allow all users with interact privs to dig build and whatnot any area that is not owned. Only if the area is owned should a user not be allowed to dig/build/whatnot unless they are the owner of said area.

Link to mod:
https://github.com/codeandfix/node_ownership/

I would greatly appreciate anyone willing to help here with this.

PostPosted: Fri Nov 30, 2012 12:16
by PilzAdam
A "hack" would be:
Under line 159 in init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
function IsPlayerNodeOwner(pos, name)

insert:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
    if name == "Sandbox" then
        return true
    end

PostPosted: Sat Dec 01, 2012 05:01
by yohoho
PilzAdam wrote:A "hack" would be:
Under line 159 in init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
function IsPlayerNodeOwner(pos, name)

insert:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
    if name == "Sandbox" then
        return true
    end


This "hack" doesn't seem to work. With it the behavior of the mod is same. Players with interact cannot dig on unowned land (and I only want the protection on owned land). Thank you anyway for trying.

PostPosted: Sat Dec 01, 2012 10:52
by PilzAdam
I just noticed that this hack wouldnt work as expected because it sets the whole world to a sandbox. Even the protected areas of other users.
Another atempt:
Restore the original mod (delete the changes I mentioned in the other post).
Remove line 243 to 245 in default init.lua. These lines are:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
else
    minetest.chat_send_player(placer:get_player_name(), "You need a concession to place nodes here - Grantor: ".._STATIC_grantor.." (X"..pos.x.." Y"..pos.y.." Z"..pos.z..")")
    return itemstack

Again: This is untested. So feel free to ask me again.
EDIT: And this isnt a "hack".

PostPosted: Mon Dec 03, 2012 00:00
by yohoho
PilzAdam wrote:I just noticed that this hack wouldnt work as expected because it sets the whole world to a sandbox. Even the protected areas of other users.
Another atempt:
Restore the original mod (delete the changes I mentioned in the other post).
Remove line 243 to 245 in default init.lua. These lines are:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
else
    minetest.chat_send_player(placer:get_player_name(), "You need a concession to place nodes here - Grantor: ".._STATIC_grantor.." (X"..pos.x.." Y"..pos.y.." Z"..pos.z..")")
    return itemstack

Again: This is untested. So feel free to ask me again.
EDIT: And this isnt a "hack".


This doesn't work either. Players with interact still cannot dig unowned blocks :S

PostPosted: Wed Dec 05, 2012 01:36
by RAPHAEL
Fixed:
http://ompldr.org/vZ25wMw

EDIT: fixed broken link