[Mod] Edit [2.0][edit]

Post Reply
User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

[Mod] Edit [2.0][edit]

by Mr. Rar » Post

This is edit mod. It allows copying, pasting, filling, deleting, opening and saving 3D areas.
It also has a simple undo tool to undo the last edit operation. It has a paste preview and an area selection preview.
As of the 1.0 release it requires Minetest 5.4 or greater

It would be a good idea to do some tests before using it for anything "real." For usage information see "README.md."

Download: https://github.com/MrRar/edit/archive/master.zip

Image

License of code: MIT
License of textures: CC0 1.0 Universal (CC0 1.0)
Mod dependencies: none
Last edited by Mr. Rar on Mon Mar 20, 2023 17:32, edited 5 times in total.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: Edit Mod

by red-001 » Post

You might want to update your minetest version, as 0.4.13 is quite old right now. The current version is 0.4.15 and 0.4.11 is the oldest version supported.

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: Edit Mod

by Mr. Rar » Post

red-001 wrote:You might want to update your minetest version, as 0.4.13 is quite old right now. The current version is 0.4.15 and 0.4.11 is the oldest version supported.
Thanks for the tip. How can you tell the exact version I am using?
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
Tmanyo
Member
Posts: 196
Joined: Mon Sep 29, 2014 01:20
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo
Location: United States
Contact:

Re: Edit Mod

by Tmanyo » Post

Mr. Rar wrote:
red-001 wrote:You might want to update your minetest version, as 0.4.13 is quite old right now. The current version is 0.4.15 and 0.4.11 is the oldest version supported.
Thanks for the tip. How can you tell the exact version I am using?
Top left of the screen Says Minetest 0.4.13.
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player

User avatar
mahmutelmas06
Member
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: Edit Mod

by mahmutelmas06 » Post

This mod is amazing :o
My Mods:

Beverage

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: Edit Mod

by Mr. Rar » Post

mahmutelmas06 wrote:This mod is amazing :o
Thanks.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Edit Mod

by azekill_DIABLO » Post

very well thinked, better approach than world edit IMHO!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
TenPlus2
Member
Posts: 22
Joined: Sun May 09, 2021 20:54

Re: Edit Mod

by TenPlus2 » Post

A user was using this on my server and some how it bugged out and erased a huge chunk of the map, including an area protected by another user one she had no permissions in.

I have no idea how this happened and it's such a great mod I did not want to remove it, so I added a range limiter to it so that if anything like this ever happens again it can only do so much damage.

I don't want to tarnish this great mod, it's possible some other mod was using the same "clipboard" variable name, idk, I didn't check but I have renamed the variable to something a little more unique.

Anyway the safer range limited version to 16 nodes (configurable in init.lua) is available here:
https://notabug.org/TenPlus2/Edit_Mod_1 ... master.zip

source:
https://notabug.org/TenPlus2/Edit_Mod_1.2
Last edited by TenPlus2 on Wed May 26, 2021 15:49, edited 1 time in total.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Edit Mod

by TenPlus1 » Post

@TenPlus2 - Remember to add Mr. Rar's name to the readme file as the original author.

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: Edit Mod

by Mr. Rar » Post

I have just released a big update.

Some new things:
You can save a copied area to a schematic.
You can load schematics for pasting.
You can undo the last operation.
A selection preview is shown when holding a second delete/copy/fill node.
A paste preview is shown when holding the paste node.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Edit [1.0][edit]

by Skamiz Kazzarch » Post

Just stumbled upon this today. It took me a bit to figure out, since I was tying to copy a small area and didn't know that the selector nodes must be on the outside.
Coincidentally this is almost exactly what I wanted for one of my own projects. I will probably still write my own version, just cause, but this is already awesome and I will draw some inspiration from you.

A very well done mod. I am putting straight in the world builder folder next to the terraform mod.

c56
Member
Posts: 307
Joined: Wed Apr 21, 2021 03:05
GitHub: tigercoding56
In-game: bm5 or bemo5 also sell_her_on55

Re: [Mod] Edit [1.0][edit]

by c56 » Post

Skamiz Kazzarch wrote:
Sat Aug 27, 2022 18:09
Just stumbled upon this today. It took me a bit to figure out, since I was tying to copy a small area and didn't know that the selector nodes must be on the outside.
Coincidentally this is almost exactly what I wanted for one of my own projects. I will probably still write my own version, just cause, but this is already awesome and I will draw some inspiration from you.

A very well done mod. I am putting straight in the world builder folder next to the terraform mod.
worldedit for larger scale things
this is a signature not a place to post messages also if i could change my username i would change it to sell_her_on55

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: [Mod] Edit [1.0][edit]

by Mr. Rar » Post

Skamiz Kazzarch wrote:
Sat Aug 27, 2022 18:09
It took me a bit to figure out, since I was tying to copy a small area and didn't know that the selector nodes must be on the outside.
The selector nodes being on the outside is the number one complaint I am seeing with this mod. I think I will try switching to using entities and include the area of the selectors.
Coincidentally this is almost exactly what I wanted for one of my own projects. I will probably still write my own version, just cause, but this is already awesome and I will draw some inspiration from you.
It will be cool to see your take on this.
A very well done mod. I am putting straight in the world builder folder next to the terraform mod.
Thanks!
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Edit [1.0][edit]

by Skamiz Kazzarch » Post

Mr. Rar wrote:
Mon Aug 29, 2022 13:33
It will be cool to see your take on this.
You can already see some of it released in my Jumper game. Specifically I already have a selection tool.
screenshot_20220829_165151.png
screenshot_20220829_165151.png (113.88 KiB) Viewed 2638 times
Yes, the color is inspired by your mod. :D
The main difference is that instead of setting a marker at the pointed position, I put it 5 nodes in front of the player. That way I don't need to build any scaffolding on which to attach the selection and there is no difference between selecting an air node and a solid node.

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: [Mod] Edit [1.0][edit]

by Mr. Rar » Post

Skamiz Kazzarch wrote:
Mon Aug 29, 2022 14:58
The main difference is that instead of setting a marker at the pointed position, I put it 5 nodes in front of the player. That way I don't need to build any scaffolding on which to attach the selection and there is no difference between selecting an air node and a solid node.
This is a good idea. The only problem I can think of is if you're working in an enclosed space you may not be able to get 5 blocks away from where you want to place the selector. But then you can just use no-clip. I think I might do some experiments with this to see how well this works.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Edit [1.0][edit]

by Skamiz Kazzarch » Post

Huh. Didn't even think of that.
Ideally I would like to make it so the player themselves can configure the distance, or even switch to the pointed node approach, but for now I am focusing on other things.
I already got my version of the clipboard working as I originally intended, but after seeing your mod I still need to add the schematic saving and loading, because that is a feature too useful not to have.

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: [Mod] Edit [1.1][edit]

by Mr. Rar » Post

I have released a significant update to edit mod. This is version 1.1.

Changes:
- Delete node is removed. You can just use fill and select a blank slot.
- Copy is now entity based and selects the position under where you place it.
- Paste pastes directly where you placed it instead of 1 node away.
- Fill and copy can be used without pacing them on nodes. The fill or copy are placed 10 nodes from the player's view.
- The selection preview now shows a grid with cells one node in size.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
Mantar
Member
Posts: 585
Joined: Thu Oct 05, 2017 18:46
Contact:

Re: [Mod] Edit [1.0][edit]

by Mantar » Post

Mr. Rar wrote:
Tue Aug 30, 2022 13:54
The only problem I can think of is if you're working in an enclosed space you may not be able to get 5 blocks away from where you want to place the selector.
Should be as simple as checking the raycast's return list for any solid nodes, and cutting the selector's placement short there, so it's always on this side of a wall, but extends out to the full range if nothing stops it.
Lead dev of Exile, git repo: https://codeberg.org/Mantar/Exile

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: [Mod] Edit [1.0][edit]

by Mr. Rar » Post

Mantar wrote:
Wed Feb 15, 2023 17:52
Mr. Rar wrote:
Tue Aug 30, 2022 13:54
The only problem I can think of is if you're working in an enclosed space you may not be able to get 5 blocks away from where you want to place the selector.
Should be as simple as checking the raycast's return list for any solid nodes, and cutting the selector's placement short there, so it's always on this side of a wall, but extends out to the full range if nothing stops it.
You're right. That's exactly what I ended up doing. Also Skamiz Kazzarch's world_builder does that to.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: [Mod] Edit [2.0][edit]

by Mr. Rar » Post

I am releasing version 2.0 of the edit mod.

Changes:
- WorldEdit format import/export is supported
- Paste preview displays node rotations
- Paste preview is hollowed out where possible
- The offset position of a paste operation is based on the player's look direction
- Fixed bug where fill could not replace falling nodes with air.
- Setting edit_use_fast_node_fill is replaced with edit_fast_node_fill_threshold.
When the fill operation has a larger volume then the specified number, fast node fill will be used.
To disable fast node placement, set the threshold to be equil to the max operation volume.
To disable slow node placement, set the threshold to 0.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Edit [2.0][edit]

by Skamiz Kazzarch » Post

I tried out the latest version and I like what you did with the area selection box.
It doesn't seem like much, but adding the visible tilling helps a lot with intuitively understanding the selections positioning in space.
I will have to steal this idea for my own mod at some point. :D

Also I tried to out the fill feature and had no node in my inventory, so I just randomly selected the 'Edit Paste' tool. Which to my surprise resulted into the current schematic being placed several times. Is that an an intentional feature or an unintentional feature?

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: [Mod] Edit [2.0][edit]

by Mr. Rar » Post

Skamiz Kazzarch wrote:
Mon May 01, 2023 17:56
Also I tried to out the fill feature and had no node in my inventory, so I just randomly selected the 'Edit Paste' tool. Which to my surprise resulted into the current schematic being placed several times. Is that an an intentional feature or an unintentional feature?
Mostly unintentional. When in the slow mode, the fill will call on_place on the selected item. The main point of this is to make some nodes work properly when placed. For example fences connect, pressure plates work, chests have an inventory. It also works on tools/items this allows filling using a water bucket for example. There are also some useless but interesting uses. For example you can fill mob spawn eggs. In MineClone2 you can eat by filling with a food item.

The code that calls on_place is a bit wonky in that it sets the node first and then calls on_place. This causes one issue I am aware of: chests are automatically open. One time I tried switching it to a more proper way of doing things. Call on_place then check if there is a node there, if not, place one. This made the code twice as slow so I abandoned the idea. on_place is responsible for placing the node but some nodes are picky about where they get placed so I want to manually place the node if on_place does not do the job.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests