Changing color IN msg() (Solved.)

DarkLizerd
05 Feb 2019, 05:40

Like:
msg("This is in black, but " + color(Red) + "this is red.")


Forgewright
05 Feb 2019, 06:21

here is some text with {colour:blue:this} written in blue and {back:red:that} with a red background.


DarkLizerd
06 Feb 2019, 04:52

OK... I enter this:
msg (Spaces (20) + "Ship command center " + Spaces (20) + "Ship Time: " + HH + ":" + MM + ":" + SS + Spaces (20) + " Ship Status: " + {color:blue:SSx})
and Quest changes it to this:
msg (Spaces (20) + "Ship command center " + Spaces (20) + "Ship Time: " + HH + ":" + MM + ":" + SS + Spaces (20) + " Ship Status: " + color:blue:SSx
call function )
The line works as:
msg (Spaces (20) + "Ship command center " + Spaces (20) + "Ship Time: " + HH + ":" + MM + ":" + SS + Spaces (20) + " Ship Status: " + SSx)
But I wanted Red Alert in red...
Option #2 would be to print raw up to Status, change the foreground color, then msg(SSX)
then switch the color back to black.
To put this all on one line.


Forgewright
06 Feb 2019, 05:43

I don't see red alert anywhere but this will do it for the text part anyway.
{colour:red:RedAlert}
so :
msg ("The ship is at {colour:red:RedAlert}.")

This is all I know on how to use it. I know your putting variables together above, but I'm stumped if {colour:red:RedAlert}will work in this conglomeration. If not let us know. DL someone with the goods will chime in. 😎


The Pixie
06 Feb 2019, 08:02

That first line of code should be this (assuming you have set variables HH, MM, SS, color and SSx):

msg (Spaces (20) + "Ship command center " + Spaces (20) + "Ship Time: " + HH + ":" + MM + ":" + SS + Spaces (20) + " Ship Status: {color:" + color + ":" + SSx + "}")

DarkLizerd
06 Feb 2019, 16:24

Yes, all variables are set, SSx is the ship status... Green, Yellow Alert, and Red Alert.
Pixie... Thanks, that fixed it!!!