Go to file
Robert Zenz acc6178a21 Added usage documentation. 2015-12-19 12:11:17 +01:00
deps Updated dependencies. 2015-10-08 21:33:38 +02:00
doc Revised activation system. 2015-12-19 12:09:51 +01:00
mods Revised activation system. 2015-12-19 12:09:51 +01:00
.gitmodules Initial commit. 2015-07-25 16:25:35 +02:00
LICENSE Added LICENSE. 2015-07-26 21:21:02 +02:00
Makefile Updated Makefile. 2015-09-12 16:39:29 +02:00
README Added usage documentation. 2015-12-19 12:11:17 +01:00
README.md Added README. 2015-07-26 12:20:05 +02:00

README.md

minetest-australopithecus-voice

A replacement for the default chat system that makes it behave more like voices. That means you can only see the messages of other players if you're in a certain range to them. If you move out of this range, you might only get part of the messages, or nothing at all.

Features

  • All chat messages are limited by distance.
  • Three "volumes": talking, whispering and shouting.
  • Range of the messages are further limited if there is no line of sight.
  • No global chat, except with a special privilege.
  • Completely configurable from the configuration.

How does it work?

There are basically three "volumes" a player can say something in, talk, shout and whisper. Shout reaches obviously the farthest, followed by talk and whisper.

If you want to "hear" a player, you need to be in a certain range to them, otherwise you might only get part of what was said or nothing at all. Additionally, if you can't see the player, the range is further limited, that means that a wall will severly impact if you're able to hear a player or not.

By default a player only talks, that means that every normal chat message is converted. Additionally there are the following commands avaialble:

/t or /talk     Talk, medium range. Is default for messages.
/w or /whisper  Whisper, low range.
/s or /shout    Shout, high range.
/g or /global   Global, needs voice_global privilege

There is no global chat anymore as long as voice is activated.

Usage

The system activates itself, you just need to add the mod to the subgame.

Configuration

The system can be configured by adding settings to the minetest.conf:

# If the system should be activated, defaults to true.
voice_activate = true.

# The name of the privilege required to use the global command,
# defaults to "voice_global".
voice_global_privilege = voice_global

# The modificator which is applied to the ranges if the target
# does not have a line of sight to the source, defaults to 0.4.
voice_line_of_sight_mod = 0.4


# The parameters that follow are range definitions.
# Understandable: Everything within this range will be understandable.
# Abstruse: Everything within this range will be abstrused the further
#           the target is away.
# Incomprehensible: Everything within this range will not be understandable.

voice_shout_understandable = 45
voice_shout_abstruse = 60
voice_shout_incomprehensible = 80

voice_talk_understandable = 6
voice_talk_abstruse = 12
voice_talk_incomprehensible = 17

voice_whisper_understandable = 3
voice_whisper_abstruse = 4
voice_whisper_incomprehensible = 5

Callbacks

You can register callbacks for every send message in which you can either suppress or modify it. The signature for the callbacks is:

function(
    player,     -- The Player object of the player that is sending
                -- the message.
    type,       -- The type of the message, one of the voice.TYPE_*
                -- constants.
    suppressed, -- If the message would be suppressed.
    message)    -- The message itself.

returns
    suppress,   -- true if the message should be suppressed.
                -- nil to keep the current status.
    message     -- The message that should be send instead.
                -- nil to keep the current message.

Some examples:

-- This callback suppresses all shouts.
voice.register_on_message(function(player, type, suppressed, message)
    return (type == voice.TYPE_SHOUT)
end)

-- This callback sends a completely different message.
voice.register_on_message(function(player, type, suppressed, message)
    return false, "Hello there!"
end)

The callbacks are called in the order they have been registered, the last callback is the one that can decide whether the message is actually send or suppressed. If the message is is modified, the modified message is handed to all callbacks that follow.

Force activation

You can force the activation of the system, even if it has been disabled in the configuration, by invoking voice.activate_internal.