Please check out BatMUD !

Member Discussions

terms



[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]


1. Race name in who on a Rom Fri Nov 7, 2003 [7:56 PM]
darkhammy
Email not supplied
member since: Oct 29, 2000
Reply
Okay, I run a Rom. The who listing for a char looks like this:

+[90 Demon Fig] Name, title.

+ being pkset, 90 level, demon race, fighter class, so on and so forth.

Now, Demon is just colored dark Cyan. I wanted to make it so the different races had different colors, like Demon would be darkred, and brightred on the o, then darkred on the n. I tried putting this in const.c, and then when I compile and reboot and type who, all I get is 'Demo' then I tried switching the bright to the m, then I just get 'Dem' I figured maybe I was going over the amount of characters I was allowed to have, so I went into merc.h and upped 'who_name[7]' to 'who_name[8]' and it worked for one letter, so I was like hey, It should work if I up it to 9, so I did, and then when I tried to log in, the mud crashes.

So...anyone know how to get this working? This is a pain in the butt, I dont get why who_name[8] will work and who_name[9] wont. Its a char type of variable, and not an int.


2. RE: Race name in who on a Rom Fri Nov 7, 2003 [11:03 PM]
sarix2
Email not supplied
member since: Mar 3, 2002
In Reply To
Reply
Your problem is with the color code. That space is told to only have so many characters in it. So with the color code you've added it's counting the color code as characters. To solve the problem on our mud we made a string utility that we send it a string, and a size. And it returns it with color and all cropped to that size. Thats how we fixed all our little things like that.
Realms of the Forgotten
www.rotf.net




[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]