[Request] function onChat(msgParam, timer, color, hide, ...) end

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

function onChat(msgParam, timer, color, hide, ...)
	parameter = {
		msgParam = "Chat input",
		timer = "Set display duration of message",
		color = "Set chat color in the chat log, if not hidden",
		hide = "Hide chat in the chat log",
		... = "vararg exp; Insert more parameters here"--,
	}
end

Yeah ukr: I request another function that for my perspective is quite essential for creating greater Lua script in Hedgewars. Imagine a gameplay system using chat only, or the more compact one. It'll be a hella lot easier to do specific things IMHO. There's should be an infinity possibility next up if devs would implement such function.
(e.g: Cheat-Codes, Debugging, Developer's Only-Code, etc)

Now imagine blocking such words from gameplay with this function
(e.g: Penisula, Uranus, Vegane, Duck, Beach, Sitting, Crop, Fork, use That Hoe Over There, Porthub, Six, and the other 100s most used English word *derpface*)

*Insert more potential usefulness of this function here*
(e.g: *Insert examples here*)

PS: Of course it's not a mandatory to name this function as "onChat", its just a design suggestion, not a police, and this is repeated over and over ikr.

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 1 week 5 days ago. Offline
Joined: 2012-06-20
Posts: 1301

I can't really think of an compelling use case for onChat.

The use case “custom chat commands” would be better implemented properly in the engine rather than scripts. If we do this at all.

For debugging, we have the /lua command.

Hi, I am a Hedgewars developer. Smile

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

This function is the soul mate for WriteLnToChat function
They should be married and be a legit couple and have some kids (e.g: /pm *player* *message* ; etc)
You wouldn't let them all alone in this cruel world, right?
So... I believe in devs with my entire trust, that they can do this easily and entirely
*giggle* ^^

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

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

User login

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