From 3c3640a59384a979f5d79d7aa8f7fad8e4ffcd3b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 31 Jan 2022 00:36:22 +0100 Subject: [PATCH] Enable Creative Mode if map editing is active --- DEVELOPERS.md | 6 ++++-- mods/tutorial/init.lua | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DEVELOPERS.md b/DEVELOPERS.md index c66c84d..2d1e00a 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -12,11 +12,13 @@ The tutorial castle is saved in the game itself in schematics and other binary m 2. Trust the code. In the settings menu or `minetest.conf`, add `tutorial_mapgen` to `secure.trusted_mods` 3. In `minetest.conf`, add `tutorial_debug_map_editing = true` 4. In `minetest.conf`, add `tutorial_debug_edit_item_spawners = true` -5. Start Minetest and create a new world, enable Creative Mode and enter the world in singleplayer +5. Start Minetest and create a new world and enter the world in singleplayer (there should be a confirmation message in chat) 6. Edit the map to your likings 7. Grant yourselves the `tutorialmap` privilege 8. Use `/tsave` command to save the map +Note: `tutorial_debug_map_editing=true` will automatically enable Creative Mode. + The changes will end up in `/mapdata`. Copy this directory to `/mods/tutorial_mapgen`, overwriting files, if neccessary. If you want to edit item spawn positions, see the details below. @@ -39,7 +41,7 @@ tutorial_debug_edit_item_spawners = true This enables the `/treset` and `/tsave` commands to help editing the schematic. It also forces the Tutorial to only generate the raw castle, not the grasslands. Also, the item spawners become visible. -Create a new world in Creative Mode. Now edit the map to your likings using your instant digging power and the creative inventory. You can of course WorldEdit to speed up the process. +Create a new world with setting `tutorial_debug_map_editing` set to `true`. Now edit the map to your likings using your instant digging power and the creative inventory. You can of course WorldEdit to speed up the process. If you're finished, grant yourself the `tutorialmap` privilege and use the `/tsave` command. This updates the map files in `/mapdata`. Note that there are limits as for how big the tutorial castle can be. Copy the contents of this directory to the `tutorial_mapgen` mod under `mapdata` and overwrite files as neccessary. Test your changes by creating a new world. If everything went fine, you can commit your changes now. diff --git a/mods/tutorial/init.lua b/mods/tutorial/init.lua index 56673cf..3422580 100644 --- a/mods/tutorial/init.lua +++ b/mods/tutorial/init.lua @@ -6,6 +6,9 @@ local edit_item_spawners = minetest.settings:get_bool("tutorial_debug_edit_item_ -- See tutorial_mapgen/init.lua local map_editing = minetest.settings:get_bool("tutorial_debug_map_editing") +if map_editing then + minetest.settings:set_bool("creative_mode", true) +end -- == END OF DEBUG SETTINGS ==