MOTD / Centerprint

Discuss programming in the QuakeC language.
Post Reply
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

MOTD / Centerprint

Post by Cobalt »

Wanting to know if this is possible....so far its not working....the last centerprint seems to be overriding the prior centerprints. Idea is to have like a header and footer for the motd, and in the middle are your whatever/help messages - etc.

Code: Select all

void () cprintheader =
{
centerprint (self, "ÔåëÂïô…ÃÔÆ+  ‹<Öåòº.>‹\nBased on CTFBOT+ 0399 by A. Distler\n\nNO BOTS ALLOWED!!\n\n");

};

void () cprintfooter =
{
centerprint3 (self, "\n ËÐœÁÒÒÏאBACK ËÐœÁÒÒÏאNEXT‘ For more help.\n\nServer's Homepages\nhttp://www.blahblah.com");

};


// Called from this code

if (self.motd_time == 0)
		{
		cprintheader ();
		centerprint2 (self, " WELCOME ! Please read all the help pages before you play. \n [F5] Fade in and observe [F6] Bot TV. [1] Join Red team [2] Join Blue team  [SPACE] Automatic team\n");
		cprintfooter ();
                                }


Tried messing with centerptint2 and 3 as you can see, seems to make no difference.
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: MOTD / Centerprint

Post by Dr. Shadowborg »

You need to do it from one centerprint pass. i.e. an example from frikbot:

Code: Select all

void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) frik_big_centerprint = #73;
Then just have your header, footer, and message as separate strings.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: MOTD / Centerprint

Post by Spike »

or use strcat
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: MOTD / Centerprint

Post by Cobalt »

Thanks guys for the sugguestions....I went with the frik cprint with only 3 strings.

Tough thing about copying the ascii quake charset in a text editor like notepad++ is when you use syntax highlighting, it can be a challenge
to not delete an invisible character. I wind up using this alot: http://www.quakebrasil.com.br/oqnm4/index.htm
....but one day I want to make a desktop utility that is more modernized >>

http://forums.inside3d.com/viewtopic.php?t=4271
Dr. Shadowborg wrote:You need to do it from one centerprint pass. i.e. an example from frikbot:

Code: Select all

void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) frik_big_centerprint = #73;
Then just have your header, footer, and message as separate strings.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: MOTD / Centerprint

Post by Spike »

if you're using fteqcc, you can use strings like: "this is white \sthis is red\s and this is white again" to make red text. the \s is not a character, but instead toggles between white and 'special' text. its only useful for printable chars, of course, but should greatly boost readability.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: MOTD / Centerprint

Post by Cobalt »

Im using Frikqcc. The centerprint I tried cannot display the right characters from the quake charset, IE:

ÔåëÂïô…ÃÔÆ+ ‹<Öåòº.>

Paste that in your quake console and it ought to display correctly. I noticed a weird thing with the strcat too a few weeks back when trying to join together 2 strings....it was very very picky about how it was called, else it too would display sometimes numbers, not the strings.....

I am wondering if using the WriteString or WriteByte message functions to accomplish this ?

IE: WriteByte (MSG_ONE, 244);

This would start to print character 244, whatever that is. Is there a numeric value for the special characters and the coloring ?
Spike wrote:if you're using fteqcc, you can use strings like: "this is white \sthis is red\s and this is white again" to make red text. the \s is not a character, but instead toggles between white and 'special' text. its only useful for printable chars, of course, but should greatly boost readability.
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: MOTD / Centerprint

Post by mankrip »

Cobalt wrote:I am wondering if using the WriteString or WriteByte message functions to accomplish this ?

IE: WriteByte (MSG_ONE, 244);

This would start to print character 244, whatever that is. Is there a numeric value for the special characters and the coloring ?
Yes. Each number refers to an entry in the conchars table, starting horizontally from left to right, and them from top to bottom.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: MOTD / Centerprint

Post by Cobalt »

Ok, yep. I remembered I found an old gif that shows all the values and characters. I edited it today to show the CR/FL (enter key) , but there are still some empty spots that I think maybe are for the backspace or other special functions? SPACE is 32, so what are the rest?

12, 13, 34, 140 , 160 = ?

http://postimage.org/image/888leb16j/




mankrip wrote:
Cobalt wrote:I am wondering if using the WriteString or WriteByte message functions to accomplish this ?

IE: WriteByte (MSG_ONE, 244);

This would start to print character 244, whatever that is. Is there a numeric value for the special characters and the coloring ?
Yes. Each number refers to an entry in the conchars table, starting horizontally from left to right, and them from top to bottom.
Post Reply