Page 2 of 4

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Fri May 18, 2018 00:24
by Lone_Wolf
Wuzzy wrote:Note that anything outside the world directory is taboo, this is a restriction dictated by Minetest's mod security system.
And I don't plan to violate that, I don't want my mod to be able to write on any directory.

The only leeway I might have is changing the directory inside the world directory, but this doesn't seem too helpful.

Maybe this should first be discussed with Minetest developers, the mod security system only allows us to write into a very few specific locations.

Please tell me your specific use case for this feature, and how you would use it. Maybe I'll understand your motivation then.
I'm using this mod to create schematics for a mod that adds items which you can use to instantly build saved structures (Right-click the ground with the item and it spawns the building). Right now I have to save the schematic, pause Minetest, and drag the schematic file into my mod.
It won't make a very large difference if you did allow me to just set the file destination to my mod. But it would be useful. My current method works

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Fri May 18, 2018 01:40
by Wuzzy
Yeah, this is writing into a foreign mod directory. Sorry, this is a no-go area.

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Fri May 18, 2018 02:33
by zing269
Could both mods share a directory in the world directory?

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Fri May 18, 2018 02:53
by Wuzzy
Yes, but only if they are in the same world.

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Tue Jul 17, 2018 10:44
by texmex
Would you consider supporting the Minecraft .schematic file format? It's already supported in this mod, here, so perhaps it's not that hard?

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Fri Jul 20, 2018 10:13
by Wuzzy
No.

First of all, this mod only seems to analyze .schematic files and return them as Lua table. That's not enough, I would also need a converter which converts from .schematic to .mts.

Ideally, there would be a separate program that converts .schematic files to MTS. Then you can make those files work for all mods.

Therefore, I think such a conversion is out of scope for schemedit.

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Fri Jul 20, 2018 13:46
by texmex
Okay, thanks for your answer.

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Fri Dec 28, 2018 01:57
by BrunoMine
This mod saved me a lot of time. Thanks for the simplicity and the good work. I use several of your mods, you're an excellent developer in minetest. thank you.

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Sun Feb 10, 2019 01:11
by runs
How to convert to lua instead of mts?

Re: [Mod] Schematic Editor [1.1.0] [schemedit]

Posted: Thu Jul 04, 2019 23:25
by CalebJ
This will save me hours of work. Thanks!

Version 1.2.0 released!

Posted: Fri May 15, 2020 00:01
by Wuzzy
Version 1.2.0 has been released!

Changelog:
  • Fix placeschem command only placing the first instance of the schematic file that Minetest loaded for the first time and ignoring subsequent changes in the same session. This made it impossible to edit a schematic if you overwrote the file multiple times in the same session (requires Minetest 5.1.0 or later)
  • Add support for importing a schematic, this restores all probability and force placement data of a schematic file (requires Minetest 5.1.0 or later)
  • Minor HUD tweaks
  • Add top and bottom faces to the preview box
  • Disallow rotation with screwdriver from Minetest Game
  • Node Probability Tool: No longer display distance (will work in upcoming Minetest 5.3.0)
How to convert to lua instead of mts?
Not possible yet, sorry.

Version 1.3.0 released!

Posted: Fri May 15, 2020 01:34
by Wuzzy
Version 1.3.0 has been released!
Changelog:
  • New server command: mts2lua: Convert .mts to .lua file (schematic in Lua code form)
  • New setting: schemedit_export_lua: If enabled, exporting a schematic to .mts will also automatically create a .lua file as well (default: disabled)
  • Much stricter privilege requirement: You now need the “server” privilege to do pretty much anything (for security reasons, because this mod messes with files on the server)
  • Fix crash when rightclicking new schematic creator (was introduced in 1.2.0)

Re: [Mod] Schematic Editor [1.3.0] [schemedit]

Posted: Mon May 18, 2020 08:18
by texmex
Nice updates, Wuzzy. Come to think of it, I've needed a way to mass export schematics. Any ideas? Maybe an "Export schematics from all loaded schematic blocks" function?

Re: [Mod] Schematic Editor [1.3.0] [schemedit]

Posted: Wed May 27, 2020 00:22
by runs
v5.3-dev

- Error in line 706, prob not being a string.

Re: [Mod] Schematic Editor [1.3.0] [schemedit]

Posted: Wed May 27, 2020 17:21
by Wuzzy
Can't reproduce. This might be a regression in Minetest. In the documentation it never says the item can't be a non-string.

Care to report a bug in Minetest?

Version 1.4.0 released!

Posted: Wed Jun 03, 2020 14:36
by Wuzzy
Changes in version 1.4.0:
  • Fix incorrect importing of schematic size (sometimes)
  • Add buttons to convert air to schematic void (and vice-versa)
  • Fix text area size being too large
  • Fix some deprecated code

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Sun Jan 10, 2021 15:32
by bzt
Bit of a necroposting, sorry, hope you don't mind...
burli wrote:
Tue Oct 24, 2017 11:42
hajo wrote:
burli wrote:Is it possible to store schematics as Lua table instead of MTS?
* why ?
Because it is impossible to edit or check binary files.
Not any more, see this topic. BTW I know another advantage of Lua tables over MTS files: they can store the contents of chests, while MTS can't.
Wuzzy wrote:
Thu May 17, 2018 14:53
Note that anything outside the world directory is taboo, this is a restriction dictated by Minetest's mod security system.
Yeah, I've run into that problem too. Generally I agree with this policy, but I think there should be one exception to the rule, regarding to schematics.
Wuzzy wrote:
Thu May 17, 2018 14:53
Please tell me your specific use case for this feature, and how you would use it. Maybe I'll understand your motivation then.
One use case would be to have a "schems" folder next to "mods" and "worlds" folder. This could include shared schematics that could be loaded into several worlds. Right now it is very problematic if you want to import the same schem into multiple worlds:
1. you start the game and create a world
2. you exit the game
3. you create "worlds/(something)/schems"
4. you copy MTS files there
5. you restart the game
6. you can import MTS into the world

If there were a shared "schems" folder, this could be
1. you start the game and create a world
2. you can import MTS into the world

Cheers,
bzt

Re: [Mod] Schematic Editor [1.4.0] [schemedit]

Posted: Mon Jan 11, 2021 16:46
by MisterE
A suggestion, IDK if it would work, but if it does, it would be a temporary fix until better support can be added to MT itself...

A mod which has security allowance.
It does 1 thing.

Minetest.register_on_mods_loaded, it checks a shared schems folder and it checks all the worlds schems folders. Then it equalizes each location, copying and pasting all the schems from one into another. If a schem exists in a world, but not in the main folder, it copies from the world to the main folder, and then to every other world. If a schem exists in a world and in the main folder, it deletes the version that is in the worlds and pastes the version that is in the main folder.

It also has a callback for when a schematic is saved... it saves it to the world folder, and saves a flag to a file in the schems folder that that schem is more current and should replace/ update any schems of the same name in the main folder.

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Wed Feb 03, 2021 07:11
by dawgdoc
bzt wrote:
Sun Jan 10, 2021 15:32
One use case would be to have a "schems" folder next to "mods" and "worlds" folder. This could include shared schematics that could be loaded into several worlds. Right now it is very problematic if you want to import the same schem into multiple worlds:
1. you start the game and create a world
2. you exit the game
3. you create "worlds/(something)/schems"
4. you copy MTS files there
5. you restart the game
6. you can import MTS into the world

If there were a shared "schems" folder, this could be
1. you start the game and create a world
2. you can import MTS into the world

Cheers,
bzt
A solution that comes to mind would still involve steps 1 and 2.
Instead of step 3, create the initial schems folder wherever you wish. Then with each world you create, place a symlink (symbolic link) to it at "worlds/(something)/schems"
Then continue with 5 and 6.
Sorry, probably it doesn't simplify the procedure enough to be satisfactory.

Re: [Mod] Schematic Editor [1.0.0] [schemedit]

Posted: Wed Mar 10, 2021 17:34
by bzt
dawgdoc wrote:
Wed Feb 03, 2021 07:11
Sorry, probably it doesn't simplify the procedure enough to be satisfactory.
Yes, plus it wouldn't allow local schems. With a separate common schem folder, schems would be still saved in a world specific folder just like now, and if you have a schem by the same name it would load the world specific first.

(Otherwise if the MTE allows symlinks pointing outside of the world folder that's a security hole, meaning Lua scripts can escape the sandbox and potentially ruin your machine.)

Cheers,
bzt

Re: [Mod] Schematic Editor [1.4.0] [schemedit]

Posted: Fri Mar 19, 2021 16:26
by Merak
If someone made a video guide, that would be welcome.

Re: [Mod] Schematic Editor [1.4.0] [schemedit]

Posted: Sat Mar 20, 2021 07:36
by Codesound
Merak wrote:
Fri Mar 19, 2021 16:26
If someone made a video guide, that would be welcome.
+1


many mods would require a video tutorial to help users use them correctly. I also think that many unnecessary questions to the developers would be avoided

Version 1.4.1 released!

Posted: Sun Apr 04, 2021 15:40
by Wuzzy
Version 1.4.1 released! This fixes a couple of bugs:
  • Fix schematic void and node probabilities being set to the incorrect positions on import
  • Fix data corruption of Y slices when importing
  • Prevent duplicate slice definitions in the Y slice editor
  • Minor usability improvements in the Y slice editor
  • Fix deprecated use of use_texture_alpha of schematic void

Version 1.4.2 released! Version 1.4.3 released!

Posted: Sun Apr 04, 2021 17:26
by Wuzzy
Version 1.4.2 released!
This version adds a new readme file: USAGE.md. This is a text file that explains how to use all the items in detail.

The texts are not new, they are the same texts for the item help provided for doc_items. I added this file for those who are too lazy or unwilling to install doc_items.

Version 1.4.3 released!
This version fixes a crash when you unwield the probability tool.

Re: [Mod] Schematic Editor [1.4.3] [schemedit]

Posted: Fri Apr 09, 2021 06:39
by iXware
I think I have discovered an error. I am using schemedit (1.4.3) in mineclone2 (cloned from git) on your Debian server (with minetest-server 5.3 and as client a Linux with mintetest 5.4. If you create a texture which contains filled chests, export it and import it again at another place, chests are invisible. I think the texture is not loaded. If you go to the place of the chest and open it, then it becomes visible, but it is empty.

with kind regards,
Frank