Forum

MOTD / Centerprint

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

MOTD / Centerprint

Postby Cobalt » Sat Feb 25, 2012 8:22 pm

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.
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Re: MOTD / Centerprint

Postby Dr. Shadowborg » Sat Feb 25, 2012 9:44 pm

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.
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Re: MOTD / Centerprint

Postby Spike » Sun Feb 26, 2012 1:25 am

or use strcat
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: MOTD / Centerprint

Postby Cobalt » Sun Feb 26, 2012 4:54 am

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 >>

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.
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Re: MOTD / Centerprint

Postby Spike » Sun Feb 26, 2012 11:06 am

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.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: MOTD / Centerprint

Postby Cobalt » Sun Feb 26, 2012 2:18 pm

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.
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Re: MOTD / Centerprint

Postby mankrip » Sun Feb 26, 2012 2:54 pm

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
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: MOTD / Centerprint

Postby Cobalt » Mon Feb 27, 2012 12:38 am

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.
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest