[Modpack] WorldEdit [worldedit]

User avatar
sfan5
Moderator
Posts: 3933
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

cosarara97 wrote:Old saves still work right? (I didn't know they had the .we extension xD)
Yep
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
lkjoel
Member
Posts: 779
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey
Contact:

by lkjoel » Post

I'm not exactly getting how this works. I'm using the latest build (both minetest and your mod), and it appears to work fine with //pos1 and //pos2, but when I say //p get, it just gives 0,0,0 on P1 and P2 (which is not the case), so of course, setting does not work.
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

lkjoel wrote:I'm not exactly getting how this works. I'm using the latest build (both minetest and your mod), and it appears to work fine with //pos1 and //pos2, but when I say //p get, it just gives 0,0,0 on P1 and P2 (which is not the case), so of course, setting does not work.
it works 100% for me. are you using linux?
Keep calm and code python^_^

User avatar
sfan5
Moderator
Posts: 3933
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

lkjoel wrote:I'm not exactly getting how this works. I'm using the latest build (both minetest and your mod), and it appears to work fine with //pos1 and //pos2, but when I say //p get, it just gives 0,0,0 on P1 and P2 (which is not the case), so of course, setting does not work.
Type //p set, punch a node here and punch a node there.
p1=coordinates of a node here
p2=coordinates of a node there
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
sfan5
Moderator
Posts: 3933
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Death Dealer wrote:
lkjoel wrote:I'm not exactly getting how this works. I'm using the latest build (both minetest and your mod), and it appears to work fine with //pos1 and //pos2, but when I say //p get, it just gives 0,0,0 on P1 and P2 (which is not the case), so of course, setting does not work.
it works 100% for me. are you using linux?
Linux is not the Problem
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
lkjoel
Member
Posts: 779
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey
Contact:

by lkjoel » Post

I'm using linux, and I did try //p set, and it still didn't work (I punched two different objects). Nothing seems to show up.
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

lkjoel wrote:I'm using linux, and I did try //p set, and it still didn't work (I punched two different objects). Nothing seems to show up.
haha :D i was reading somewhere linux was having a problem with it, im not sure where, but ya windows 100% sorry i cant help you to fix it
Keep calm and code python^_^

User avatar
RabbiBob
Member
Posts: 335
Joined: Sat Jan 28, 2012 22:40
Location: /teleport 54,47,28
Contact:

by RabbiBob » Post

First: can't believe I have just gotten around to installing this and playing with it. Very nice!
Second: Anyone sharing .we files?

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

RabbiBob wrote:First: can't believe I have just gotten around to installing this and playing with it. Very nice!
Second: Anyone sharing .we files?
i will sha5re my 5 mese hotel if your interested.
Keep calm and code python^_^

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

What are the advantages to this as opposed to creative mode?

User avatar
Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

WorldEdit complements creative mode; it allows you to avoid the tedious task of placing blocks over and over in the same pattern, for example, or replacing all the stone in a structure with cobblestone.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

So you make a block pattern lets say a castle then instead of rebuilding the castle in another spot it's a keystroke away?
Last edited by bgsmithjr on Fri Mar 30, 2012 19:56, edited 1 time in total.

User avatar
RabbiBob
Member
Posts: 335
Joined: Sat Jan 28, 2012 22:40
Location: /teleport 54,47,28
Contact:

by RabbiBob » Post

Death Dealer wrote:
RabbiBob wrote:First: can't believe I have just gotten around to installing this and playing with it. Very nice!
Second: Anyone sharing .we files?
i will sha5re my 5 mese hotel if your interested.
Yeah, that'd be good. I'm still a n00b with it and I'm curious to understand better the .we layout. If I see something more complex than I'm able to make in testing, that may help.

User avatar
Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

bgsmithjr wrote:So you make a block pattern lets say a castle then instead of rebuilding the castle in another spot it's a keystroke away?
Well not a keystroke but you definitely wouldn't have to rebuild your castle. You could use the //stack command to duplicate it or use //save and //load to put a copy anywhere you like.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

RabbiBob wrote:
Death Dealer wrote:
RabbiBob wrote:First: can't believe I have just gotten around to installing this and playing with it. Very nice!
Second: Anyone sharing .we files?
i will sha5re my 5 mese hotel if your interested.
Yeah, that'd be good. I'm still a n00b with it and I'm curious to understand better the .we layout. If I see something more complex than I'm able to make in testing, that may help.
Ok I will upload and post here when I get to my computer.
Keep calm and code python^_^

User avatar
maddogg
Member
Posts: 27
Joined: Wed Dec 21, 2011 23:55

by maddogg » Post

lkjoel wrote:I'm using linux, and I did try //p set, and it still didn't work (I punched two different objects). Nothing seems to show up.
:( i am also gettin this

User avatar
sfan5
Moderator
Posts: 3933
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Whats the Chat-Output when you enter //p set ?
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
celeron55
Administrator
Posts: 465
Joined: Tue Apr 19, 2011 10:10
GitHub: celeron55
IRC: celeron55

by celeron55 » Post

Here's a very quick worldedit patch I used on my server today:

Code: Select all

diff -rupN worldedit/init.lua worldedit_modified/init.lua
--- worldedit/init.lua  2012-02-24 21:31:10.000000000 +0200
+++ worldedit_modified/init.lua 2012-04-09 02:39:29.000000000 +0300
@@ -3,6 +3,7 @@ print("[WorldEdit] Loading Table-Save/Lo
 dofile(minetest.get_modpath("worldedit").."/table_save-load.lua")
 assert(table.save ~= nil)
 assert(table.load ~= nil)
+minetest.register_privilege("worldedit", "can use worldedit")
 -- Functions
 function get_tmp(name)
     local f = io.open("wetemp_" .. name .. ".txt", "r")
@@ -50,6 +51,9 @@ function string:split(delimiter)
   return result
 end
 function check_player_we_perms(pname)
+    if minetest.get_player_privs(pname).worldedit then
+        return true
+    end
     local fi = ""
     local f = io.open("weperms.txt", "r")
     if f ~= nil then
That is how to add a privilege and check it in the latest API (0.4.dev-20120408). You'll probably want to remove the weperms file completely though; I didn't bother.

Also, you might want to use the new chatcommand API; here is a quick quote from doc/lua_api.txt. See builtin/chatcommands.lua for examples.

Code: Select all

minetest.register_chatcommand(cmd, chatcommand definition)

Chatcommand definition (register_chatcommand)
{
    params = "<name> <privilege>", -- short parameter description
    description = "Remove privilege from player", -- full description
    privs = {privs=true}, -- require the "privs" privilege to run
    func = function(name, param), -- called when command is run
}                                          

User avatar
lkjoel
Member
Posts: 779
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey
Contact:

by lkjoel » Post

sfan5 wrote:Whats the Chat-Output when you enter //p set ?
I found the problem. It's because we are storing the mods in a global directory, where us users have no permission to change. I'm halfway done fixing that, and then I'll post a patch for you :)
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.

User avatar
lkjoel
Member
Posts: 779
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey
Contact:

by lkjoel » Post

Here is the dirty patch to fix the problem of not being able to set P1 and P2 (you will want to change it, but I hope it gives you an idea of what to do: USE TEMP FILES!):

Code: Select all

6a6,8
> thetemppos1 = os.tmpname() .. "pos1"
> thetemppos2 = os.tmpname() .. "pos2"
> thetemppostoset = os.tmpname() .. "postoset"
9c11,19
<     local f = io.open(minetest.get_modpath("worldedit").."/wetemp_" .. name .. ".txt", "r")
---
>     filename = ""
>     if string.sub(name, 0, 4) == "pos1" then
>         filename = thetemppos1
>     elseif string.sub(name, 0, 4) == "pos2" then
>         filename = thetemppos2
>     else
>         filename = thetemppostoset
>     end
>     local f = io.open(filename, "r")
17c27,35
<     local f = io.open(minetest.get_modpath("worldedit").."/wetemp_" .. name .. ".txt", "w")
---
>     filename = ""
>     if string.sub(name, 0, 4) == "pos1" then
>         filename = thetemppos1
>     elseif string.sub(name, 0, 4) == "pos2" then
>         filename = thetemppos2
>     else
>         filename = thetemppostoset
>     end
>     local f = io.open(filename, "w")
Anyways, it works.
Last edited by lkjoel on Mon Apr 09, 2012 17:41, edited 1 time in total.
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.

User avatar
sfan5
Moderator
Posts: 3933
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

celeron55 wrote:Here's a very quick worldedit patch I used on my server today:

Code: Select all

diff -rupN worldedit/init.lua worldedit_modified/init.lua
--- worldedit/init.lua  2012-02-24 21:31:10.000000000 +0200
+++ worldedit_modified/init.lua 2012-04-09 02:39:29.000000000 +0300
@@ -3,6 +3,7 @@ print("[WorldEdit] Loading Table-Save/Lo
 dofile(minetest.get_modpath("worldedit").."/table_save-load.lua")
 assert(table.save ~= nil)
 assert(table.load ~= nil)
+minetest.register_privilege("worldedit", "can use worldedit")
 -- Functions
 function get_tmp(name)
     local f = io.open("wetemp_" .. name .. ".txt", "r")
@@ -50,6 +51,9 @@ function string:split(delimiter)
   return result
 end
 function check_player_we_perms(pname)
+    if minetest.get_player_privs(pname).worldedit then
+        return true
+    end
     local fi = ""
     local f = io.open("weperms.txt", "r")
     if f ~= nil then
That is how to add a privilege and check it in the latest API (0.4.dev-20120408). You'll probably want to remove the weperms file completely though; I didn't bother.

Also, you might want to use the new chatcommand API; here is a quick quote from doc/lua_api.txt. See builtin/chatcommands.lua for examples.

Code: Select all

minetest.register_chatcommand(cmd, chatcommand definition)

Chatcommand definition (register_chatcommand)
{
    params = "<name> <privilege>", -- short parameter description
    description = "Remove privilege from player", -- full description
    privs = {privs=true}, -- require the "privs" privilege to run
    func = function(name, param), -- called when command is run
}                                          
I'll merge your Patch
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
VanessaE
Moderator
Posts: 4539
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

I'm having trouble using this mod (using WE v0.4 from the link on the OP)...

I wanted to copy part of one world (which I'm pretty sure was generated with 0.3) over to a new environment, so I loaded the world with the stuff I wanted to copy, navigated around and set //pos1 and //pos2 at opposite corners of the "box" I was interested in (a region about 40 x 65 x 200 nodes in size), did a //save filename which went okay, or so I gathered. I then exited back to the main menu, created and started playing in a new world, navigated to where I wanted to paste what was saved, and tried to issue load the saved file.

The game aborted without modifying the new world, leaving these messages on the controlling terminal:

12:25:09: ACTION[ServerThread]: singleplayer leaves game. List of players:
12:25:09: ERROR[main]: ServerError: LuaError: error: ...e/vanessa/.minetest/mods/minetest/worldedit/init.lua:383: attempt to get length of global 'data' (a nil value)
12:25:09: ERROR[main]: stack traceback:
Quit message received.

(I clicked "Proceed", which took me back to the main menu, and then I just closed the game.)

I tried this in both survival mode and creative mode. Using minetest 0.4 (20120416) from the PPA.
Last edited by VanessaE on Wed Apr 25, 2012 16:52, edited 1 time in total.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
sfan5
Moderator
Posts: 3933
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Paste your saved WorldEdit File
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
VanessaE
Moderator
Posts: 4539
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

http://digitalaudioconcepts.com/vanessa ... st/home.we

How it got inflated to 74 MB with such a relatively small block being copied, you got me :-)
Last edited by VanessaE on Wed May 02, 2012 22:51, edited 1 time in total.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
sfan5
Moderator
Posts: 3933
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Try saving and pasting again
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests