Fix command interface bugs

This commit is contained in:
Joachim Stolberg 2022-05-22 15:20:42 +02:00
parent 90dd1c3bbe
commit ac33080404
6 changed files with 12 additions and 11 deletions

View File

@ -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

View File

@ -1160,7 +1160,7 @@ techage.manual_DE.aText = {
"\n"..
" - Kommando 'on' zum Abspielen eines Sounds\n"..
" - Kommando 'sound <idx>' zur Auswahl eines Sounds über den Index\n"..
" - Kommando 'gain <volume>' zum Einstellen der Lautstärke über den '<volume>' Wert (0 bis 1.0).\n"..
" - Kommando 'gain <volume>' zum Einstellen der Lautstärke über den '<volume>' Wert (1 bis 5).\n"..
"\n"..
"\n"..
"\n",

View File

@ -1158,7 +1158,7 @@ techage.manual_EN.aText = {
"\n"..
" - Command 'on' to play a sound\n"..
" - Command 'sound <idx>' to select a sound via the index\n"..
" - Command 'gain <volume>' to adjust the volume via the '<volume>' value (0 to 1.0).\n"..
" - Command 'gain <volume>' to adjust the volume via the '<volume>' value (1 to 5).\n"..
"\n"..
"\n"..
"\n",

View File

@ -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 <idx>` zur Auswahl eines Sounds über den Index
- Kommando `gain <volume>` zum Einstellen der Lautstärke über den `<volume>` Wert (0 bis 1.0).
- Kommando `gain <volume>` zum Einstellen der Lautstärke über den `<volume>` Wert (1 bis 5).
[ta3_soundblock|image]

View File

@ -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 <idx>` to select a sound via the index
- Command `gain <volume>` to adjust the volume via the `<volume>` value (0 to 1.0).
- Command `gain <volume>` to adjust the volume via the `<volume>` value (1 to 5).
[ta3_soundblock|image]

View File

@ -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