Character Creation Color

Posted by Malti on Thu 20 Apr 2006 06:29 PM — 5 posts, 20,592 views.

USA #0
I know there was anothe post for this but I am not sure what they were talking about. Basically, I am curious how to add force ANSI color at the character creation. I have tried the folloing code, but nothing happens at all. Any help is greatly appreciated.

sprintf( buf, "\n\rChoosing a name is one of the most important parts of this game...\n\r"
"Make sure to pick a name appropriate to the character you are going\n\r"
"to role play, and be sure that it suits a medieval theme.\n\r"
"If the name you select is not acceptable, you will be asked to choose\n\r"
"another one.\n\r\n\r ^[[1;36mPlease choose a name for your character: ");
write_to_buffer( d, buf, 0 );
USA #1
Are you using the correct character? And not just inserting the ^ symbol? Vi has the correct way to do it.
USA #2
Perhaps the connection itself disables ASCII codes and strips out ASCII control characters; it's possible though that color characters are only inserted if ASCII codes are enabled. It's worth checking out the send_to_buffer function and seeing if it sends directly.

And Zeno is right, you have to send the escape character (code 33? don't remember) not just ^[ (which is the common way of saying "escape character" in text form).
Canada #3
Unless I'm greatly mistaken, write_to_buffer does not allow color.

Use send_to_desc_color instead; it's included in Samson's color code.
USA #4
I was editing the code in VC++6 and I didnt realize that when i pasted in the exacpe character it had altered it. So I opened up notepad and edited away. So I got all the colors straight. Thanks to everyone, espescially Zero.