[Mod] WorldEdit [1.0] [worldedit]

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

Re:

by Temperest » Sun Apr 20, 2014 03:02

Krock wrote:
Temperest wrote:[*]In that game folder (make sure there's a "game.conf" file in there), make a file called "minetest.conf". In that file write "mg_flags = flat".[/*]

.. or just open minetest.conf in the minetest folder and change it there. Or get "a" flatgen mod if you are too lazy for this.


Hey Krock:

That works, but as I stated above, this causes the setting to be changed for all available worlds. The flatgen mod, in addition, is significantly slower than the native flat mapgen, at least in my experiences. As always, it is good to have options though.

CWz, I will take a look at that as soon as possible.
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Sun May 18, 2014 14:00

Would it be difficult to add a feature to worldedit so you can pretest installing a schem file? This would then list any missing mods and move the pos1 and pos2 markers to enclose the zone the new mod would be installed.
[EDIT: listing missing nodes would be a slight enhancement to the current //allocate function, which already locates the markers]

Worldedit also seems to silently fail to load or save files if there is no pre-existing schem folder in the world folder. This should be an easy fix if worldedit could check and automatically create it (or at least warn of the failure) if it wasn't present. [EDIT: see below, I think this might be a mod conflict]
Last edited by dgm5555 on Thu May 22, 2014 13:52, edited 2 times in total.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by Sokomine » Sun May 18, 2014 17:32

dgm555 wrote:Would it be difficult to add a feature to worldedit so you can pretest installing a schem file? This would then list any missing mods and move the pos1 and pos2 markers to enclose the zone the new mod would be installed.

At least the "identify unkown blocks" part could be done quite well. I've added code to read minetest schematic files to a degree. Things like size and nodes used are pretty straightforward. The rest is unfortionately a gzip-stream. and there's no way to decode that without additional libs. However, reading the node names would be sufficient for what you asked for.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by sfan5 » Sun May 18, 2014 19:57

dgm5555 wrote:Worldedit also seems to silently fail to load or save files if there is no pre-existing schem folder in the world folder. This should be an easy fix if worldedit could check and automatically create it (or at least warn of the failure) if it wasn't present.

WorldEdit attempts to create the schems dir with mkdir. If this fails there is no portable way left of creating a directory.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Wed May 21, 2014 10:04

I've been making sections of wall, road/paths, roof, corridors, etc. ie things which are basically repetitive, but randomly change orientation or location. Therefore I can't easily use //copy //move or //rotate, as the orientation can't be defined, and would like to use player location to positioning much more easily.
I like to essentially develop a script to ease most of the work, as below, but have a couple of problems:
One problem is I can't figure out how WE translates and rotates a schem file relative to the pos locations when WE loads it. It doesn't seem to depend on the pos1/pos2 orientation, or player yaw.
Secondly I also can't figure out how to reset pos1/2 to exactly mark the just loaded section so I can then rotate it appropriately

I'd therefore like a shorthand (ideally a short chat command or hotkey) way of doing essentially the following sequence:-
set pos1 to player current location (possibly with a defined offset - in case the player can't stand exactly where needed eg for foundations etc)
set rotation based on player yaw (direction facing)
set pos2 (if needed) based on above location and rotation.
move the player forward far enough to move out of the load zone (ideally set from the schem file size, but otherwise could probably be a set amount - eg 1 or 2 nodes.
load so minX,minY,minZ for the schem file is at pos1
If needed rotation based on player direction (as above).
Ideally I would like to be able to extract the dimensions from the file so I could x/y/z offset it (useful if foundations etc required, so player can't stand at location of origin)
[then move to next location and repeat]...
I'm guessing some sort of //lua <code> would do it, but perhaps better would be defining my own chat command which loads the lua sequence from a file I can edit while in a game (since I don't want to reload the map each time I make a small edit, and can't copy and paste to the chat bar).
If anyone's done basically all this so I can copy code, I'd really appreciate it, else a few pointers to get me started would be much appreciated...

Also:-
sfan5 wrote:WorldEdit attempts to create the schems dir with mkdir. If this fails there is no portable way left of creating a directory.

Would it be possible to not fail silently - ie warn that the file was not created (or if somewhere random then note where). On my Ubuntu 14.04 if there is no pre-existing schem folder WE fails, but still produces a chat message implying that the file was saved.
[EDIT: actually looked at the code in the worldedit_commands/init.lua and realised that it is actually making a folder and warning, and turns out it works on a blank world, some must be some sort of mod conflict, I'll have a little play and see if I can figure it out.]
Last edited by dgm5555 on Thu May 22, 2014 13:34, edited 1 time in total.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by Sokomine » Wed May 21, 2014 19:53

Some of my mods place schematics based on the player's facedir. My apartments mod can also store schematics if you precede an apartment name with save_as_. The build chest from my random_buildings mod also spawns blueprints according to facedir, although that build chest is undergoing some rework. Perhaps it'll help you finding the right parameters for your own mod.
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Thu May 22, 2014 15:33

The following code adds listing of missing mods to the //allocate function:
Replace the for index loop with the following text in the allocate function (approx line 167 of WorldEdit/worldedit/serialization.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
      local missingMods = ""
      for index = 1, count do
         local entry = nodes[index]
         x, y, z = originx + entry.x, originy + entry.y, originz + entry.z
         if x < pos1x then pos1x = x end
         if y < pos1y then pos1y = y end
         if z < pos1z then pos1z = z end
         if x > pos2x then pos2x = x end
         if y > pos2y then pos2y = y end
         if z > pos2z then pos2z = z end
         local colonLoc = string.find(entry.name, ":")
         if colonLoc ~= nil then
            local curMod = entry.name:sub(0,colonLoc-1)
            if not string.find(missingMods, (curMod.. ";")) then
               if not minetest.get_modpath(curMod) then
                  missingMods = missingMods.. curMod.. "; "
               end
            end
         end         
      end
      if string.len(missingMods) ~= 0 then
         print("Worldedit file dependencies include the following missing mods:")
         print(missingMods)
         minetest.chat_send_player("singleplayer", "Worldedit file dependencies include the following missing mods: ".. missingMods, false)
      end


PS If people think it's reasonable code, I can add it as a pull request on the git hub. It currently only sends the chat to singleplayer, but sending it to the current user would only require a slightly larger change to the code (eg by returning missingMods and displaying the message from WorldEdit/worldedit_commands/init.lua:minetest.register_chatcommand("/allocate", {
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Thu May 22, 2014 19:54

The following code adds schem loads aligned to player forward direction. The functions are minor modifications of the original register //load and function load with added support for alignment relative to player:-
The chat command is "//loadalign filename"
NB //allocate will fail to correctly mark the load zone with this command unless you are facing north!
PS: only pos1 (the origin) is required to be set (this is actually also the case for the //load function)
[If I get a chance - next week, I'll add in using the players location to set pos1 if not already set, and possibly also automatically setting pos1/2 to the load-zone for further transformation].
The zone is loaded forward and to the right of the player. origin of the file is set at *save* time - I need to check, but I think as minx,miny,minz, (ie not necessarily at the location of either pos1 or pos2).
The code has only been tested on schem version4, so I'm not 100% sure it works with files saved with an earlier worldedit version.

Paste this at the end of WorldEdit/worldedit_commands/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
minetest.register_chatcommand("/loadalign", {
   params = "<file>",
   description = "Load nodes from \"(world folder)/schems/<file>[.we[m]]\" with position 1 of the current WorldEdit region as the origin",
   privs = {worldedit=true},
   func = function(name, param)
      local pos = get_position(name)
      if pos == nil then return end

      if param == "" then
         worldedit.player_notify(name, "invalid usage: " .. param)
         return
      end
      if not string.find(param, "^[%w \t.,+-_=!@#$%%^&*()%[%]{};'\"]+$") then
         worldedit.player_notify(name, "invalid file name: " .. param)
         return
      end

      --find the file in the world path
      local testpaths = {
         minetest.get_worldpath() .. "/schems/" .. param,
         minetest.get_worldpath() .. "/schems/" .. param .. ".we",
         minetest.get_worldpath() .. "/schems/" .. param .. ".wem",
      }
      local file, err
      for index, path in ipairs(testpaths) do
         file, err = io.open(path, "rb")
         if not err then
            break
         end
      end
      if err then
         worldedit.player_notify(name, "could not open file \"" .. param .. "\"")
         return
      end
      local value = file:read("*a")
      file:close()

      if worldedit.valueversion(value) == 0 then --unknown version
         worldedit.player_notify(name, "invalid file: file is invalid or created with newer version of WorldEdit")
         return
      end

      local yaw = minetest.get_player_by_name(name):get_look_yaw()
      if yaw ~= nil then
         -- Find angle player facing to enable rotation of position arrow based on yaw.
         yaw = math.deg(yaw)
         yaw = math.fmod (yaw, 360)
         if yaw<0 then yaw = 360 + yaw end
         if yaw>360 then yaw = yaw - 360 end           
         if yaw>315 or yaw<=45 then
            rotation="e"
         elseif yaw>45 and yaw<=135 then
            rotation="n"
         elseif yaw>135 and yaw<=225 then
            rotation="w"
         elseif yaw>225 and yaw<=315 then
            rotation="s"
         end
      end
      print (yaw)
      print (rotation)

      local count = worldedit.deserializeAligned(pos, value, rotation)

      worldedit.player_notify(name, count .. " nodes loaded")
   end,
})



Paste this at the end of WorldEdit/worldedit/serialization.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
--loads the nodes represented by string `value` at position `originpos`, returning the number of nodes deserialized
--contains code based on [table.save/table.load](http://lua-users.org/wiki/SaveTableToFile) by ChillCode, available under the MIT license (GPL compatible)
worldedit.deserializeAligned = function(originpos, value, rotation)
   --make area stay loaded
   local pos1, pos2 = worldedit.allocate(originpos, value)
   local manip = minetest.get_voxel_manip()
   manip:read_from_map(pos1, pos2)

   local originx, originy, originz = originpos.x, originpos.y, originpos.z
   local count = 0
   local add_node, get_meta = minetest.add_node, minetest.get_meta
   local version = worldedit.valueversion(value)
   if version == 1 or version == 2 then --original flat table format
      --obtain the node table
      local get_tables = loadstring(value)
      if not get_tables then --error loading value
         return count
      end
      local tables = get_tables()

      --transform the node table into an array of nodes
      for i = 1, #tables do
         for j, v in pairs(tables[i]) do
            if type(v) == "table" then
               tables[i][j] = tables[v[1]]
            end
         end
      end
      local nodes = tables[1]

      --load the node array
      count = #nodes
      if version == 1 then --original flat table format
         for index = 1, count do
            local entry = nodes[index]
            local pos = entry[1]
            if rotation == "w" then
               pos.x, pos.y, pos.z = originx + pos.z, originy - pos.y, originz - pos.x
            elseif rotation == "e" then
               pos.x, pos.y, pos.z = originx - pos.z, originy - pos.y, originz + pos.x
            elseif rotation == "s" then
               pos.x, pos.y, pos.z = originx + pos.x, originy - pos.y, originz + pos.z
            else
               pos.x, pos.y, pos.z = originx - pos.x, originy - pos.y, originz - pos.z
            end
--            pos.x, pos.y, pos.z = originx - pos.x, originy - pos.y, originz - pos.z
            add_node(pos, entry[2])
         end
      else --previous meta flat table format
         for index = 1, #nodes do
            local entry = nodes[index]
            if rotation == "w" then
               entry.x, entry.y, entry.z = originx - entry.z, originy + entry.y, originz + entry.x
            elseif rotation == "e" then
               entry.x, entry.y, entry.z = originx + entry.z, originy + entry.y, originz - entry.x
            elseif rotation == "s" then
               entry.x, entry.y, entry.z = originx - entry.x, originy + entry.y, originz - entry.z
            else
               entry.x, entry.y, entry.z = originx + entry.x, originy + entry.y, originz + entry.z
            end
--            entry.x, entry.y, entry.z = originx + entry.x, originy + entry.y, originz + entry.z

            add_node(entry, entry) --entry acts both as position and as node
            get_meta(entry):from_table(entry.meta)
         end
      end
   elseif version == 3 then --previous list format
      local pos = {x=0, y=0, z=0}
      local node = {name="", param1=0, param2=0}
      for x, y, z, name, param1, param2 in value:gmatch("([+-]?%d+)%s+([+-]?%d+)%s+([+-]?%d+)%s+([^%s]+)%s+(%d+)%s+(%d+)[^\r\n]*[\r\n]*") do --match node entries
         if rotation == "w" then
            pos.x, pos.y, pos.z = originx - tonumber(z), originy + tonumber(y), originz + tonumber(x)
         elseif rotation == "e" then
            pos.x, pos.y, pos.z = originx + tonumber(z), originy + tonumber(y), originz - tonumber(x)
         elseif rotation == "s" then
            pos.x, pos.y, pos.z = originx - tonumber(x), originy + tonumber(y), originz - tonumber(z)
         else
            pos.x, pos.y, pos.z = originx + tonumber(x), originy + tonumber(y), originz + tonumber(z)
         end
--         pos.x, pos.y, pos.z = originx + tonumber(x), originy + tonumber(y), originz + tonumber(z)
         node.name, node.param1, node.param2 = name, param1, param2
         add_node(pos, node)
         count = count + 1
      end
   elseif version == 4 then --current nested table format
      --wip: this is a filthy hack that works surprisingly well
      value = value:gsub("return%s*{", "", 1):gsub("}%s*$", "", 1)
      local escaped = value:gsub("\\\\", "@@"):gsub("\\\"", "@@"):gsub("(\"[^\"]*\")", function(s) return string.rep("@", #s) end)
      local startpos, startpos1, endpos = 1, 1
      local nodes = {}
      while true do
         startpos, endpos = escaped:find("},%s*{", startpos)
         if not startpos then
            break
         end
         local current = value:sub(startpos1, startpos)
         table.insert(nodes, minetest.deserialize("return " .. current))
         startpos, startpos1 = endpos, endpos
      end
      table.insert(nodes, minetest.deserialize("return " .. value:sub(startpos1)))

      --local nodes = minetest.deserialize(value) --wip: this is broken for larger tables in the current version of LuaJIT

      --load the nodes
      count = #nodes
      for index = 1, count do
         local entry = nodes[index]
         if rotation == "w" then
            entry.x, entry.y, entry.z = originx - entry.z, originy + entry.y, originz + entry.x
         elseif rotation == "e" then
            entry.x, entry.y, entry.z = originx + entry.z, originy + entry.y, originz - entry.x
         elseif rotation == "s" then
            entry.x, entry.y, entry.z = originx - entry.x, originy + entry.y, originz - entry.z
         else
            entry.x, entry.y, entry.z = originx + entry.x, originy + entry.y, originz + entry.z
         end
--         entry.x, entry.y, entry.z = originx + entry.x, originy + entry.y, originz + entry.z
         add_node(entry, entry) --entry acts both as position and as node
      end

      --load the metadata
      for index = 1, count do
         local entry = nodes[index]
         get_meta(entry):from_table(entry.meta)
      end
   end
   return count
end
 

User avatar
davi54l
Member
 
Posts: 16
Joined: Sun Apr 13, 2014 16:21

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by davi54l » Fri May 23, 2014 19:08

How to set position 1?
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by cHyper » Fri May 23, 2014 19:25

davi54l wrote:How to set position 1?


//pos1
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by sfan5 » Fri May 23, 2014 19:58

dgm5555 wrote:{contributions}

Could you fork WorldEdit on github and send a Pull Request?
It makes it easier to integrate these changes.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

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

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by Temperest » Fri May 23, 2014 20:16

cHyper wrote:
davi54l wrote:How to set position 1?


//pos1


Also try the shorter version of the command, //1, if you have worldedit_shortcommands - it's included by default.

It probably would be a good idea to add a feature that lists missing mods in a region. It won't be too difficult to integrate your changes.

Giving an error if the directory can't be created is actually supposed to be the current behavior. What OS are you running, dgm5555? I guess there's some debugging to do...

As for your shorthand sequence, I think you can probably accomplish that using something like the following:

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
//lua w,m,n=worldedit,minetest,"singleplayer";w.pos1[n]=m.get_player_by_name(n):getpos();REST_GOES_HERE


If you need any help constructing the proper command, let me know (preferably via GitHub issues, I check those more often). As sfan5 said, these are great contributions, but please submit them via GitHub so we can review it properly!
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Sun May 25, 2014 19:46

Temperest wrote:Giving an error if the directory can't be created is actually supposed to be the current behavior. What OS are you running, dgm5555? I guess there's some debugging to do...

I'm Ubuntu 14.04, but I'm thinking it could be a mod conflict, as it only happens on some worlds, when I get a chance I'll try to identify which one.
 

User avatar
ak399g
Member
 
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by ak399g » Mon May 26, 2014 16:34

Is there a way to copy in multiple directions? Like, if I wanted to copy a building 30 x nodes and 20 z nodes?
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by sfan5 » Mon May 26, 2014 17:04

ak399g wrote:Is there a way to copy in multiple directions? Like, if I wanted to copy a building 30 x nodes and 20 z nodes?

Just select the area with the building, there is no need for any fiddling with directions.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Mon May 26, 2014 18:41

sfan5 wrote:
ak399g wrote:Is there a way to copy in multiple directions? Like, if I wanted to copy a building 30 x nodes and 20 z nodes?

Just select the area with the building, there is no need for any fiddling with directions.

[ak399g]: Alternatively, do you mean you have a saved file of (say) 5x5x5 nodes, and you want to copy it 30 times along the x axis and 20 times along the z axis (ie generate 600 copies of the original). I'm not an expert on sequential commands, so I would have copied it 30 times along the x axis then reselect the block containing all 30 copies, then copy along the 20 times along the x axis (but yes this would be 2 operations)
 

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

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by Temperest » Mon May 26, 2014 20:57

Hi ak399g, I would recommend you copy in one axis, then move in the other axis. If you meant duplicate 600 times as dgm5555 stated, try using //stack in one direction, select the whole stacked area, then stack in the second direction.

You can also do this all in one operation using //lua, but this is more complicated.

If space is tight and it really must be copied and pasted, try using //save and //load. Make sure you use //allocate to avoid any accidents.
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Mon May 26, 2014 21:54

I've created a pull request on github for my changes. Essentially:-
1. add /loadalign load with player orientation. After doing this I realised it would probably have been easier to use existing code and set it up as sequential save1(temp space for load2/flip2/transpose2), set1=air, load2(into 1), flip2, transpose2, load1(back in) operations, but I didn't think of it earlier, it would have been slower, and it would have been a bit of a hastle saving and restoring the regions the loaded region damaged as it moved through.
2. add reporting of missing mods to /allocate (to version 4 files only). It's also added for /load and /loadalign, but is hidden by errors caused by attempting to add nodes from missing mods (which I will fix in the next few days)
Code is not the same as my above posts, and has been significantly enhanced/bug-tested for version 4 files, but not for other formats.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by Sokomine » Tue May 27, 2014 13:28

ak399g wrote:Is there a way to copy in multiple directions? Like, if I wanted to copy a building 30 x nodes and 20 z nodes?

A quick way to do this is to use my apartments mod. Use "/giveme apartment:apartment", place the control panel on your building, access the form, enter the dimensions of your buildings, use "save_as_buildingname" as the apartment name in order to save it. Then use "/giveme apartment:build_chest", place that chest, enter "buildingname_0_0" (or whatever was shown to you as filename after you did the above save) and fill out the form for copies to the left and upwards. You can also get rid of the copies of your building by digging the build chest. Note: The first 0 encodes how deep the building is burried into the ground, and the second 0 encodes original facedir/orientation (0, 90, 180 or 270).
 

User avatar
ak399g
Member
 
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by ak399g » Wed May 28, 2014 20:32

dgm5555 wrote:
sfan5 wrote:
ak399g wrote:Is there a way to copy in multiple directions? Like, if I wanted to copy a building 30 x nodes and 20 z nodes?

Just select the area with the building, there is no need for any fiddling with directions.

[ak399g]: Alternatively, do you mean you have a saved file of (say) 5x5x5 nodes, and you want to copy it 30 times along the x axis and 20 times along the z axis (ie generate 600 copies of the original). I'm not an expert on sequential commands, so I would have copied it 30 times along the x axis then reselect the block containing all 30 copies, then copy along the 20 times along the x axis (but yes this would be 2 operations)

Sorry if that wasn't clear.

Say I have a building between [10 10 10] and [20 20 20]. I know how to //copy it, say, 30 nodes along the x axis, so that the copy is located at [40 10 10] and [50 20 20]. I could then //copy that new building from [40 10 10] and [50 20 20] 20 nodes along the z axis, so that the second copy is located at [40 10 30] and [50 20 40]. I want to be able to //copy it along both x and z axes without doing two steps; i.e., going straight from [10 10 10] and [20 20 20] to [40 10 30] and [50 20 40].

In other terms, I can do a translation along a single axis, be it x or z (or y), but I want to do a translation across multiple axes at once.

I suppose I could "//save" and then "//load" but that seems convoluted. I also suppose I could //copy along x and then //move along z, but it'd be nice if I could do something like "//copy xz 30 20"
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Sun Jun 01, 2014 08:35

Wondering about adding nodename aliases to the code to save having to repeatedly type in massive node names (try and correctly guess/type some of the 20-long node names created by scripts). You could run the command (eg /na n1 [nodename] -- n1 would be the alias, and if no name is supplied then you can punch a node to link. Aliases would then be stored in a table which could then be used for /set, /replace, and the various shape generators. Does anyone have any thoughts/extensions on the idea (or has it already been done elsewhere)?
 

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

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by Temperest » Mon Jun 09, 2014 05:56

I'm not sure that is necessary - did you know WE supports typing out partial names, and even by description?

That means you can do "//set Cobblestone" or "//set Blue Lightstone". This was added precisely because of really long node names!
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by dgm5555 » Sat Jun 14, 2014 15:51

Temperest wrote:I'm not sure that is necessary - did you know WE supports typing out partial names, and even by description?

The trouble is some of the scripts generating nodes (eg the castle mod but others too) create long names which don't vary by much so you still have to type out the entire name. Similar randomness happens if a script happens to use the same name for a node as another mod (eg "snow" defines a number of different potential nodes), so you end up having to use the entire long name which is a pain. Being able to define aliases would be much easier, and I think to code it would be a pretty small addition primarily to the worldedit.normalize_nodename function (especially in the absence of a cut and paste function for the chatbar).
 

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by addi » Wed Jul 09, 2014 21:29

I just want to say, that the worldedit GUI does not work with minetest 0.4.10

clicking a button does exit the formspec but it does no action.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by webdesigner97 » Thu Jul 10, 2014 15:52

addi wrote:I just want to say, that the worldedit GUI does not work with minetest 0.4.10

clicking a button does exit the formspec but it does no action.

I thought it's because I used it in a custom gamemode ;) But if you also experience this, then it seems to be a general problem, so I can confirm that.
 

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by addi » Thu Jul 10, 2014 16:14

it works good with 0.4.9 stable, but does not work with 0.4.10.

it seems something is wrong with the client, because you just need a 0.4.9 client and a 0.4.10 server and it works well, but with a 0.4.10 client on a 0.4.9 server it does not work.
 

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

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by Temperest » Fri Jul 11, 2014 00:19

Hey addi & webdesigner97:

This should be fixed now if you download the latest version from GitHub. Thanks for reporting!
 

User avatar
SB66
New member
 
Posts: 8
Joined: Sat May 17, 2014 17:50

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by SB66 » Fri Jul 18, 2014 16:40

Hi,

had also the same problem with a not working worldEdit under 0.4.10, downloaded the latest github Version, now it works but it seems there is still a problem with World edit under 0.4.10, at least for me :)

have some trouble with the function set nodes.
If I want set nodes with a single word name like "stone" or "dirt" it works as it should.
If I want for example set "dirt with grass" , nothing happens....
and I get the message :
invalid node name : with
could not identify node "singleplayer"


Image



another one : "sandstone brick"
this one has a funny effect ....
I got a mixture between "Sandstone" and "Brick Block"
looks nice but not what i wanted :D

Image







Edit :
I have the same issues also with a 0.4.9 dev Version




.
Last edited by SB66 on Fri Jul 18, 2014 16:59, edited 1 time in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by Krock » Fri Jul 18, 2014 16:58

@above: names for nodes are: (example)
default:dirt_with_grass
default:sandstonebrick
default:steel_ingot
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
SB66
New member
 
Posts: 8
Joined: Sat May 17, 2014 17:50

Re: [Mod] WorldEdit [1.0] [worldedit] {GitHub}

by SB66 » Fri Jul 18, 2014 17:03

Krock wrote:@above: names for nodes are: (example)
default:dirt_with_grass
default:sandstonebrick
default:steel_ingot



ok thanks
is there a possibility to see those names ingame?

didn't had these issues before in the previous versions of WorldEdit
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 50 guests

cron