Page 1 of 1

[Mod] Chat2 [0.1.0] [chat2]

PostPosted: Sat Jun 20, 2015 10:30
by lag01
This mod is meant to solve problem when game chat is too intensive - players logging in/out, speaking among themselves, system messages etc. and it is hard to follow messages addressed to you.
Modes:
  • default: show you messages in different colors, when someone mention your name or PM you, also nearby chat or shouts(!).
  • "/chat2 *": show also regular messages, so it can be used instead of default chat (close default game chat by pressing F2)
  • Can turn on/off by writing command "/chat2"

License: LGPL 2.1 or later.
Dependencies: chat_anticurse? (my other mod, but should work without it too)

Download: zip
Browse on: GitHub

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Sat Jun 20, 2015 19:15
by rubenwardy
A few tips

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
function chat2.add_message(player, new_text, new_color)


Is the same as

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
chat2.add_message = function(player, new_text, new_color)


With

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if something == nil then


You can use

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if not something then


Providing 'something' isn't a boolean.

Coloured chat is going to be added soon™ to the Minetest core, just as a warning.

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Sat Jun 20, 2015 19:54
by lag01
rubenwardy wrote:A few tips
...
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
function chat2.add_message(player, new_text, new_color)

...
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if not something then

...

Thanks, i will try to remember that next time!

rubenwardy wrote:Coloured chat is going to be added soon™ to the Minetest core, just as a warning.

Oh, that would be nice, especially with good api. Meanwhile, we can test colored chat in real world environment using mods like this one :)

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Sun Jul 05, 2015 19:16
by amadin
Does it is bug? Chat2 cuts long sentences whith message <invalid multibyte string>.
Image

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Mon Jul 06, 2015 07:47
by Krock
amadin wrote:Does it is bug? Chat2 cuts long sentences whith message <invalid multibyte string>.
http://s18.postimg.org/qi3ihk61l/image.jpg

That's a Minetest core issue. It looks like the character conversion failed there.
What you can do is: check for a newer client version and/or report this as an issue on GitHub.

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Mon Jul 06, 2015 10:33
by lag01
problem is because i use wrong function string.sub() to split utf8 string, and it sometimes split some utf8 letters in half, resulting in this error.
later will think of solution...

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Mon Jul 06, 2015 19:51
by lag01
I tried to write custom splitting code, but <invalid multibyte string> still occurs sometimes. So need future testing...

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Tue Jul 07, 2015 16:22
by amadin
Do you can turn off case sensitive of nicknames in chat and chat commands by your mod? If not, maybe you know how to do it to me?

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Tue Jul 07, 2015 19:04
by lag01
amadin wrote:Do you can turn off case sensitive of nicknames in chat and chat commands by your mod? If not, maybe you know how to do it to me?

Here, in attachment. I changed two lines, so your nick and search words are searched case insensitive. It applies to all players, so i am not sure if it is ok as default.

Please report to me, if <invalid multibyte string> still happens.

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Sun Jul 12, 2015 04:12
by amadin
lag01 wrote:
amadin wrote:Do you can turn off case sensitive of nicknames in chat and chat commands by your mod? If not, maybe you know how to do it to me?

Here, in attachment. I changed two lines, so your nick and search words are searched case insensitive. It applies to all players, so i am not sure if it is ok as default.

Please report to me, if <invalid multibyte string> still happens.

Nothing changed - i still can use only case sensitive nicknames and and i still see error <invalid multibyte string>.

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Thu Jul 16, 2015 06:53
by amadin
I propose to introduce an alternative to the command / msg - the command / m (for speed type) and / n (near) for messages to players near me (do non write in public chat). I do not know whether or not it is feasible, but would like to input box ("T") remembers the previous chat command as the linux console, because f10 is far and it closes (covers) half of screen.

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Wed Oct 28, 2015 17:27
by Samson1
Are there colours for Admins? Server owners?

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Wed Oct 28, 2015 17:36
by kaadmy
How would you figure out who's a moderator/admin? Currently admins/mods just have different privs, all of which any player can have. Maybe have a builtin list of moderators?

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Wed Nov 04, 2015 13:42
by orwell
kaadmy wrote:How would you figure out who's a moderator/admin? Currently admins/mods just have different privs, all of which any player can have. Maybe have a builtin list of moderators?


Why not add a privilege (e.g. "moderator") to identify moderators? Maybe add more privs like this and make colors configurable in your mod. This wouldn't need a server restart when adding a new moderator.

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Wed Nov 04, 2015 15:53
by rubenwardy
Whilst that's an abuse of the privilege system (it's meant to grant players the ability to do something, not to rank and list users) it'll be the quickest way to do it.

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Sun Nov 08, 2015 20:03
by orwell
rubenwardy wrote:Whilst that's an abuse of the privilege system ...


Maybe it is not the purpose of the privilege system, but if you have not too many different ranks, it's just right.
BTW, being a moderator actually IS a privilege.

Re: [Mod] Chat2 [0.1.0] [chat2]

PostPosted: Mon Nov 16, 2015 16:21
by orwell
Just uploaded that mod. It's not that much code. You could use the idea (or even the code, then include the copyright notice in license.txt).