Sending Console Message
Moderator: Moderators
Sending Console Message
Hello!
Would like to ask if it is possible to send what I type in to the console to my oponent screen?
But only display when I want it to? Or totally do not display?
Thanks!
Would like to ask if it is possible to send what I type in to the console to my oponent screen?
But only display when I want it to? Or totally do not display?
Thanks!
Re: Sending Console Message
press enter to send the message?Would like to ask if it is possible to send what I type in to the console to my oponent screen?
dont really understand the question here

Re: Sending Console Message
Spring.Echo("message") > this display message on everyone in the game console?
Or it only display on the player console?
For example, I have this message > "test"
But would want test to only show up on the opponent screen when I want to, will it be possible?
Or it only display on the player console?
For example, I have this message > "test"
But would want test to only show up on the opponent screen when I want to, will it be possible?
Re: Sending Console Message
http://springrts.com/wiki/LuaCallinReturn
AddConsoleLine() --> "msg, priority"
i.e. write a widget:AddConsoleLine(msg, priority)
Chat-Messages are a string in the form:
<NAME> MESSAGE
So you have the playername, check if it's from an enemy and start action. The highest detailed answer for the question possible.
AddConsoleLine() --> "msg, priority"
i.e. write a widget:AddConsoleLine(msg, priority)
Chat-Messages are a string in the form:
<NAME> MESSAGE
So you have the playername, check if it's from an enemy and start action. The highest detailed answer for the question possible.
Re: Sending Console Message
echo in a gadget: shows only the message, no player name. visible to all.
echo in a widget: just visble to the player running the widget. at least i think because otherwise i wonder why nobody complaint on the occaisions where i accidently spammed the chat with widgets going mad
To send chat a chatmessage from widget use Spring.SendCommands("say blabla")
Spring.SendCommands("say a: blabla") for teamchat.
echo in a widget: just visble to the player running the widget. at least i think because otherwise i wonder why nobody complaint on the occaisions where i accidently spammed the chat with widgets going mad

To send chat a chatmessage from widget use Spring.SendCommands("say blabla")
Spring.SendCommands("say a: blabla") for teamchat.
Re: Sending Console Message
Hmm..i tried Spring.SendCommands("say blabla") and Spring.SendCommands("say a: blabla") but the message is still display in the console/chat.
For example, the players type the following:
Player A: Alpha
Player B: Bravo
Can we send the message player B has 'Bravo' to player A side without displaying it in the chat?
I need player A to have player B message in the console(such that it will be log in the infolog.txt but not show in the chat).
For example, the players type the following:
Player A: Alpha
Player B: Bravo
Can we send the message player B has 'Bravo' to player A side without displaying it in the chat?
I need player A to have player B message in the console(such that it will be log in the infolog.txt but not show in the chat).
Re: Sending Console Message
the text entered in chat is always visible to all players unless you hide the console completly with /console 0
Maybe you want
http://springrts.com/wiki/Lua_UnsyncedC ... LuaMessage
+
http://answers.springlobby.info/questio ... e-from-lua

Maybe you want
http://springrts.com/wiki/Lua_UnsyncedC ... LuaMessage
+
http://answers.springlobby.info/questio ... e-from-lua

- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: Sending Console Message
/w playername message
is supposed to whisper a message to a player, except in current version it seems broken, as in no message is recieved :/
is supposed to whisper a message to a player, except in current version it seems broken, as in no message is recieved :/
Re: Sending Console Message
Thanks for all the help!
The above is able to send message and the opponent will be able to see.
However, I want to sent a message while the opponent do not see it. In the end, I use "/n" (insert new line) to clear the console before the opponent could see.
The above is able to send message and the opponent will be able to see.
However, I want to sent a message while the opponent do not see it. In the end, I use "/n" (insert new line) to clear the console before the opponent could see.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Sending Console Message
This doesn't work. The opponent may be using a lua console which does not display the extra newlines or allows the user to scroll up and look at the message. If you entirely disable lua the opponent could still read the message by opening and reloading their infolog as Spring writes to it.However, I want to sent a message while the opponent do not see it. In the end, I use "/n" (insert new line) to clear the console before the opponent could see.
Re: Sending Console Message
yup. in my case I want to send the message player A has to player B computer (infolog and also a txt file that I ask a widget to write that message). but doesn't want the player to be able to see in the console =D
Re: Sending Console Message
widgets/gadgets can talk to each other through other ways then the chat console.
"Very important! (allows synced inter-lua-enviroment communications)"
Re: Sending Console Message
Thanks knorke!
Understand the concept of the communication between widget and gadget.
Say we have lots of messages going in between the widget and gadget.
How do we check the contains of the message to what we want before we do the action? string.gmatch(message, keyword)?
Thanks!
Understand the concept of the communication between widget and gadget.
Say we have lots of messages going in between the widget and gadget.
How do we check the contains of the message to what we want before we do the action? string.gmatch(message, keyword)?
Thanks!
Re: Sending Console Message
in spring tanks i do it like this:
(in ST there are two kind of messages the gadget can send to the widget:
1) "game event messages" like "the game has started!" etc
2) "score table messages" which is the current score of all players packed into a string)
I prefix messages with stuff so the widget can tell them apart:
the gadget then does stuff like
and on widget side:
For widget->gadget talk I would do it the same way, I think.
Just with SendLuaRulesMsg instead of SendLuaUIMsg.
(in ST there are two kind of messages the gadget can send to the widget:
1) "game event messages" like "the game has started!" etc
2) "score table messages" which is the current score of all players packed into a string)
I prefix messages with stuff so the widget can tell them apart:
Code: Select all
luamsgpre = "tpMSGBOX"
luascoremsgpre ="tpSCORE"
Code: Select all
Spring.SendLuaUIMsg (luamsgpre .. "The game has ended!")
Spring.SendLuaUIMsg (luamsgpre .. "<TEAM" .. flagteam .. "> returned his flag")
...
Spring.SendLuaUIMsg (luascoremsgpre .. score_string())
Code: Select all
function widget:RecvLuaMsg(msg, playerID)
luamsgpre = "tpMSGBOX"
luascoremsgpre ="tpSCORE"
if (msg:find(luamsgpre,1,true)) then
--display the message in the UI
end
if (msg:find(luascoremsgpre,1,true)) then
--take the string apart and update the score display
end
end
Just with SendLuaRulesMsg instead of SendLuaUIMsg.
Re: Sending Console Message
Using this we could send information to another player without displaying in the console?