[Mod] Schematic Editor [1.8.0] [schemedit]

User avatar
Lone_Wolf
Member
Posts: 2575
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

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

by Lone_Wolf » Post

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
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

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

by Wuzzy » Post

Yeah, this is writing into a foreign mod directory. Sorry, this is a no-go area.

zing269
Member
Posts: 109
Joined: Sat Apr 30, 2016 19:10

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

by zing269 » Post

Could both mods share a directory in the world directory?

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

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

by Wuzzy » Post

Yes, but only if they are in the same world.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

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

by texmex » Post

Would you consider supporting the Minecraft .schematic file format? It's already supported in this mod, here, so perhaps it's not that hard?

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

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

by Wuzzy » Post

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.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

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

by texmex » Post

Okay, thanks for your answer.

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

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

by BrunoMine » Post

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.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

How to convert to lua instead of mts?

CalebJ
Member
Posts: 407
Joined: Sat Dec 29, 2018 19:21
GitHub: KaylebJay
IRC: KaylebJay
In-game: CalebJ
Location: Tunnelers' Abyss

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

by CalebJ » Post

This will save me hours of work. Thanks!

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 1.2.0 released!

by Wuzzy » Post

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.

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 1.3.0 released!

by Wuzzy » Post

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)

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

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

by texmex » Post

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?

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

v5.3-dev

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

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

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

by Wuzzy » Post

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?

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 1.4.0 released!

by Wuzzy » Post

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

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

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

by bzt » Post

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

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

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

by MisterE » Post

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.

dawgdoc
Member
Posts: 260
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

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

by dawgdoc » Post

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.
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

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

by bzt » Post

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

Merak
Member
Posts: 116
Joined: Sat Nov 05, 2016 20:34

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

by Merak » Post

If someone made a video guide, that would be welcome.

User avatar
Codesound
Member
Posts: 365
Joined: Thu Jun 09, 2016 14:56

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

by Codesound » Post

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

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 1.4.1 released!

by Wuzzy » Post

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

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 1.4.2 released! Version 1.4.3 released!

by Wuzzy » Post

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.

iXware
New member
Posts: 8
Joined: Sat Feb 13, 2021 15:29

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

by iXware » Post

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
with kind regards
Frank

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests