Compare commits

...

82 Commits

Author SHA1 Message Date
Wuzzy ba323c7670 Version 1.5.1 2022-05-13 23:53:49 +02:00
Wuzzy b221493219 Fix exporting the wrong Y values for Y slices 2022-05-13 23:53:07 +02:00
Wuzzy 100f3c65c5 Add compability mode for minetest.get_translator 2022-01-30 02:30:39 +01:00
Wuzzy 82afdd8c1b Version 1.5.0 2021-09-20 20:12:05 +02:00
Wuzzy 259a6c72d5 Update translation 2021-09-20 20:01:56 +02:00
Wuzzy 0902a26926 Auto-close slice edit panel if no slices 2021-05-21 00:03:06 +02:00
Wuzzy 26fcbcbed9 Add /listschems command 2021-04-07 22:35:14 +02:00
Wuzzy d1a35f9a07 Fix /placeschem <name> not working 2021-04-05 03:06:35 +02:00
Wuzzy 35290e7eac Add z_index to waypoint 2021-04-05 01:29:07 +02:00
Wuzzy 2b6a759eac Tweak parsing of /placeschem 2021-04-05 01:15:55 +02:00
Wuzzy 9715b7818c Merge branch 'clean' 2021-04-05 00:58:19 +02:00
Wuzzy 3b9f1b867b Increase area cleaning size to full XZ extent 2021-04-05 00:57:40 +02:00
Wuzzy fd555ebdaf Remove outdated comment 2021-04-04 23:56:55 +02:00
Wuzzy 98b3ae87ea Add -c switch to /placeschem to clean area first 2021-04-04 22:22:54 +02:00
Wuzzy a56b2d431f Update screenshot.png 2021-04-04 19:50:21 +02:00
Wuzzy a3572cd614 Add min_minetest_version 2021-04-04 19:43:07 +02:00
Wuzzy 724f72bb86 Fix incorrect German translation of /placeschem 2021-04-04 19:42:49 +02:00
Wuzzy 14ffdc6ef5 Version 1.4.3 2021-04-04 19:25:18 +02:00
Wuzzy 781041b0fb Fix crash when unwielding probtool 2021-04-04 19:24:58 +02:00
Wuzzy 3b22a19e60 Version 1.4.2 2021-04-04 19:11:53 +02:00
Wuzzy cd21509a01 Add USAGE.md, generated with /make_schemedit_readme 2021-04-04 19:08:08 +02:00
Wuzzy 148505fd2f Cleanup usage readme generator 2021-04-04 19:07:25 +02:00
Wuzzy bdd44a6871 Fix typo in probtool help 2021-04-04 19:02:25 +02:00
Wuzzy cfbf62913d Add tool to generate usage readme 2021-04-04 19:00:17 +02:00
Wuzzy ad6bf63f3b Version 1.4.1 2021-04-04 17:33:19 +02:00
Wuzzy 433878a938 Add use_texture_alpha compability 2021-04-04 17:29:53 +02:00
Wuzzy e9ad4bcf00 Hide ypos field for slice editing 2021-04-04 17:23:59 +02:00
Wuzzy 329f394499 Fix invalid slice_list on import 2021-04-04 17:10:02 +02:00
Wuzzy f0c5c2659f Prevent adding dupe slice definitions 2021-04-04 16:44:14 +02:00
Wuzzy cd808777c8 Update locale files 2021-04-04 16:35:42 +02:00
Wuzzy 0240a09800 Tweak slice edit buttons 2021-04-04 16:35:19 +02:00
Wuzzy 6f8a575786 Update locale files 2021-04-04 16:23:16 +02:00
Wuzzy cb1e33485e Remove symbols in slice buttons 2021-04-04 16:20:20 +02:00
Wuzzy 8e0794217d Fix incorrect placement of prob stuff in import 2021-04-04 16:13:56 +02:00
Wuzzy b8e5c5cda7 Add use_texture_alpha="clip" for void 2021-04-02 23:20:09 +02:00
Wuzzy e19d5e0bfa Version 1.4.0 2020-06-03 16:31:47 +02:00
Wuzzy b6e4d2f7f0 Fix incorrect size importing 2020-06-03 16:31:03 +02:00
Wuzzy abfd913862 Replace deprecated get/set_attribute 2020-06-03 15:58:34 +02:00
Wuzzy 01a3a970d2 Add buttons to convert air to void to air 2020-06-03 15:48:57 +02:00
Wuzzy e389fcc041 Fix text area being too large 2020-05-31 00:13:25 +02:00
Wuzzy 05ca8d90be Version 1.3.0 2020-05-15 03:24:14 +02:00
Wuzzy 84d6dc3c69 Update README 2020-05-15 03:23:58 +02:00
Wuzzy fedc4c51fa Require server priv 2020-05-15 03:12:19 +02:00
Wuzzy 4199f645f3 Do more strict privilege checks 2020-05-15 03:11:50 +02:00
Wuzzy a639c2b9c0 Fix crash when opening new creator 2020-05-15 03:04:00 +02:00
Wuzzy 7f279bbd7a Require new privilege to do stuff 2020-05-15 03:01:29 +02:00
Wuzzy 54aa7f35df Localize DIR_DELIM 2020-05-15 02:51:21 +02:00
Wuzzy bbed49e365 Add Lua export feature 2020-05-15 02:48:22 +02:00
Wuzzy 5cf551dccd Version 1.2.0 2020-05-15 01:46:31 +02:00
Wuzzy b8cbb66d83 Fix typo in readme and update it 2020-05-15 01:46:10 +02:00
Wuzzy a6cf015631 Remove the final TODO 2020-05-15 01:45:04 +02:00
Wuzzy 5aba3aada8 Display current size and name 2020-05-15 01:44:48 +02:00
Wuzzy 3c7c208dcb Tweak displayed path in formspec 2020-05-15 01:32:09 +02:00
Wuzzy 0fc0180a04 Backwards-compat for versions w/o read_schematic 2020-05-15 01:26:49 +02:00
Wuzzy 2c8e6fae3e Add me to credits 2020-05-15 01:22:11 +02:00
Wuzzy cdcda91fd6 Add help about importing 2020-05-15 01:21:45 +02:00
Wuzzy 1d53577085 Get prob and force_place when importing schem 2020-05-15 01:09:27 +02:00
Wuzzy 59cf898ddc Localize punchpos var 2020-05-14 23:05:24 +02:00
Wuzzy 02acad209b Fix a waypoint-related crash 2020-05-14 23:04:40 +02:00
Wuzzy fee142eab2 Hide waypoint distance 2020-05-14 23:02:49 +02:00
Wuzzy 9cb700327a Fix wrong data type for waypoint call 2020-05-14 23:01:35 +02:00
Wuzzy 476f62c286 Require debug priv to import schematic 2020-05-14 22:43:45 +02:00
Wuzzy d7363f470d Rename button 2020-05-14 22:40:15 +02:00
Wuzzy 713deec575 Easier name and size editing 2020-05-14 22:39:36 +02:00
Wuzzy 442329d886 Disable MTG screwdriver 2020-05-14 22:27:21 +02:00
Wuzzy f4470596dc Also show upper and lower box boundaries 2020-05-14 22:12:02 +02:00
Wuzzy 27c0c2764c Resize slice edit buttons 2020-05-14 21:52:30 +02:00
Wuzzy 7797aa8de6 Add schematic import functionality 2020-05-14 21:47:30 +02:00
Wuzzy ab122a1692 Fix /placeschem ignoring file changes after subsequent loads 2020-05-14 20:34:09 +02:00
Wuzzy 16950a773d Remove border entities more liberally 2019-10-25 01:47:58 +02:00
Wuzzy 2fea0b3d27 Version 1.1.0 2019-03-26 12:12:21 +01:00
Wuzzy 4d5bde773a Fix bad formspec escape 2019-03-22 18:46:57 +01:00
Wuzzy 8f7dbdc56f Fix a few typos 2019-03-22 18:39:44 +01:00
Wuzzy 9fde0b8422 Add German translation 2019-03-22 18:31:51 +01:00
Wuzzy c740737a58 Display probability in tool wear bar 2019-03-22 17:44:05 +01:00
Wuzzy 6dbca794c9 Disable repair 2019-03-22 17:26:48 +01:00
Wuzzy 491f8a11d6 Make border box glow 2019-03-22 17:17:18 +01:00
Wuzzy a1dfdd0cbe Collect forgotten translatable string 2019-03-22 17:11:49 +01:00
Wuzzy 2134116746 Don't expose full world path publicly 2019-03-22 17:10:21 +01:00
Wuzzy d8e59c4cf1 Make mod translatable 2019-03-22 17:05:54 +01:00
Wuzzy b411433d90 Move to new mod.conf format in MT 5.0.0 2019-03-22 16:49:52 +01:00
Wuzzy 67cf59e66e Update deprecated functions 2019-03-22 16:49:17 +01:00
12 changed files with 831 additions and 147 deletions

View File

@ -1,5 +1,5 @@
MIT License
Copyright (c) 2017 Elijah Duffy
Copyright (c) 2017-2020 Elijah Duffy and Wuzzy
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

View File

@ -1,25 +1,39 @@
# Schematic Editor [`schemedit`]
## Version
1.0.0
1.5.1
## Description
This is a mod which allows you to edit and export schematics (`.mts` files).
It supports node porbabilities, forced node placement and slice probabilities.
This mod works in Minetest 5.0.0 or later, but recommended is version 5.1.0
or later.
It supports node probabilities, forced node placement and slice probabilities.
It adds 3 items:
* Schematic Creator: Used to mark a region and export it as schematic
* Schematic Creator: Used to mark a region and export or import it as schematic
* Schematic Void: Marks a position in a schematic which should not replace anything when placed as a schematic
* Schematic Node Probability Tool: Set per-node probabilities and forced node placement
It also adds the server command `placeschem` to place a schematic.
Note: The import feature requires Minetest 5.1.0 or later.
It also adds these server commands:
* `placeschem` to place a schematic
* `mts2lua` to convert .mts files to .lua files (Lua code)
There's also a setting `schemedit_export_lua` to enable automatic export to .lua files.
## Usage help
Usage help can be found when you use the optional Help modpack (mods `doc` and `doc_items`).
This mod assumes you already have a basic understanding about how schematics in Minetest work.
If not, refer to the Minetest Lua API documentation to understand more about schematics.
You should also refer to the Minetest Lua API documentation to understand more about schematics.
To learn how to use all the items in this mod, read `USAGE.md`.
You can also find the same help texts in-game if you if you use the optional Help modpack
(mods `doc` and `doc_items`).
## License of everything
MIT License

44
USAGE.md Normal file
View File

@ -0,0 +1,44 @@
## Usage help
In this section you'll learn how to use the items of this mod.
Note: If you have the `doc` and `doc_items` mods installed, you can also access the same help texts in-game (possibly translated).
### Schematic Creator
The schematic creator is used to save a region of the world into a schematic file (.mts).
#### Usage
To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “`schematic_override`” privilege.
To save a region, use the block, enter the size and a schematic name and hit “Export schematic”. The file will always be saved in the world directory. Note you can use this name in the /placeschem command to place the schematic again.
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.
The other features of the schematic creator are optional and are used to allow to add randomness and fine-tuning.
Y slices are used to remove entire slices based on chance. For each slice of the schematic region along the Y axis, you can specify that it occurs only with a certain chance. In the Y slice tab, you have to specify the Y slice height (0 = bottom) and a probability from 0 to 255 (255 is for 100%). By default, all Y slices occur always.
With a schematic node probability tool, you can set a probability for each node and enable them to overwrite all nodes when placed as schematic. This tool must be used prior to the file export.
### Schematic Node Probability Tool
This is an advanced tool which only makes sense when used together with a schematic creator. It is used to finetune the way how nodes from a schematic are placed.
It allows you to set two things:
1) Set probability: Chance for any particular node to be actually placed (default: always placed)
2) Enable force placement: These nodes replace node other than air and ignore when placed in a schematic (default: off)
#### Usage
BASIC USAGE:
Punch to configure the tool. Select a probability (0-255; 255 is for 100%) and enable or disable force placement. Now place the tool on any node to apply these values to the node. This information is preserved in the node until it is destroyed or changed by the tool again. This tool has no effect on schematic voids.
Now you can use a schematic creator to save a region as usual, the nodes will now be saved with the special node settings applied.
NODE HUD:
To help you remember the node values, the nodes with special values are labelled in the HUD. The first line shows probability and force placement (with “[F]”). The second line is the current distance to the node. Nodes with default settings and schematic voids are not labelled.
To disable the node HUD, unselect the tool or hit “place” while not pointing anything.
UPDATING THE NODE HUD:
The node HUD is not updated automatically and may be outdated. The node HUD only updates the HUD for nodes close to you whenever you place the tool or press the punch and sneak keys simultaneously. If you sneak-punch a schematic creator, then the node HUD is updated for all nodes within the schematic creator's region, even if this region is very big.
### Schematic Void
This is an utility block used in the creation of schematic files. It should be used together with a schematic creator. When saving a schematic, all nodes with a schematic void will be left unchanged when the schematic is placed again. Technically, this is equivalent to a block with the node probability set to 0.
#### Usage
Just place the schematic void like any other block and use the schematic creator to save a portion of the world.

View File

@ -1 +0,0 @@
doc?

View File

@ -1 +0,0 @@
Advanced tool for modders and advanced users to create and edit schematics.

665
init.lua

File diff suppressed because it is too large Load Diff

82
locale/schemedit.de.tr Normal file
View File

@ -0,0 +1,82 @@
# textdomain: schemedit
<world path>=<Weltpfad>
Insufficient privileges! You need the “@1” privilege to use this.=Unzureichende Privilegien! Sie benötigen das „@1“-Privileg, um dies benutzen zu können.
Probability: @1=Wahrscheinlichkeit: @1
Not Set=Nicht gesetzt
Force placement=Platzierung erzwingen
Import schematic=Schematic importieren
Main=Grundeinstellungen
Hide border=Rand verbergen
Show border=Rand anzeigen
Position: @1=Position: @1
Owner: @1=Eigentümer: @1
Schematic name: @1=Schematic-Name: @1
Size: @1=Größe: @1
Schematic name:=Schematic-Name:
OK=OK
Save schematic name=Schematic-Name speichern
Export schematic=Schematic exportieren
Export/import path:@n@1=Export-/Importpfad:@n@1
<name>=<Name>
Air to voids=Luft zu Lücken
Voids to air=Lücken zu Luft
Turn all air nodes into schematic void nodes=Alle Luft-Nodes zu Schematic-Lücken umwandeln
Turn all schematic void nodes into air nodes=Alle Schematic-Lücken zu Luft-Nodes umwandeln
X size:=X-Größe:
Y size:=Y-Größe:
Z size:=Z-Größe:
Save size=Größe speichern
Help=Hilfe
Exported schematic to @1=Schematic nach @1 exportiert
Failed to export schematic to @1=Schematic konnte nicht nach @1 exportiert werden
Imported schematic from @1=Schematic von @1 importiert
Failed to import schematic from @1=Schematic konnte nicht von @1 importiert werden
Y Slices=Y-Scheiben
Y @= @1; Probability @= @2=Y @= @1; Wahrscheinlichkeit @= @2
Add=Hinzufügen
Apply=Anwenden
Y position (max. @1):=Y-Position (max. @1):
Probability (0-255):=Wahrscheinlichkeit (0-255):
Cancel=Abbrechen
Add slice=Neue Scheibe
Remove slice=Scheibe entfernen
Edit slice=Scheibe anpassen
Back=Zurück
Schematic Node Probability Tool=Schematic-Node-Wahrscheinlichkeitswerkzeug
Probability (0-255)=Wahrscheinlichkeit
Probability that the node will be placed=Wahrscheinlichkeit, dass der Node platizert wird
If enabled, the node will replace nodes other than air and ignore=Wenn aktiviert, wird der Node alle Nodes außer Luft und Ignorieren ersetzen
Allows you to access schemedit nodes not owned by you=Damit können Sie auf Schemedit-Nodes, die ihnen nicht gehören, zugreifen
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.=Das Importieren eines Schematics wird eine Schematicdatei aus dem Weltverzeichnis laden, sie vor dem Schematic-Macher platzieren und die Wahrscheinlichkeits- und Zwangsplatzierungsdaten entsprechend setzen.
Schematic Creator=Schematic-Macher
The schematic creator is used to save a region of the world into a schematic file (.mts).=Der Schematic-Macher wird benutzt, um eine Region der Welt in eine Schematic-Datei (.mts) zu speichern.
To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.=Um anzufangen, platzieren Sie den Block direkt vor einer beliebigen unteren linken Ecke des Gebäudes, das Sie speichern möchten. Dieser Block kann nur vom Platzierer oder von Spielern mit dem „schematic_override“-Privileg benutzt werden.
To save a region, use the block, enter the size and a schematic name and hit “Export schematic”. The file will always be saved in the world directory. Note you can use this name in the /placeschem command to place the schematic again.=Um eine Region zu speichern, benutzen Sie den Block, geben Sie die Größe und einen Schematic-Namen ein und klicken Sie auf „Schematic exportieren“. Die Datei wird immer im Weltverzeichnis gespeichert. Beachten Sie, dass Sie diesen Namen im „/placeschem“-Befehl benutzen können, um das Schematic erneut zu platzieren.
The other features of the schematic creator are optional and are used to allow to add randomness and fine-tuning.=Die anderen Funktionen des Schematic-Machers sind optional und werden für Zufälligkeit und Feinjustierungen benutzt.
Y slices are used to remove entire slices based on chance. For each slice of the schematic region along the Y axis, you can specify that it occurs only with a certain chance. In the Y slice tab, you have to specify the Y slice height (0 @= bottom) and a probability from 0 to 255 (255 is for 100%). By default, all Y slices occur always.=Y-Scheiben werden benutzt, um ganze Scheiben mit einer gewissen Wahrscheinlichkeit auszulassen. Für jede Scheibe der Schematic-Region entlang der Y-Achse können Sie festlegen, dass sie nur mit einer gewissen Wahrscheinlichkeit auftritt. In der Registerkarte „Y-Scheiben“ müssen Sie die Höhe der Y-Scheibe festlegen (0 @= Boden) sowie eine Wahrscheinlichkeit zwischen 0 und 255 (255 steht für 100%). Standardmäßig treten alle Y-Scheiben immer auf.
With a schematic node probability tool, you can set a probability for each node and enable them to overwrite all nodes when placed as schematic. This tool must be used prior to the file export.=Mit einem Schematic-Node-Wahrscheinlichkeitswerkzeug können Sie die Wahrscheinlichkeit für jeden Node setzen und sie dazu aktivieren, alle Nodes zu ersetzen, wenn sie als Schematic platziert werden. Dieses Werkzeug muss vor dem Dateiexport benutzt werden.
(owned by @1)=(Eigentümer: @1)
This is an advanced tool which only makes sense when used together with a schematic creator. It is used to finetune the way how nodes from a schematic are placed.=Dies ist ein fortgeschrittenes Werkzeug, der nur sinnvoll in Verwendung mit einem Schematic-Macher benutzt werden kann. Er wird benutzt, um die Art und Weise, wie Nodes aus einem Schematic platziert werden, feinzujustieren.
It allows you to set two things:=Damit können Sie zwei Dinge setzen:
1) Set probability: Chance for any particular node to be actually placed (default: always placed)=1) Wahrscheinlichkeit setzen: Wahrscheinlichkeit für einen bestimmten Node, dass er tatsächlich platziert wird (Standard: immer platziert)
2) Enable force placement: These nodes replace node other than air and ignore when placed in a schematic (default: off)=2) Zwangsplatzierung aktivieren: Diese Nodes ersetzen alle Nodes außer Luft und Ignorieren, wenn Sie in einem Schematic platziert werden (Standard: aus)
BASIC USAGE:=GRUNDLEGENDE BENUTZUNG:
Punch to configure the tool. Select a probability (0-255; 255 is for 100%) and enable or disable force placement. Now place the tool on any node to apply these values to the node. This information is preserved in the node until it is destroyed or changed by the tool again. This tool has no effect on schematic voids.=Schlagen Sie zu, um das Werkzeug zu konfigurieren. Wählen Sie eine Wahrscheinlichkeit (0-255; 255 steht für 100%) und aktivieren oder deaktivieren Sie die erzwungene Platzierung. Platzieren Sie nun das Werkzeug auf einen beliebigen Node, um diese Werte auf dem Node anzuwenden. Diese Information bleibt im Node erhalten, bis er zerstört oder erneut vom Werkzeug geändert wird. Dieses Werkzeug hat keine Auswirkung auf Schematic-Lücken.
Now you can use a schematic creator to save a region as usual, the nodes will now be saved with the special node settings applied.=Anschließend können Sie einen Schematic-Macher benutzen, um eine Region wie gewöhnlich zu speichern, die Nodes werden nun mit den besonderen Node-Einstellungen gespeichert.
NODE HUD:=NODE-HUD:
To help you remember the node values, the nodes with special values are labelled in the HUD. The first line shows probability and force placement (with “[F]”). The second line is the current distance to the node. Nodes with default settings and schematic voids are not labelled.=Um Ihnen dabei zu helfen, sich die Node-Werte zu merken, werden die Nodes mit besonderen Werten in der Benutzeroberfläche gekennzeichnet. Die erste Zeile zeigt die Wahrscheinlichkeit und die Zwangsplatzierung (mit „[F]“) an. Die zweite Zeile zeigt die momentane Entfernung zum Node an. Nodes mit den Standardeinstellungen und Schematic-Lücken werden nicht gekennzeichnet.
To disable the node HUD, unselect the tool or hit “place” while not pointing anything.=Um die Node-HUD zu deaktivieren, wählen Sie das Werkzeug ab oder drücken Sie die Platzierentaste, während Sie auf nichts zeigen.
UPDATING THE NODE HUD:=NODE-HUD AKTUALISIEREN:
The node HUD is not updated automatically and may be outdated. The node HUD only updates the HUD for nodes close to you whenever you place the tool or press the punch and sneak keys simultaneously. If you sneak-punch a schematic creator, then the node HUD is updated for all nodes within the schematic creator's region, even if this region is very big.=Die Node-HUD wird nicht automatisch aktualisiert und kann veraltet sein. Die Node-HUD wird nur die HUD für Nodes in Ihrer Nähe aktualisieren oder wenn Sie das Werkzeug benutzen oder gleichzeitig die Schlag- und Schleichtaste drücken. Wenn Sie auf einen Schematic-Macher schleichschlagen, wird die Node-HUD für alle Nodes innerhalb der Region des Schematic-Machers aktualisiert, selbst, wenn diese Region sehr groß ist.
Schematic Void=Schematic-Lücke
This is an utility block used in the creation of schematic files. It should be used together with a schematic creator. When saving a schematic, all nodes with a schematic void will be left unchanged when the schematic is placed again. Technically, this is equivalent to a block with the node probability set to 0.=Dies ist ein Hilfsblock, der bei der Erstellung von Schematic-Dateien benutzt wird. Er sollte zusammen mit einem Schematic-Macher benutzt werden. Wenn ein Schematic gespeichert wird, werden alle Nodes mit einer Schematic-Lücke unverändert gelassen, wenn das Schematic erneut platziert wird. Technisch gesehen ist dieses Verhalten identisch mit einem Block, der eine Node-Wahrscheinlichkeit von 0 hat.
Just place the schematic void like any other block and use the schematic creator to save a portion of the world.=Platzieren Sie einfach die Schematic-Lücke wie jeden anderen Block und benutzen Sie den Schematic-Macher, um einen Teil der Welt zu speichern.
Place schematic at the position specified or the current player position (loaded from @1). “-c” will clear the area first=Schematic an der angegebenen Position oder der aktuellen Spielerposition platzieren (geladen von @1). Mit „-c“ wird das Gebiet zuerst geleert
<schematic name>[.mts] [-c] [<x> <y> <z>]=<Schematic-Name>[.mts] [-c] [<x> <y> <z>]
No schematic file specified.=Keinen Schematic-Namen angegeben.
Schematic file could not be loaded!=Schematic-Datei konnte nicht geladen werden!
List schematic files in world path=Schematic-Dateien im Weltpfad auflisten
No schematic files.=Keine Schematic-Dateien.
Convert .mts schematic file to .lua file (loaded from @1)=„.mts“-Schematicdatei zu „.lua“-Datei konvertieren (geladen von @1)
<schematic name>[.mts] [comments]=<Schematic-Name>[.mts] [comments]
Failed!=Fehlgeschlagen!

82
locale/template.txt Normal file
View File

@ -0,0 +1,82 @@
# textdomain: schemedit
<world path>=
Insufficient privileges! You need the “@1” privilege to use this.=
Probability: @1=
Not Set=
Force placement=
Import schematic=
Main=
Hide border=
Show border=
Position: @1=
Owner: @1=
Schematic name: @1=
Size: @1=
Schematic name:=
OK=
Save schematic name=
Export schematic=
Export/import path:@n@1=
<name>=
Air to voids=
Voids to air=
Turn all air nodes into schematic void nodes=
Turn all schematic void nodes into air nodes=
X size:=
Y size:=
Z size:=
Save size=
Help=
Exported schematic to @1=
Failed to export schematic to @1=
Imported schematic from @1=
Failed to import schematic from @1=
Y Slices=
Y @= @1; Probability @= @2=
Add=
Apply=
Y position (max. @1):=
Probability (0-255):=
Cancel=
Add slice=
Remove slice=
Edit slice=
Back=
Schematic Node Probability Tool=
Probability (0-255)=
Probability that the node will be placed=
If enabled, the node will replace nodes other than air and ignore=
Allows you to access schemedit nodes not owned by you=
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.=
Schematic Creator=
The schematic creator is used to save a region of the world into a schematic file (.mts).=
To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.=
To save a region, use the block, enter the size and a schematic name and hit “Export schematic”. The file will always be saved in the world directory. Note you can use this name in the /placeschem command to place the schematic again.=
The other features of the schematic creator are optional and are used to allow to add randomness and fine-tuning.=
Y slices are used to remove entire slices based on chance. For each slice of the schematic region along the Y axis, you can specify that it occurs only with a certain chance. In the Y slice tab, you have to specify the Y slice height (0 @= bottom) and a probability from 0 to 255 (255 is for 100%). By default, all Y slices occur always.=
With a schematic node probability tool, you can set a probability for each node and enable them to overwrite all nodes when placed as schematic. This tool must be used prior to the file export.=
(owned by @1)=
This is an advanced tool which only makes sense when used together with a schematic creator. It is used to finetune the way how nodes from a schematic are placed.=
It allows you to set two things:=
1) Set probability: Chance for any particular node to be actually placed (default: always placed)=
2) Enable force placement: These nodes replace node other than air and ignore when placed in a schematic (default: off)=
BASIC USAGE:=
Punch to configure the tool. Select a probability (0-255; 255 is for 100%) and enable or disable force placement. Now place the tool on any node to apply these values to the node. This information is preserved in the node until it is destroyed or changed by the tool again. This tool has no effect on schematic voids.=
Now you can use a schematic creator to save a region as usual, the nodes will now be saved with the special node settings applied.=
NODE HUD:=
To help you remember the node values, the nodes with special values are labelled in the HUD. The first line shows probability and force placement (with “[F]”). The second line is the current distance to the node. Nodes with default settings and schematic voids are not labelled.=
To disable the node HUD, unselect the tool or hit “place” while not pointing anything.=
UPDATING THE NODE HUD:=
The node HUD is not updated automatically and may be outdated. The node HUD only updates the HUD for nodes close to you whenever you place the tool or press the punch and sneak keys simultaneously. If you sneak-punch a schematic creator, then the node HUD is updated for all nodes within the schematic creator's region, even if this region is very big.=
Schematic Void=
This is an utility block used in the creation of schematic files. It should be used together with a schematic creator. When saving a schematic, all nodes with a schematic void will be left unchanged when the schematic is placed again. Technically, this is equivalent to a block with the node probability set to 0.=
Just place the schematic void like any other block and use the schematic creator to save a portion of the world.=
Place schematic at the position specified or the current player position (loaded from @1). “-c” will clear the area first=
<schematic name>[.mts] [-c] [<x> <y> <z>]=
No schematic file specified.=
Schematic file could not be loaded!=
List schematic files in world path=
No schematic files.=
Convert .mts schematic file to .lua file (loaded from @1)=
<schematic name>[.mts] [comments]=
Failed!=

69
make_readme.lua Normal file
View File

@ -0,0 +1,69 @@
-- This file adds a command for generating the schemedit usage help readme
-- file, in Markdown format. The text is extracted from the metadata of
-- the items. This is only used for development purposes, after the
-- help text of any of the items was changed.
-- How to use: Temporarily set MAKE_README to true in init.lua, then
-- start the game as admin and run “/make_schemedit_readme”. Copy the
-- generated file back to the mod directory (USAGE.md).
-- Everything here is intentionally NOT translated because it is for text
-- files only.
-- Extract text from item definition
local get_text = function(item, field)
local text = minetest.registered_items[item][field]
-- Remove translation escapes
text = string.gsub(text, "\x1BE", "")
text = string.gsub(text, "\x1B%(T@schemedit%)", "")
-- Fix Markdown syntax error
text = string.gsub(text, "schematic_override", "`schematic_override`")
return text
end
-- Schemedit items to generate the readme from
local items = { "creator", "probtool", "void" }
minetest.register_chatcommand("make_schemedit_readme", {
description = "Generate the schemedit usage help readme file",
privs = {server=true},
func = function(name, param)
local readme = "## Usage help".."\n"
readme = readme .. "In this section you'll learn how to use the items of this mod.".."\n"
readme = readme .. "Note: If you have the `doc` and `doc_items` mods installed, you can also access the same help texts in-game (possibly translated).".."\n\n"
local entries = {}
for i=1, #items do
local item = items[i]
local desc = get_text("schemedit:"..item, "description")
local longdesc = get_text("schemedit:"..item, "_doc_items_longdesc")
local usagehelp = get_text("schemedit:"..item, "_doc_items_usagehelp")
readme = readme .. "### "..desc.."\n"
readme = readme .. longdesc .."\n\n"
readme = readme .. "#### Usage\n"
readme = readme .. usagehelp
if i < #items then
readme = readme .. "\n\n\n"
end
end
local path = minetest.get_worldpath().."/schemedit_readme.md"
local file = io.open(path, "w")
if not file then
return false, "Failed to open file!"
end
local ok = file:write(readme)
file:close()
if ok then
return true, "File written to: "..path
else
return false, "Failed to write file!"
end
end
})

View File

@ -1 +1,4 @@
name = schemedit
optional_depends = doc
description = Advanced tool for modders and advanced users to create and edit schematics.
min_minetest_version = 5.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 48 KiB

3
settingtypes.txt Normal file
View File

@ -0,0 +1,3 @@
# If enabled, exporting a schematic will also create a .lua file
# in addition to the .mts file.
schemedit_export_lua (.lua file schematic export) bool false