[Modpack] WorldEdit [worldedit]
Guest2: yes, I'm currently in the process of doing exactly that. It's coming along pretty nicely right now. The structure is a bit simpler though, with an API mod, a chat interface mod, and the future Multinode interface for those familiar with that mod.
cornernote: you mean processing the nodes in batches? That could definitely work, though what I think jordan4ibanez meant was that for loops are faster than while loops. Some research tells me that this seems to be true, so I will be investigating that pretty soon.
Offtopic: I've committed your T-FF changes cornernote, but I will need to wait until tomorrow or the day after to push.
cornernote: you mean processing the nodes in batches? That could definitely work, though what I think jordan4ibanez meant was that for loops are faster than while loops. Some research tells me that this seems to be true, so I will be investigating that pretty soon.
Offtopic: I've committed your T-FF changes cornernote, but I will need to wait until tomorrow or the day after to push.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
i don't think the speed of the loop impacts performance. Its only looping a few thousand times at most. to highlight this, run the loop, but comment out the code that adds the node.
I think the performance hit is when the node has to be added to the world (a few thousand nodes at once).
I think the performance hit is when the node has to be added to the world (a few thousand nodes at once).
Last edited by cornernote on Mon Oct 08, 2012 03:46, edited 1 time in total.
My tests indicate that for loops indeed have no noticable performance impact on the WorldEdit API. In fact, it seems a bit slower than the current one.
I guess that means we'll keep it the way it is, then.
I guess that means we'll keep it the way it is, then.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
Update:
- Chat command interface has been split off of the main WorldEdit API. The WorldEdit API is in the "worldedit" mod, and the chat commands are in the "worldedit_commands" mod.
- New visualization functions and commands: //hide, //suppress, //find, and //restore all work with nodes non-destructively, so you can peek inside your Mesecon monstrosity and find that one node you're looking for. Also accessible from the WorldEdit API! For maximum ease of use, metadata is supported right out of the box.
- Everything is documented in relevant categories, and the WorldEdit API and chat commands get their own files.
Last edited by Temperest on Sun Oct 14, 2012 02:01, edited 1 time in total.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
Yep, the chat command interface is fully backwards compatible, while the API has been backwards compatible except for one early release that changed deserialization behavior along with the new WE file format.
I've given a shot at updating your worldedit_gui mod, but didn't have much luck. I might look into it more tomorrow.
I've given a shot at updating your worldedit_gui mod, but didn't have much luck. I might look into it more tomorrow.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
- Pythagoras
- Member
- Posts: 14
- Joined: Mon Nov 05, 2012 00:29
- Location: Vienna
it may be a nice idea if someone could create some kind of schematics gallery where everyone can upload and get templates of different kind. this could be pretty much complementary to the primitives.
maybe i have some time to code that, but there could be a person with more time who is waiting for this very idea .
maybe i have some time to code that, but there could be a person with more time who is waiting for this very idea .
I'm working on rewriting it - in the future it will be included with WorldEdit itself. I've already obtained permission from cornernote to use inventory_plus in the mod pack.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
O no rotate messed up my lovely tower.
//rotate y 90
It looks like random blocks were moved, blocks allso ended up completely outside the region i selected.
Dont worry about the tower I have a .we backup.
Is there anything I can do to help find out what was wrong?
(I have a backup of the world in its curent state if you want to analyse. I am afraid I did try to rotate back whitch made it worse)
I used ¨Uberi-MineTest-WorldEdit-426dfb0¨ downloaded today
Minetest version ¨minetestc55_201211041952-0~1730~precise1_amd64¨ but it says 0.4.3 on the screen in the game is that normal?
[EDIT] More experiments show the problem may be in the transpose function. I will attempt to sort it out. [END EDIT]
[EDIT 2]
hurrah! It apears there was a small error in the transpose function. I changed 1 line and now it works as expected for me. Please verrify that it now works as intended, and update.
[END EDIT 2]
[EDIT 3]
There is still an isue left. transpose works if the selected area is square or longer in 1 direction but if it is longer in the other direction nothing happens
[END EDIT 3]
Cheers Smitje
//rotate y 90
It looks like random blocks were moved, blocks allso ended up completely outside the region i selected.
Dont worry about the tower I have a .we backup.
Is there anything I can do to help find out what was wrong?
(I have a backup of the world in its curent state if you want to analyse. I am afraid I did try to rotate back whitch made it worse)
I used ¨Uberi-MineTest-WorldEdit-426dfb0¨ downloaded today
Minetest version ¨minetestc55_201211041952-0~1730~precise1_amd64¨ but it says 0.4.3 on the screen in the game is that normal?
[EDIT] More experiments show the problem may be in the transpose function. I will attempt to sort it out. [END EDIT]
[EDIT 2]
hurrah! It apears there was a small error in the transpose function. I changed 1 line and now it works as expected for me. Please verrify that it now works as intended, and update.
Code: Select all
--transposes a region defined by the positions `pos1` and `pos2` between the `axis1` and `axis2` axes, returning the number of nodes transposed
worldedit.transpose = function(pos1, pos2, axis1, axis2)
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
local pos = {x=pos1.x, y=0, z=0}
local env = minetest.env
while pos.x <= pos2.x do
pos.y = pos1.y
while pos.y <= pos2.y do
pos.z = pos1.z
while pos.z <= pos2.z do
local extent1, extent2 = pos[axis1] - pos1[axis1], pos[axis2] - pos1[axis2]
if extent1 < extent2 then
local node1 = env:get_node(pos)
local meta1 = env:get_meta(pos):to_table()
local value1, value2 = pos[axis1], pos[axis2]
pos[axis1], pos[axis2] = pos1[axis1] + extent2, pos1[axis2] + extent1 --This line changed
local node2 = env:get_node(pos)
local meta2 = env:get_meta(pos):to_table()
env:add_node(pos, node1)
env:get_meta(pos):from_table(meta1)
pos[axis1], pos[axis2] = value1, value2
env:add_node(pos, node2)
env:get_meta(pos):from_table(meta2)
end
pos.z = pos.z + 1
end
pos.y = pos.y + 1
end
pos.x = pos.x + 1
end
return worldedit.volume(pos1, pos2)
end
[EDIT 3]
There is still an isue left. transpose works if the selected area is square or longer in 1 direction but if it is longer in the other direction nothing happens
[END EDIT 3]
Cheers Smitje
Last edited by Smitje on Thu Nov 15, 2012 21:10, edited 1 time in total.
Did some experiments.
I think the code below is correct now, however I am not sure the rotations still go in the right direction. As far as I can tell objects are not broken up any more no mater if the length or the width is larger.
only some minor changes to rotate and transpose are required (they are marked below)
please verify this works as intended before using it.
cheers Smitje
I think the code below is correct now, however I am not sure the rotations still go in the right direction. As far as I can tell objects are not broken up any more no mater if the length or the width is larger.
only some minor changes to rotate and transpose are required (they are marked below)
please verify this works as intended before using it.
cheers Smitje
Code: Select all
--transposes a region defined by the positions `pos1` and `pos2` between the `axis1` and `axis2` axes, returning the number of nodes transposed
worldedit.transpose = function(pos1, pos2, axis1, axis2)
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
if pos2[axis1]-pos1[axis1] >= pos2[axis2]-pos1[axis2] then --new
largerOrSmaler = function(n1, n2) return n1 > n2 end --new
else --new
largerOrSmaler = function(n1, n2) return n1 < n2 end --new
end --new
local pos = {x=pos1.x, y=0, z=0}
local env = minetest.env
while pos.x <= pos2.x do
pos.y = pos1.y
while pos.y <= pos2.y do
pos.z = pos1.z
while pos.z <= pos2.z do
local extent1, extent2 = pos[axis1] - pos1[axis1], pos[axis2] - pos1[axis2]
if largerOrSmaler(extent1, extent2) then --changed
local node1 = env:get_node(pos)
local meta1 = env:get_meta(pos):to_table()
local value1, value2 = pos[axis1], pos[axis2]
pos[axis1], pos[axis2] = pos1[axis1] + extent2, pos1[axis2] + extent1 --This line changed
local node2 = env:get_node(pos)
local meta2 = env:get_meta(pos):to_table()
env:add_node(pos, node1)
env:get_meta(pos):from_table(meta1)
pos[axis1], pos[axis2] = value1, value2
env:add_node(pos, node2)
env:get_meta(pos):from_table(meta2)
end
pos.z = pos.z + 1
end
pos.y = pos.y + 1
end
pos.x = pos.x + 1
end
return worldedit.volume(pos1, pos2)
end
--rotates a region defined by the positions `pos1` and `pos2` by `angle` degrees clockwise around axis `axis` (90 degree increment), returning the number of nodes rotated
worldedit.rotate = function(pos1, pos2, axis, angle)
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
local axis1, axis2
if axis == "x" then
axis1, axis2 = "z", "y"
elseif axis == "y" then
axis1, axis2 = "x", "z"
else --axis == "z"
axis1, axis2 = "y", "x"
end
angle = angle % 360
if angle == 90 then
worldedit.flip(pos1, pos2, axis2) --swapped
worldedit.transpose(pos1, pos2, axis1, axis2) --swapped
elseif angle == 180 then
worldedit.flip(pos1, pos2, axis1)
worldedit.flip(pos1, pos2, axis2)
elseif angle == 270 then
worldedit.flip(pos1, pos2, axis1) --swapped
worldedit.transpose(pos1, pos2, axis1, axis2) --swapped
end
return worldedit.volume(pos1, pos2)
end
Hey Smitje, sorry about the delay in replying. my forum notifications apparently haven't been getting through for almost an entire month. And I was wondering why there was so little activity on the forums lately...
Anyways, this is a known issue (see here: https://github.com/Uberi/MineTest-WorldEdit/issues/8), I will try your solution out when I get to a computer. Thanks for testing.
Anyways, this is a known issue (see here: https://github.com/Uberi/MineTest-WorldEdit/issues/8), I will try your solution out when I get to a computer. Thanks for testing.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
Update:
- Rotation and transposition fixed! Thanks Smitje!
- Markers are now moved to new positions when rotating/transposing.
- Small bugs fixed.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
Update:
- //replaceinverse command: replaces all nodes that are NOT a specific type of node. Also has corresponding function in WorldEdit API, worldedit.replaceinverse.
- //orient command: rotates facedir and wallmounted nodes such as furnaces, stairs, torches, and etc. around the Y-axis. Also has corresponding function in WorldEdit API, worldedit.orient.
- //lua command: runs arbitrary Lua code on the server, which can do literally anything Lua can. Also has corresponding function in WorldEdit API, worldedit.lua.
- //luatransform command: runs arbitrary Lua code on the server for each node in the WorldEdit region. Also has corresponding function in WorldEdit API, worldedit.luatransform.
- All Lua functions are sandboxed and errors will not crash MineTest. However, they do require the "server" privilege, since they can do things like read and modify files on the computer. Only give this privilege to people you trust.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
-
- Member
- Posts: 81
- Joined: Mon Jan 28, 2013 12:29
- Location: España
Hey, so what's not, but I have not seen, in the world of minecraft edit, there is an option to copy cut and paste, could be implemented?
Good Mod
Thanks a Greeting
Good Mod
Thanks a Greeting
Forgive my English, but it is the translator of google.My Spanish.
My mod:
Pictures wool 1.0 3x5 , Charcoal+Textures , Map
My mod:
Pictures wool 1.0 3x5 , Charcoal+Textures , Map
@socramazibi: in MineTest-WorldEdit, you can get the equivalent functionality using //save and //load. If you also need to preserve metadata, use //metasave and //metaload.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
- VanessaE
- Moderator
- Posts: 4655
- Joined: Sun Apr 01, 2012 12:38
- GitHub: VanessaE
- IRC: VanessaE
- In-game: VanessaE
- Location: Western NC
- Contact:
Feature request: when using the //rotate command to rotate around the y axis, any items with facedir within the rotated region should also rotate accordingly.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)
VanessaE: that is implemented in the //orient command added recently. A //rotate followed by an //orient should do the trick. It also works for Wallmounted.
Do you think //rotate should do both?
Do you think //rotate should do both?
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
- VanessaE
- Moderator
- Posts: 4655
- Joined: Sun Apr 01, 2012 12:38
- GitHub: VanessaE
- IRC: VanessaE
- In-game: VanessaE
- Location: Western NC
- Contact:
Heh. Well in that case, I withdraw my suggestion. Now, that said, all these new commands really need to be documented on the first post. It's kinda hard to know what to use if you have to dig through 10 forum pages to find out. :-)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)
VanessaE, all commands are fully documented in Chat Commands.md, as well as being listed when you use the /help command in game. /help /orient, for example, displays the description for the //orient command.
Hey sfan5, would you be willing to link to the README in the first post instead of the commands list? A whole bunch of people are missing the README
Hey sfan5, would you be willing to link to the README in the first post instead of the commands list? A whole bunch of people are missing the README
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
- VanessaE
- Moderator
- Posts: 4655
- Joined: Sun Apr 01, 2012 12:38
- GitHub: VanessaE
- IRC: VanessaE
- In-game: VanessaE
- Location: Western NC
- Contact:
Actually I wasn't aware of the Chat Commands file, and /help is of little use if you can't tell which commands belong to which mod, let alone whether any of them are what you need. :-)
I've added a link to the first post pointing to that file, for future reference.
In my opinion, the whole first post should be rewritten to be better organized, broken into sections (I'm kinda partial to how I format my mod topics :-) ), and most of the commands should be removed from the first post in favor of what is listed in Chat Commands.md.
I've added a link to the first post pointing to that file, for future reference.
In my opinion, the whole first post should be rewritten to be better organized, broken into sections (I'm kinda partial to how I format my mod topics :-) ), and most of the commands should be removed from the first post in favor of what is listed in Chat Commands.md.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)
Fixed in https://github.com/Uberi/MineTest-World ... 57ef2b0d3.
Please redownload to obtain the fix.
Please redownload to obtain the fix.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
Who is online
Users browsing this forum: No registered users and 25 guests