From ac33080404a76b25b9fe8a7e3c3284ec771ec297 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 22 May 2022 15:20:42 +0200 Subject: [PATCH] Fix command interface bugs --- README.md | 9 +++++---- doc/manual_DE.lua | 2 +- doc/manual_EN.lua | 2 +- manuals/manual_ta3_DE.md | 2 +- manuals/manual_ta3_EN.md | 2 +- move_controller/soundblock.lua | 6 +++--- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 42ee4f0..e5d8a5f 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,9 @@ Tech Age, a mod to go through 5 tech ages in search of wealth and power. -**Tech Age (techage) is the successor to TechPack V2, at first glance similar and yet completely different!** - ![screenshot](https://github.com/joe7575/techage/blob/master/screenshot.png) - Important facts: - techage is not backwards compatible and cannot be installed on a server together with TechPack - techage is significantly more extensive, since additional mods are integrated @@ -22,6 +19,10 @@ Important facts: In contrast to TechPack, the resources are more limited and it is much more difficult to pass all levels. (no endless ore generation by means of cobble generators) +**Techage blocks store information outside of the block. This is for performance reasons. +If you move, place, or remove blocks with any tool, at best, only the information is lost. +In the worst case, the server crashes.** + [Manuals](https://github.com/joe7575/techage/wiki) @@ -75,7 +76,7 @@ For the installation of 'luarocks' (if not already available), see [luarocks](ht Available worlds will be converted to 'lsqlite3', but there is no way back, so: -** Never disable 'lsqlite3' for a world that has already been used!** +**Never disable 'lsqlite3' for a world that has already been used!** ### History diff --git a/doc/manual_DE.lua b/doc/manual_DE.lua index f6a3155..1d97d31 100644 --- a/doc/manual_DE.lua +++ b/doc/manual_DE.lua @@ -1160,7 +1160,7 @@ techage.manual_DE.aText = { "\n".. " - Kommando 'on' zum Abspielen eines Sounds\n".. " - Kommando 'sound ' zur Auswahl eines Sounds über den Index\n".. - " - Kommando 'gain ' zum Einstellen der Lautstärke über den '' Wert (0 bis 1.0).\n".. + " - Kommando 'gain ' zum Einstellen der Lautstärke über den '' Wert (1 bis 5).\n".. "\n".. "\n".. "\n", diff --git a/doc/manual_EN.lua b/doc/manual_EN.lua index 609a606..d25966b 100644 --- a/doc/manual_EN.lua +++ b/doc/manual_EN.lua @@ -1158,7 +1158,7 @@ techage.manual_EN.aText = { "\n".. " - Command 'on' to play a sound\n".. " - Command 'sound ' to select a sound via the index\n".. - " - Command 'gain ' to adjust the volume via the '' value (0 to 1.0).\n".. + " - Command 'gain ' to adjust the volume via the '' value (1 to 5).\n".. "\n".. "\n".. "\n", diff --git a/manuals/manual_ta3_DE.md b/manuals/manual_ta3_DE.md index 5902650..48ee85d 100644 --- a/manuals/manual_ta3_DE.md +++ b/manuals/manual_ta3_DE.md @@ -679,7 +679,7 @@ Die Sounds können über das Menü und über ein Kommando ausgewählt und abgesp - Kommando `on` zum Abspielen eines Sounds - Kommando `sound ` zur Auswahl eines Sounds über den Index -- Kommando `gain ` zum Einstellen der Lautstärke über den `` Wert (0 bis 1.0). +- Kommando `gain ` zum Einstellen der Lautstärke über den `` Wert (1 bis 5). [ta3_soundblock|image] diff --git a/manuals/manual_ta3_EN.md b/manuals/manual_ta3_EN.md index 1226097..67af7fd 100644 --- a/manuals/manual_ta3_EN.md +++ b/manuals/manual_ta3_EN.md @@ -672,7 +672,7 @@ The sounds can be selected and played via the menu and via command. - Command `on` to play a sound - Command `sound ` to select a sound via the index -- Command `gain ` to adjust the volume via the `` value (0 to 1.0). +- Command `gain ` to adjust the volume via the `` value (1 to 5). [ta3_soundblock|image] diff --git a/move_controller/soundblock.lua b/move_controller/soundblock.lua index 24ab6fd..73aaa90 100644 --- a/move_controller/soundblock.lua +++ b/move_controller/soundblock.lua @@ -98,15 +98,15 @@ techage.register_node({"techage:ta3_soundblock"}, { if not mem.blocking_time or (mem.blocking_time < minetest.get_gametime()) then local idx = M(pos):get_int("idx") local ogg = techage.OggFileList[idx or 1] or techage.OggFileList[1] - local gain = M(pos):get_float("gain") + local gain = M(pos):get_int("gain") play_sound(pos, ogg, gain) mem.blocking_time = minetest.get_gametime() + 2 return true end elseif topic == "sound" then - M(pos):get_int("idx", tonumber(payload or 1) or 1) + M(pos):set_int("idx", tonumber(payload or 1) or 1) elseif topic == "gain" then - M(pos):get_int("gain", tonumber(payload or 1) or 1) + M(pos):set_int("gain", tonumber(payload or 1) or 1) else return "unsupported" end