In my resource bar widget I was adding audiovisual prompts for when someone is fucking up their eco. On the resourcebar metal is colored a light blue, energy yellow and supply green, so I wanted to add colors messages matching this scheme.
I was originally using echos to do it, but the color works only for the first message sent. After that, the messages don't show at all and echos from other widgets will display ÆÆ before the echo.
I also went so far as to use sendmessagetoplayer with the exact same results:
A very simplistic example of what I was doing boils down to this:
Code: Select all
local skyblue = "\255\136\197\226"
if resourcePrompts ~= 0 then
Spring.PlaySoundFile("sounds/ui/useyourmetal.wav", 1)
Spring.SendMessageToPlayer(myPlayerID,skyblue..[[You are excessing metal! Consider using O.R.B.s to build units faster and spend metal more effectively!]])
end