Page 1 of 1

Message to team / players

Posted: 16 Nov 2014, 14:46
by coolmann
Hi,
I want to send a message to my allies, and to all players, but i dont get it to work.

I tried Spring.SendMessage and such.

I want to see it like i write myself with a: and s: or without.

Greetings

Re: Message to team / players

Posted: 16 Nov 2014, 15:37
by Silentwings
To make it exactly as though you typed the command you can use e.g. Spring.SendCommands("say a: hello allies").

Re: Message to team / players

Posted: 16 Nov 2014, 16:37
by coolmann
Ah, that easy thx :)

Just for understanding, i have the following code:
Spring.SendCommands("say a: hello allies")
Spring.Echo ("Echo")
but the first to appear ingame is Echo.
Why?

Greetings

Re: Message to team / players

Posted: 16 Nov 2014, 17:08
by Silentwings
Not sure - I'm surprised to see that happen - I can only guess that some Spring.XX commands are put into queues which are only actioned later. Or maybe Spring.Echo gets a special hotline to the output because its (meant to be) used for debugging.

Re: Message to team / players

Posted: 16 Nov 2014, 19:14
by coolmann
Okay.

One last question:

Spring.SendCommands (needs ModUICtrl)

( string command1 [, string command2 [ ... ] ] ) -> nil
( {string command1, string command2, ...} ) -> nil

thats from the list, but where to find a list with those commands?
Cant find the say here: http://springrts.com/wiki/Lua_CMDs
Maybe iam totally wrong..

Greetings
and thanks

Re: Message to team / players

Posted: 16 Nov 2014, 19:36
by Silentwings

Re: Message to team / players

Posted: 17 Nov 2014, 05:16
by SirMaverick
coolmann wrote:Just for understanding, i have the following code:
Spring.SendCommands("say a: hello allies")
Spring.Echo ("Echo")
but the first to appear ingame is Echo.
Why?
Echo is executed immetiately. It's like local println/printf.

SendCommand is a (synced) command that is (therefore) first send to the server, then back to the clients and then executed.