[Request] function WriteLnToChat(string, timer, color, hideONuser) end

4 replies [Last post]
UltiMaxKom
UltiMaxKom's picture
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2016-06-26
Posts: 381

function WriteLnToChat(string, timer, color, ONplayer) 
	local parameter = {
		string = "Message input",
		timer = "Display duration of the message",
		color = "Color of the message",
		ONplayer = {"player1", "player2", "player3"} or {"allplayer"}--,
	}
end

I hereby request (another) change for the current
function WriteLnToChat(string) ; chunk ; end
To a newer function with more capability such as color args (is this over-demanding, dear devs?). I feel it deserve more ability since I request the
function onChat(msgParam, timer, color, hide, ...) ; chunk ; end
So it could collaborate more efficiently in the future.

Also this time it has 'ONplayer' param meaning it works like the 'Team Chat (key: "Y")' which display the entered message to user with the same clan only (too bad we have no such feature like 'Player Private Message' (PM?) although many people ask how to do private message, poor ppl). It won't be so complicated to add, right? As if combined with onChat function I believe creator gain a better way to design their HW script in the future.

Boring PS: Its not a mandatory to make the newer function this way, it just a design suggestion, not a police. Let's say this line a hundred more times...

Thank you for your time, have a nice day/night ^^

╟───NW──────┼──────N╢

╓──────────────────╖ ╓──────────────────╖
⠀HP: ██████████ 1E9/1E91E9/1E9 ██████████ :MP
╙──────────────────╜ ╙──────────────────╜

Wuzzy
Wuzzy's picture
User offline. Last seen 4 days 12 hours ago. Offline
Joined: 2012-06-20
Posts: 1301

WriteLnToChat has been mostly added for debugging reasons which is why it is so simple.

I do not want to encourage scripters to use it extensively for messages. I believe it is generally a bad and lazy practice in many games to pollute the chat with lots of non-chat-related messages. Game messages are usually better placed elsewhere.

Hedgewars should not fall into the same trap.

In Hedgewars, most messages should simply go into AddCaption instead.

The chat should only be used for debug stuff, or technical messages like errors or warnings.

Hi, I am a Hedgewars developer. Smile

UltiMaxKom
UltiMaxKom's picture
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2016-06-26
Posts: 381

OP EDITED: hideONuser -> ONplayer ; fyi

Well...
Scripter doesn't need to spam this function tho, why would one?
I, myself will only use it for gameplay only. Since AddCaption disappear very quickly (sadly). Also, I bet the average player has no such capability to read and or get the message that fast since they focus to the core game (and then memorize them). I found chat way more convenient to tell player some important message about the game, not for such an unnecessary pile of chats. AddCaption honestly can't take up the task (either way, I've already used AddCaption too much, can't no more).

THOUGH, as you see...
the param 'timer' used to encounter overflow of messages. Scripter could simply set it right to make sure the match didn't get lame thanks to the chat. The permanent messages are only the message that very important and essential for the player to read. Please re-think the issue, in this case...

Also, the colors option is used to classify/categorize messages as either its a condition of the game, news, important event, note, or etc. This way, messages became more efficient to use.
NOT only used for an accessory, you may think.

Not to forget ONplayer param, we may send it to everyone or for someone only, specifically (current player?). It can be used as a private message if combined with onChat. Imagine: I type "/pm *player name* message" then the onChat process it and recognize it as a private message for *player name*, thus sending the message to *player name* only, using this function specifically the param ONplayer with the player name as the arg. It's powerful IMHO, a new way to organize chats, why not tho? No need to show all player the message us scripter wanted to send hehe

Take Monarchy *latest version* as an example.
The scripter use WriteLnToChat as a note for the player, a way to guide new players efficiently (not with AddCaption, I suppose). Even though sadly it limited to the same color only (purple irrc) =/

I believe devs should reconsider my proposal, it's not that 'overflow' as we may think. Let's use it wisely, properly, and for the necessary stuff only, an extension from the formerly debugging tool =)

I believe that we, won't fall into the trap if we open our eyes wide and steer, and see the path crystal clear =O

Thank you for the time and spoonful of concern ^^

╟───NW──────┼──────N╢

╓──────────────────╖ ╓──────────────────╖
⠀HP: ██████████ 1E9/1E91E9/1E9 ██████████ :MP
╙──────────────────╜ ╙──────────────────╜

Wuzzy
Wuzzy's picture
User offline. Last seen 4 days 12 hours ago. Offline
Joined: 2012-06-20
Posts: 1301

For messages that shall only be visible to the current player, you can use IsHogLocal(), however. Your suggested parameter is thus not needed.

As for captions being too quickly gone:
Well, this can be fixed by adding a GUI setting to adjust the display time of captions, maybe a percentage. This is a known suggestion.
We might even add a “caption log”, just like the chat log. I have no idea how it would work, however.
Captions might need a little love, I agree. But abusing the chat is NOT the answer.

The reason why I want to keep out game messages out of chat is because they interrupt the flow in the player chat. If chat is very busy, game-relevant messages get lost (so your “responsible use” argument flies out of the window, since Lua cannot control when players chat). If there are many game messages in chat, they seriously disrupt player chat. It's incredibly easy to get this wrong.
Therefore, chat stuff and game stuff must be kept visually separate.

Hi, I am a Hedgewars developer. Smile

UltiMaxKom
UltiMaxKom's picture
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2016-06-26
Posts: 381

Unfortunately, I believe Captions still won't do. I've already used caption so much in various capgrp channel, and it'll be abusing Captions in this case. On the other side, the caption we used to show important game message may get lost too, as it may be easily and simply replaced by another caption (sometimes there are rapid changes in the game, and caption replacing each other if multiple events showed up simultaneously, it'll be a mess for such important message). I can only rely on two things: HogSay or ShowMission as both has a persistent way to show message, without quickly fade off or replacing each other =/

Well, you got a sharp point there. The message is easily separated out by player spam/chat flow, I agreed. There's an option though, by locking the prioritized message below player chat (or above). By locking, I mean it'll stay on top as long the timer duration, without disturbing player chat log. OR, for another solution then I think it's a good idea to make the second messaging system, separated and independent from player chat log. It's either separated by placing it on some other space of the window OR more efficiently: A new hotkey to switch between messaging board; between player chat log and game message log. It'll put things as simple as possible tho. Although this way we need another function other than WriteLnToChat. As if it happens, the name "WriteLnToChat2" wouldn't be a problem too (or else, anything really).

The new messaging log won't bother the players tho, and will provide maximum persistency and best robust news delivery; from the game to the player and from the player to the game, as for gameplay, and for debugging =)

Anyway, thank you ^^

╟───NW──────┼──────N╢

╓──────────────────╖ ╓──────────────────╖
⠀HP: ██████████ 1E9/1E91E9/1E9 ██████████ :MP
╙──────────────────╜ ╙──────────────────╜

Copyright © 2004-2023 Hedgewars Project. All rights reserved. [ contact ]