Page 1 of 1

server message announcement(s) every x ticks.

Posted: Mon Sep 19, 2016 10:56 am
by impetus maximus
i think it would be helpful if we could add messages to the server chat from the server itself.
such as "join voice chat room using [client name] at [Chat IP address:port]" every 3600 ticks etc.
have the ability to have multiple messages with a pause between.

Re: server message announcement(s) every x ticks.

Posted: Mon Sep 19, 2016 12:06 pm
by Deadly-Bagel
A "Join voice chat" message would get very annoying very quickly. Either you like the idea and you join it, or you don't like the idea and you don't. Further messages are therefore irrelevant, this is better in a welcome text.

In fact I can't really think of anything that would be best suited in a interval broadcast other than maybe a multiplayer speedrun that does a broadcast every 10 mins or something so you can keep track of time.

Re: server message announcement(s) every x ticks.

Posted: Mon Sep 19, 2016 1:29 pm
by impetus maximus
i hear ya about being annoying. ok, give the player the option to hide the messages then. or limit the number of times it's sent to players.
even just a single welcome message would be nice to have.

Re: server message announcement(s) every x ticks.

Posted: Mon Sep 19, 2016 3:02 pm
by JoeSchmoe
There should be a message upon joining, only to the joining player.

Re: server message announcement(s) every x ticks.

Posted: Mon Sep 19, 2016 3:10 pm
by ssilk
Boa. I hate it, when I log into any system and that "reminds" me all the time to something. Very bad behavior.

For the case here showed I suggest to implement a voice-chat into the game. :)

And for other cases: I would prefer to have some kind of extra-log, where the server can post (important) messages to.
As player you see: There are messages, or there is a new message (like skype notification on MacOS).
You can read them and mark them as read, but can still re-read the log. If you re-login that messages are remembered as read.

Re: server message announcement(s) every x ticks.

Posted: Mon Sep 19, 2016 5:16 pm
by impetus maximus
ssilk wrote:Boa. I hate it, when I log into any system and that "reminds" me all the time to something. Very bad behavior.

For the case here showed I suggest to implement a voice-chat into the game. :)

And for other cases: I would prefer to have some kind of extra-log, where the server can post (important) messages to.
As player you see: There are messages, or there is a new message (like skype notification on MacOS).
You can read them and mark them as read, but can still re-read the log. If you re-login that messages are remembered as read.
agreed. don't want to see the same message over and over.

in game voice chat would be a bonus. but mumble works for me.

yes, a message system to players sounds cool. announcing upcoming events etc.

Re: server message announcement(s) every x ticks.

Posted: Fri Nov 18, 2016 7:20 pm
by studmuffin
This was one of the first scenario mod's we created. Every 9 minutes 55 seconds it will announce a message to our server. (had some instability issue's in the past using 10 minute intervals, having the announcement fire along side every save. This is pretty much fixed now, but we still do it this way for good measure.) We have it looping multiple messages. We use this for griefing announcements, and joining discord voice chat announcements, so ensure players know where to go.

Honestly, the announcements have been awesome. We have custom join messages on how to find the discord to alert an admin if someone starts griefing. But people always forget, and no one reads the server description before joining. So announcements have been a game saver. If it works, it's not stupid.

Code: Select all

--stored in the locale/en/announcement.cfg file
--but you can hard code messages here as well.
local announcements = {
	{"msg-announce1"},
	{"msg-announce2"}
}
-- Go through the announcements, based on the delay set in config
-- @param event on_tick event
function show_announcement(event)
	global.last_announcement = global.last_announcement or 0
	global.announcement_delay = global.announcement_delay or 595;
	if (game.tick / 60 - global.last_announcement > global.announcement_delay) then
		global.current_message = global.current_message or 1
		game.print(announcements[global.current_message])
		global.current_message = (global.current_message == #announcements) and 1 or global.current_message + 1
		global.last_announcement = game.tick / 60
	end
end
People in this thread say it would get annoying.. but it's really not bad at all. But just in case, since the timing values are stored in global variables, the time can be increased via commands without requiring a game restart:

Code: Select all

/c global.announcement_delay = 1800 --increase to 20 minutes

Re: server message announcement(s) every x ticks.

Posted: Fri Nov 18, 2016 10:32 pm
by impetus maximus
wow studmuffin. so all i have to do is create a file "locale/en/announcement.cfg" and paste that code in?
do i have to add anything to my server.bat file?

thanks. 8-)

Re: server message announcement(s) every x ticks.

Posted: Fri Nov 18, 2016 11:09 pm
by studmuffin
The code I provided in my last post goes inside your control.lua file in your scenario, which also needs a call to the function "show_announcement()" in an on_tick event. No change to your .bat file. This script is located inside your save file. So you'll have to generate new maps including this scenario.

full examples:
Using a locale file
Without using a locale file
For a full view of our scenario, visit https://github.com/3RaGaming/3Ra-Enhanced-Vanilla

Re: server message announcement(s) every x ticks.

Posted: Sat Nov 19, 2016 2:46 pm
by ssilk
Another typical example of "This should not go into vanilla game", cause it is extremely special functionality.

IMHO this should be part of an "admin mod", that also handles "right" of players, can do whitelisting, and many more stuff. The typical player should not care about it, just needs to install it.

See this list: viewtopic.php?f=80&t=32968 Collection of Of Ideas around Multiplayer: Lobby-Features, Joining, Mod&Game-Loading, ...