[Modpack] WorldEdit [worldedit]
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
I have made an extension to the player inventory to allow the player access to additional GUI screens. I made a quick mod here as an example:
http://minetest.net/forum/viewtopic.php?id=3101
I am thinking about creating a GUI for worldedit, however im not sure i'll have the time. If someone wants to work on it, please make it work with Inventory Plus
EDIT, i made the GUI:
http://minetest.net/forum/viewtopic.php?id=3112
http://minetest.net/forum/viewtopic.php?id=3101
I am thinking about creating a GUI for worldedit, however im not sure i'll have the time. If someone wants to work on it, please make it work with Inventory Plus
EDIT, i made the GUI:
http://minetest.net/forum/viewtopic.php?id=3112
Last edited by cornernote on Tue Sep 18, 2012 07:14, edited 1 time in total.
Neat! I think it should stay a separate mod to reduce dependencies and keep everything modular.
Will definitely be using that, very nifty.
Will definitely be using that, very nifty.
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.
you guys rock! but wouldnt it be better to merge the worldedit and worldedit gui into one? This could solve the depencies problem. Lets guess a new release will kicked out and the gui isnt able to handle for some reasons ... just a thinking of ...
Last edited by fgr on Wed Sep 19, 2012 08:02, edited 1 time in total.
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
[request]
can we have a sphere shape?
can we have a sphere shape?
Code: Select all
-- sphere or hollow sphere - (based on sphere+hollowsphere in multinode by mauvebic)
make_sphere = function(pos,radius,nodename,hollow)
pos.x = math.floor(pos.x+0.5)
pos.y = math.floor(pos.y+0.5)
pos.z = math.floor(pos.z+0.5)
for x=-radius,radius do
for y=-radius,radius do
for z=-radius,radius do
if hollow ~= nil then
if x*x+y*y+z*z >= (radius-hollow) * (radius-hollow) + (radius-hollow) and x*x+y*y+z*z <= radius * radius + radius then
minetest.env:add_node({x=pos.x+x,y=pos.y+y,z=pos.z+z},{name=nodename})
end
else
if x*x+y*y+z*z <= radius * radius + radius then
minetest.env:add_node({x=pos.x+x,y=pos.y+y,z=pos.z+z},{name=nodename})
end
end
end
end
end
end
Last edited by cornernote on Mon Sep 24, 2012 00:36, edited 1 time in total.
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
Done!cornernote wrote:[request]
i would like to be able to draw a cylinder with a negative length (eg, -100). at the moment this does not render any nodes, it should start from 0 and go backwards.
p.s. when i have some time i'll look at it if nobody else has by then, just noting these issues here so i dont forget.
Edit: forgot about the sphere shape, I'm looking it over, feel free to make a pull request in the meantime.
Last edited by Temperest on Tue Sep 25, 2012 21:08, 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.
Spheres! Commit.
I sped up the spheres code significantly, but it could still use some improvements with larger dimensions. Thanks to cornernote for the original code.
Edit: thanks to mauvebic, for awesome spherical action!
I sped up the spheres code significantly, but it could still use some improvements with larger dimensions. Thanks to cornernote for the original code.
Edit: thanks to mauvebic, for awesome spherical action!
Last edited by Temperest on Wed Sep 26, 2012 00:49, 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
No, thanks to mauvebic. It's his code, I just merged 2 functions into 1. These lines are the keys:Temperest wrote:Spheres! Commit.
I sped up the spheres code significantly, but it could still use some improvements with larger dimensions. Thanks to cornernote for the original code.
Code: Select all
-- detect sphere/hollow sphere area
if x*x+y*y+z*z >= (radius-hollow) * (radius-hollow) + (radius-hollow) and x*x+y*y+z*z <= radius * radius + radius then ... end
if x*x+y*y+z*z <= radius * radius + radius then ... end
Last edited by cornernote on Wed Sep 26, 2012 00:39, edited 1 time in total.
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
I can't seem to get spiral to work either; I will be looking into rewriting it perhaps as per the GitHub issue, since it uses GFDL code from RosettaCode and nobody understands how it works
Edit: also to address your other concern, there is no way to do so at the moment, sorry. If you have any suggestions for doing this in an elegant way, I'd be glad to hear them.
Edit: also to address your other concern, there is no way to do so at the moment, sorry. If you have any suggestions for doing this in an elegant way, I'd be glad to hear them.
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 replaced spirals with pyramids in the API, but I'm going to bed now so commits will be 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.
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
Update:
Gage: I broke that accidentally yesterday, this new update should fix it.
- cornernote fixed the //spiral command! Now you can make awesome mazes and similar things!
- Added the //pyramid command, for making large solid pyramids.
- Fixes to API documentation and some incorrect code.
Gage: I broke that accidentally yesterday, this new update should fix it.
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
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
can we add maze to worldedit?
if so, did you want me to add it in?
maze - http://minetest.net/forum/viewtopic.php?id=2814
if so, did you want me to add it in?
maze - http://minetest.net/forum/viewtopic.php?id=2814
Transpose is broken as per issue #8, for non-square regions. I'll need to figure out a new algorithm for non-square matrix transposition soon.
Feel free to add the maze primitive, or anything else you find useful. Make sure the license is compatible first, though. The mazes are pretty cool and actually somewhat difficult.
Feel free to add the maze primitive, or anything else you find useful. Make sure the license is compatible first, though. The mazes are pretty cool and actually somewhat difficult.
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
with all these shapes, the functions.lua is getting quite large. i propose we break all these functions into their own files, then in the main init.lua do this:
What are your thoughts?
Code: Select all
-- expose api
worldedit = {}
-- load api files
local path = minetest.get_modpath("worldedit")
local command = 'dir "'..path..'\\api\\*.lua" /b' -- windows
if os.getenv('home')~=nil then
command = 'ls -a "'..path..'/api/*.lua"' -- linux/mac
end
for filename in io.popen(command):lines() do
dofile(path..'/api/'..filename)
end
I agree that it is becoming pretty unwieldy. However, I'm thinking init.lua should not be a dependency of the actual API. As it stands, you can just copy functions.lua to your own mod and it would work by itself (with the exception of meta save and metaload, which I suggest should be folded into the API to avoid too many files). That is, init.lua simply contains the chat interface alone.
I'm thinking of splitting the API into parts: the primitives, such as pyramids, cylinders, and spheres; the node modification tools, such as set, replace, and dig; and the serialization stuff, such as save, load, meatspace, and metaload. Each module could be imported independently and individual modules would be removable without affecting others.
I'm thinking of splitting the API into parts: the primitives, such as pyramids, cylinders, and spheres; the node modification tools, such as set, replace, and dig; and the serialization stuff, such as save, load, meatspace, and metaload. Each module could be imported independently and individual modules would be removable without affecting others.
Last edited by Temperest on Thu Sep 27, 2012 13:47, 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.
- jordan4ibanez
- Member
- Posts: 1923
- Joined: Tue Sep 27, 2011 18:44
- GitHub: jordan4ibanez
- IRC: jordan4ibanez
- In-game: jordan4ibanez
What about changing WorldEdit to a modpack, including submods for each function, a mod for the api, and a mod for the default worldedit interface?
Code: Select all
mods/
worldedit/
worldedit_default/
depends: worldedit_api
worldedit_api/
depends: worldedit_sphere, worldedit_cylinder, worldedit_set, etc.
worldedit_cylinder/
... (etc.) ...
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
I dont think it makes any difference which loop you use. The thread will do the loop until its done.jordan4ibanez wrote:This should use a for statement instead of a while statement, so that on a multiplayer server the whole thing does not freeze up when people are worldediting
Perhaps a better way would be to only process X nodes per interval.
For example, when you //load a file, it should read the file into a TODO list, and then it should process 10 lines (and remove those 10 lines from the list). It should then use minetest.after(1,func) to create a callback that will run the next loop.
Who is online
Users browsing this forum: No registered users and 69 guests