[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Character Creation Color

Character Creation Color

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Malti   USA  (55 posts)  [Biography] bio
Date Thu 20 Apr 2006 06:29 PM (UTC)
Message
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 );
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #1 on Thu 20 Apr 2006 08:56 PM (UTC)
Message
Are you using the correct character? And not just inserting the ^ symbol? Vi has the correct way to do it.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #2 on Thu 20 Apr 2006 10:10 PM (UTC)
Message
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).

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Dace K   Canada  (169 posts)  [Biography] bio
Date Reply #3 on Thu 20 Apr 2006 10:46 PM (UTC)
Message
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.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
[Go to top] top

Posted by Malti   USA  (55 posts)  [Biography] bio
Date Reply #4 on Thu 20 Apr 2006 11:42 PM (UTC)
Message
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.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,817 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]