Page 1 of 1

Colour Text

PostPosted: 27 Aug 2013, 17:29
by ccenturionnMC
When I've been on servers I've seen people writing in colour. I asked them how to do it and many other people but no one seems to want to tell me how so I've come here in search of something more helpful. So what I would like to know is how to write in colour and what are the codes for basic colours e.g. red, yellow, green, blue, purple and if you feel like it any others.

Thx/ccenturionnMC

Re: Colour Text

PostPosted: 27 Aug 2013, 19:14
by Ulukai
I'm on my phone so it's a bit hard to look it up for you right now, but there is even a small mod for RE available to choose your chat colour with a gui. Search this forum for something like colour chat and you will find it. Zeroknight is the author of the mod. I'm not sure if it is still compatible with RE v1.4. There surely are other forum topics here where you will find the necessary linesfor your RE config as well.

Re: Colour Text

PostPosted: 27 Aug 2013, 19:50
by ccenturionnMC
This helped a lot thank you very much. Also, love your maps.

Re: Colour Text

PostPosted: 27 Aug 2013, 19:59
by Unnamed
You have to use the /say or /sayteam command. Then you have to write ^f and the next character is the colour (r for red, y for yellow,...). For example /say "^fctest".
Insted of a character you can write something like ^f[0xAA80AA] (hexadecimal).
With ^fz (instead of ^f) and two colours you can make text with alternating colour.

Re: Colour Text

PostPosted: 27 Aug 2013, 20:16
by ballist1c
put the bind in your autoexec, so that you dont have to type it every time, that is quite silly :P

Re: Colour Text

PostPosted: 28 Aug 2013, 02:14
by ccenturionnMC
So could someone please tell me how to bind it so I can write in red all the time?

Re: Colour Text

PostPosted: 28 Aug 2013, 03:21
by ballist1c
ccenturionnMC {l Wrote}:So could someone please tell me how to bind it so I can write in red all the time?


ballist1c {l Wrote}:put the bind in your autoexec, so that you dont have to type it every time, that is quite silly :P


...

Re: Colour Text

PostPosted: 28 Aug 2013, 03:27
by qreeves
Someone make a ticket for the ability to set chat colour, I'll put it in for 1.5.

For the location of config files and how to use them, please see our wiki.

Re: Colour Text

PostPosted: 28 Aug 2013, 03:50
by Dratz-_C

Re: Colour Text

PostPosted: 28 Aug 2013, 04:49
by ccenturionnMC
Unnamed {l Wrote}:You have to use the /say or /sayteam command. Then you have to write ^f and the next character is the colour (r for red, y for yellow,...). For example /say "^fctest".
Insted of a character you can write something like ^f[0xAA80AA] (hexadecimal).
With ^fz (instead of ^f) and two colours you can make text with alternating colour.

So what letter would be a dark red and a black?
No idea, but use the hexadecimal values instead as Unnamed mentioned in the 3rd reply to your post.
Find your hexadecimal values here: http://www.w3schools.com/tags/ref_colorpicker.asp

Re: Colour Text

PostPosted: 28 Aug 2013, 08:12
by bonifarz
ccenturionnMC {l Wrote}:So what letter would be a dark red and a black?

http://en.wikipedia.org/wiki/Web_colors#Hex_triplet

E.g. maroon 0x800000 is a dark red, but I would NOT use a dark color for chat that gives poor contrast and will be hard to read.

I agree that this question is asked quite frequently by new players.
Some like to have the same color for chat as for the profile:
{l Code}: {l Select All Code}
bind "RETURN" [saycommand "^f["(getcolour -1)"]"]

So i guess a button to grab the profile color could be added to the ticket.

Re: Colour Text

PostPosted: 29 Aug 2013, 04:16
by Dratz-_C
Bonifarz,
I added your example along with a comment that ZeroKnights "Chat Colours GUI" might also be useful to take a look at, even if guinoautotab doesn't work anymore.
Cheers

Re: Colour Text

PostPosted: 29 Aug 2013, 04:55
by ZeroKnight
I haven't touched up my personal stuff in quite a while, as the only creation-related things I've been doing are going to development toward RE itself. I'll touch up and add a thing or two to my chat color GUI, and see if quin wouldn't mind adding it to the profile section for official inclusion. I'll go through and attempt to improve/optimize it a bit as well (better structure of gui code itself, and better use of vars for remembering color (perhaps keep everything in a single list, and each index will be a color setting)).

qreeves {l Wrote}:Someone make a ticket for the ability to set chat colour, I'll put it in for 1.5.

For the location of config files and how to use them, please see our wiki.

If you're up for it, and since I already have such a menu created, I can optimize and clean it up if you'd like me to slap it in the profile section. Plus, I know how much you detest making GUIs, and I somewhat enjoy doing it.

Dratz-_C {l Wrote}:I added your example along with a comment that ZeroKnights "Chat Colours GUI" might also be useful to take a look at, even if guinoautotab doesn't work anymore.

Yes, guinoautotab was deprecated (its effect is inferred and permanent now) sometime before 1.4, as it is pretty useless for RE's menus. Assuming I'm not overlooking any other var changes/misc things, simply removing the surrounding guinoautotab block(s) will make the script work.

Re: Colour Text

PostPosted: 29 Aug 2013, 06:27
by Dratz-_C
Indeed it does work, with some other warnings. I am happy you are willing to help, ZeroKnight! We'll see what Quin says.
Cheers

Re: Colour Text

PostPosted: 02 Sep 2013, 21:31
by cg505
I'm using svn, and I've noticed that my own chats are the color of my weapon. It seems like this is a very recent change, but I don't think I've set any variables. To me, it's a little over the top to have colors flying everywhere, so I'm wondering why this happens and is there a setting to turn it off, and if not, why/where is the code that I can comment out.

Sorry for the badly worded sentence.

Re: Colour Text

PostPosted: 02 Sep 2013, 22:20
by TheLastProject
cg505 {l Wrote}:I'm using svn, and I've noticed that my own chats are the color of my weapon. It seems like this is a very recent change, but I don't think I've set any variables. To me, it's a little over the top to have colors flying everywhere, so I'm wondering why this happens and is there a setting to turn it off, and if not, why/where is the code that I can comment out.

Sorry for the badly worded sentence.

The code for it isn't done yet, so it's not doing quite what it should be. I'd recommend to just have some patience.

Re: Colour Text

PostPosted: 03 Sep 2013, 03:47
by qreeves
Ah yes, should be off by default. Sorry.

Re: Colour Text

PostPosted: 17 Sep 2013, 17:27
by bonifarz
Recently i was asked how to use cubescript to render chat messages with colorgradients.
Not really useful for anything, but a somewhat funny waste of time to implement.
Some people use a script based on the color formats ^f1 ^f2 etc., but I have not seen that one yet.

Question: Is there a simple way to concatenate all arguments of an alias?
Using quotation marks for chat is just as annoying as the colors are useless :lol:

EDIT: I have found a method that is the opposite of elegant, but seems to work.
However, i just realize that the characters limit for chat lines is the real problem here:
hues.jpeg
hues.jpeg (19.94 KiB) Viewed 10428 times

But maybe the code snippets will be useful for some gui elements, e.g. for picking a saturated color based on its hue.

{l Code}: {l Select All Code}
// hue color scripts by bonifarz

colorstep = 8 // the larger the step size, the smaller the palette of hues in use
ccount = 0 // just a counter

colorfromhue = [  // color by hue = $arg1*60° + $arg2/255*60°
    hi = $arg2
    hd = (- 255 $hi)
    case $arg1 0 [ // red to yellow
        result (+ 0xff0000 (* $hi 0x000100))
    ] 1 [  // yellow to green
        result (+ 0x00ff00 (* $hd 0x010000))
    ] 2 [ // green to cyan
        result (+ 0x00ff00 (* $hi 0x000001))
    ] 3 [ // cyan to blue
        result (+ 0x0000ff (* $hd 0x000100))
    ] 4 [ // blue to magenta
        result (+ 0x0000ff (* $hi 0x010000))
    ] 5 [ // magenta to red
        result (+ 0xff0000 (* $hd 0x000001))
    ]
]

newgui rainbowchatinfo [
    guitext "Usage: /rainbowchat message"
    guitext "Note: Only ~150/12 chars per line."
    guitext "Author: Bonifarz."
    guilist [
        guitext "Test the color stepsize: "
        guifield colorstep 2
    ]
    loop h6 5 [
        guilist [
            loop i (div 255 $colorstep) [
                h256 = (* $i $colorstep)
               
                guitext (concatword "^f[" (colorfromhue $h6 $h256) "]*")
            ]
        ]
    ]
]

rainbowchat = [
    msg = ""
    argi = "arg1"
    loopwhile i 25 [ (strlen $$argi) ] [
        argi = (concatword "arg" (+ 1 $i) )
        msg = (concat $msg $$argi)
    ]
    echo "DEBUG: msg is"
    echo $msg
    saycommand (loopconcatword i (strlen $msg) [
       ccount = (+ $colorstep $ccount)
       h256 = (mod  $ccount 256)
       h6 = (mod (div $ccount 256) 6)
       result (concatword "^f[" (colorfromhue $h6 $h256) "]" (substr $msg $i 1) )
    ] )
]

setcomplete "rainbowchat" 1
showgui rainbowchatinfo