Page 1 of 1

[Mod] RandomMessages [random_messages]

PostPosted: Wed Jun 19, 2013 07:15
by arsdragonfly
RandomMessages mod by arsdragonfly.

This mod adds random messages to the server.
Put your messages in (world directory)/random_messages, 1 message per line.
Messages can be all kinds of hints, mod usage, etc.Install this mod if you're a server admin who wants to notify players these stuff.
In minetest.conf, random_messages_interval decides how often a message is sent.
License: CC0
Download: https://github.com/arsdragonfly/random_messages/archive/master.zip
GitHub: https://github.com/arsdragonfly/random_messages
Dependencies: default
Enjoy it! ^_^

| | |
vvv fooooooo and baaaaar are messages. I lowered the interval, of course.
Image
6/19/2013

PostPosted: Thu Jun 20, 2013 19:03
by Sokomine
I know that from Minecraft Classic servers. It is very practial to give hints to new players.

PostPosted: Sun Jul 07, 2013 19:48
by Tedypig
"Put your messages in (world directory)/random_messages, 1 message per line."

Do I make a new .txt file in the mod folder, or what do I do?

PostPosted: Sun Jul 07, 2013 20:05
by Mito551
Tedypig wrote:"Put your messages in (world directory)/random_messages, 1 message per line."

Do I make a new .txt file in the mod folder, or what do I do?


just find text file with fooooooo and baaaaar

PostPosted: Mon Jul 08, 2013 09:17
by Zeg9
Tedypig wrote:"Put your messages in (world directory)/random_messages, 1 message per line."

Do I make a new .txt file in the mod folder, or what do I do?

So this is in your world folder, not mod :p

PostPosted: Fri Jul 12, 2013 01:14
by arsdragonfly
Tedypig wrote:"Put your messages in (world directory)/random_messages, 1 message per line."

Do I make a new .txt file in the mod folder, or what do I do?

IIRC this file will be created when you run this mod for the first time.

PostPosted: Sat Mar 22, 2014 16:03
by arsdragonfly
updated to avoid crash on startup.

Re: [Mod] RandomMessages [random_messages]

PostPosted: Fri Oct 10, 2014 03:17
by tfranko
I added this code to the init.lua file. It adds a /rm command in order to show all of the messages in-game. I think it helps to highlight some of the more useful commands and/or game-play aspects players may be interested in, as opposed to /help or /help all which lists everything.

Code: Select all
minetest.register_chatcommand("rm", {
    params = "",
    description = "Show all random help messages in chat.",
    func = function(name)

       for key,value in pairs(random_messages.messages) do
           local message = key .. ': ' .. value
           minetest.chat_send_player(name, message)
       end

    end
})


Wanted to share it with you here in case it's helpful to anyone. Thanks for the mod, by the way, it's working great!

Re: [Mod] RandomMessages [random_messages]

PostPosted: Mon Feb 15, 2016 23:06
by rubenwardy

Re: [Mod] RandomMessages [random_messages]

PostPosted: Wed Jan 18, 2017 13:35
by xisd
Hi, I posted a fork of this mod on github.

As the original, you can write and edit messages located in the world folder ( in a text file file )
+ You can now use a default messages file located in mod directory (When a new world is created, its content is copied to the file created in the world folder)
+ You can use a localized suffix for this default file (e.g : messages.fr.txt, messages.es.txt, ...)
+ Messages are written on signs placed around the world. (if signs mod or signs_lib mods are not used, a new sign_yard node is added)
+ Configuration file (config.lua) to turn on/off the chat messages or the signs and other options

Chat messages are disabled by default : edit config.lua to use them
A file messages.fr.txt with hints I use on my servers is included, you might want to remove it (or at least edit its content since it may not correspond to your subgame or mods)

Download : https://github.com/xisd/random_messages/archive/with_signs.zip
Code : https://github.com/xisd/random_messages

Re: [Mod] RandomMessages [random_messages]

PostPosted: Thu Jan 19, 2017 19:31
by texmex
xisd wrote:+ Messages are written on signs placed around the world. (if signs mod or signs_lib mods are not used, a new sign_yard node is added)


This is a great idea! Server admins may add storytelling pieces to the world. Some issues still linger for me before putting it to use on a server. I'm not using signs_lib, just regular signs mod.
• Can you have it not spawn i water and other such strange places?
• Can I spawn even lesser amount of signs so that they're more rare?
• It would be nice to have the yardsigns as items too, so that when players break them they are reusable. Or at least dropping as empty regular signs.

Re: [Mod] RandomMessages [random_messages]

PostPosted: Sat Jan 21, 2017 11:28
by xisd
texmex wrote:I'm not using signs_lib, just regular signs mod.

Do you means the signs included in 'default' mod, or the 'signs' mod
I am using signs_lib but since it registers signs with signs: prefix, I assumed it should use the same node as the signs mod, but that doesn't sound so obvious now... maybe it need to be checked

texmex wrote:• Can you have it not spawn i water and other such strange places?

I had actually fixed that before reading your post ! they should not spawn on water anymore.
What other strange places did you have in mind ?

texmex wrote:• Can I spawn even lesser amount of signs so that they're more rare?

Not yet, but that's not difficult to implement, this should be done by the end of the weekend
Edit : There is now a 'chance_of_signs_in_chunk' options, along with signs_per_chunk, this should allow fine tuning. (e.g : setting 'chance_of_signs_in_chunk' to a low value and 'signs_per_chunk' to a high value would result in rare areas but filled with signs )

texmex wrote:• It would be nice to have the yardsigns as items too, so that when players break them they are reusable. Or at least dropping as empty regular signs.

They should already drop as empty regular signs .. that's very strange if they are not.
Do you use a recent version of default mod ? i think there has been some recent changes in signs name that could be the cause of that.
Anyway I've thought about making the yard signs craftable/collectable and I wasn't totally sure it should be done, but I can't remember why,... so yeah I'll do that.
edit : I will have to take a look at the sign api from default (meta handling and formspec) to see if I can call it as is, not just duplicate it but calling functions from default.
Otherwise it would result in two similar items (sign and yard sign) handled by two different mods (so potentially differently) and I'm not very fond of that. In this case, it would be neater to add compatibility for most signs mod out there rather than turning this into another sign mod.
edit : Forget what I said, its done !

Re: [Mod] RandomMessages [random_messages]

PostPosted: Fri Feb 03, 2017 21:02
by texmex
That's so good xisd, thank you for your effort. It works as intended with the sign density. The two bugs I found was that the inventory item has no tooltip title and that signs spawn on treetops. Perhaps it's good to check for underlying node before spawning?

Ideally it would also spawn in already generated areas… :)

Re: [Mod] RandomMessages [random_messages]

PostPosted: Wed Feb 08, 2017 22:49
by xisd
texmex wrote:That's so good xisd, thank you for your effort. It works as intended with the sign density. The two bugs I found was that the inventory item has no tooltip title and that signs spawn on treetops. Perhaps it's good to check for underlying node before spawning?

Ideally it would also spawn in already generated areas… :)


Thanks. I updated it :
- Yard sign node description with intllib support
- abm for spawning in generated areas with config option for frequency and limit number of signs in a certain radius
- a few more options in the config file including list of nodes allowed for spawning signs

Re: [Mod] RandomMessages [random_messages]

PostPosted: Thu Feb 09, 2017 12:15
by zaoqi
为什么依赖default?

Re: [Mod] RandomMessages [random_messages]

PostPosted: Thu Feb 09, 2017 20:13
by texmex
Thank you xisd, that is awesome. I'll check it out.

Re: [Mod] RandomMessages [random_messages]

PostPosted: Fri Feb 10, 2017 05:06
by zaoqi

Re: [Mod] RandomMessages [random_messages]

PostPosted: Sat Feb 11, 2017 17:55
by texmex
I was wondering. Could it be made possible to update the text of already placed signs? To correct a spelling error in the random_messages file for instance.

Re: [Mod] RandomMessages [random_messages]

PostPosted: Tue Feb 14, 2017 14:05
by xisd
texmex wrote:I was wondering. Could it be made possible to update the text of already placed signs? To correct a spelling error in the random_messages file for instance.


I added a new ABM that acts on already placed signs :
It does not instantaneously take corrections, but every signs placed by the mod will eventually get a new message picked from the (corrected) random_messages file.
They also have a (configurable) chance to be removed

I wasn't sure about that at first but it's turning out to be something quite nice : dynamically placed evolving signs

Re: [Mod] RandomMessages [random_messages]

PostPosted: Tue Feb 14, 2017 14:59
by texmex
xisd wrote:
texmex wrote:I was wondering. Could it be made possible to update the text of already placed signs? To correct a spelling error in the random_messages file for instance.


I added a new ABM that acts on already placed signs :
It does not instantaneously take corrections, but every signs placed by the mod will eventually get a new message picked from the (corrected) random_messages file.
They also have a (configurable) chance to be removed

I wasn't sure about that at first but it's turning out to be something quite nice : dynamically placed evolving signs

This is very useful for having a developing storytelling of a multiplayer world, thank you. One thing I noticed with the ABM switched on is that it slowed down chunk generation drastically. I have noticed some mod developers using some performance tool on their mods. Perhaps it'd be useful.

Re: [Mod] RandomMessages [random_messages]

PostPosted: Tue Feb 14, 2017 21:46
by xisd
texmex wrote:This is very useful for having a developing storytelling of a multiplayer world, thank you. One thing I noticed with the ABM switched on is that it slowed down chunk generation drastically. I have noticed some mod developers using some performance tool on their mods. Perhaps it'd be useful.


I feared that it would be an issue, do you have some examples of these performance tools ?
I also though about using LBMs instead of ABMs, changes would only happen each time server (not later in-game) restart my understanding is that is would slow down the server when it starts but would be less demanding later (but I might be wrong about that).

Re: [Mod] RandomMessages [random_messages]

PostPosted: Sat Sep 02, 2017 15:35
by Fixer
included ingame mod profiler, to enable look minetest.conf