[Mod] RandomMessages [random_messages]

Post Reply
arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

[Mod] RandomMessages [random_messages]

by arsdragonfly » Post

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_ ... 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
Last edited by sfan5 on Thu Jun 20, 2013 20:08, edited 1 time in total.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

I know that from Minecraft Classic servers. It is very practial to give hints to new players.
A list of my mods can be found here.

User avatar
Tedypig
Member
Posts: 286
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear
Location: Largo, FL, USA

by Tedypig » Post

"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?
01010100 01100101 01100100 01111001 01110000 01101001 01100111

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

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

User avatar
Zeg9
Member
Posts: 608
Joined: Fri Sep 21, 2012 11:02
Location: France

by Zeg9 » Post

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
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

by arsdragonfly » Post

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.

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

by arsdragonfly » Post

updated to avoid crash on startup.

tfranko
Member
Posts: 13
Joined: Mon Oct 06, 2014 22:34

Re: [Mod] RandomMessages [random_messages]

by tfranko » Post

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!

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Mod] RandomMessages [random_messages]

by rubenwardy » Post

Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

xisd
Member
Posts: 54
Joined: Sun Oct 02, 2016 22:38

Re: [Mod] RandomMessages [random_messages]

by xisd » Post

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 ... _signs.zip
Code : https://github.com/xisd/random_messages

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] RandomMessages [random_messages]

by texmex » Post

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.

xisd
Member
Posts: 54
Joined: Sun Oct 02, 2016 22:38

Re: [Mod] RandomMessages [random_messages]

by xisd » Post

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 !

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] RandomMessages [random_messages]

by texmex » Post

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… :)

xisd
Member
Posts: 54
Joined: Sun Oct 02, 2016 22:38

Re: [Mod] RandomMessages [random_messages]

by xisd » Post

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

zaoqi
Member
Posts: 42
Joined: Sat Jan 07, 2017 12:14
GitHub: zaoqi
IRC: zaoqi
In-game: zaoqi

Re: [Mod] RandomMessages [random_messages]

by zaoqi » Post

为什么依赖default?
I speak en_CN/zh_CN/wzh_ACN.
My mods: ZNM's Not Minecraft Minecraft-like Commands Crafting+/gamemode

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] RandomMessages [random_messages]

by texmex » Post

Thank you xisd, that is awesome. I'll check it out.

zaoqi
Member
Posts: 42
Joined: Sat Jan 07, 2017 12:14
GitHub: zaoqi
IRC: zaoqi
In-game: zaoqi

Re: [Mod] RandomMessages [random_messages]

by zaoqi » Post

I speak en_CN/zh_CN/wzh_ACN.
My mods: ZNM's Not Minecraft Minecraft-like Commands Crafting+/gamemode

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] RandomMessages [random_messages]

by texmex » Post

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.

xisd
Member
Posts: 54
Joined: Sun Oct 02, 2016 22:38

Re: [Mod] RandomMessages [random_messages]

by xisd » Post

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

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] RandomMessages [random_messages]

by texmex » Post

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.

xisd
Member
Posts: 54
Joined: Sun Oct 02, 2016 22:38

Re: [Mod] RandomMessages [random_messages]

by xisd » Post

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).

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] RandomMessages [random_messages]

by Fixer » Post

included ingame mod profiler, to enable look minetest.conf

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 12 guests