| View previous topic :: View next topic |
| Author |
Message |
Deathshead Corporal

Joined: 18 Feb 2005 Posts: 87
|
Posted: Sat Feb 19, 2005 9:41 am Post subject: [code] A variation on WSJ's Ingame Messages |
|
|
Playing around with Darkone's NewWolf Classic Source, I found his ingame messages routines. Porting it into original source, it wouldn't work for me. So, I coded WSJ's messages, then put the effects from Darkon'e Messages inside. Here's the result.
What this does, is basically, makes the GetMessage routine Msg_Printf and makes the Message have a cool shadow, like on EOD.
| Code: |
/*
========================
=
= Msg_Printf
=
= gets ingame messages
=
========================
*/
char msg_text[40];
void Msg_Printf (char *lastmessage)
{
messagetime = 150; // time for message to display
strcpy(msg_text, lastmessage);
}
/*
========================
=
= DrawMessage
=
= displays ingame messages
=
========================
*/
void DrawMessage (void)
{
messagetime-=tics;
fontnumber = 0;
// message's shadow
SETFONTCOLOR(0x0,0x1); // set the color
PrintX=7; PrintY=1;
US_Print(msg_text);
// the actual message
SETFONTCOLOR(0x9,0x9); // set the color
PrintX=8; PrintY=2;
US_Print(msg_text);
DrawAllPlayBorderSides ();
}
|
Notice the new variable, 'msg_text[40]'. This has the same effect as 'gamestate.message', but since it is only needed for these two functions, you can put this here, then delete the message variable from the gamestate structure.
Now, when you want a message, you write: Msg_Printf ("Message goes here");
There you go
-Deathshead _________________ Myspace
VampireFreaks
Music4Life
Wolfing Time |
|
| Back to top |
|
 |
Conner94 Moderator

Joined: 15 Jan 2005 Posts: 249 Location: ???
|
Posted: Sat Feb 19, 2005 4:56 pm Post subject: |
|
|
Cool! I'll try this in my other project (Maybe War Storm Later) _________________ My Wolfenstein Website:
http://www.wolf94.cjb.net
Status: Falling apart over a product I ordered that is taking forever to arrive. |
|
| Back to top |
|
 |
Deathshead Corporal

Joined: 18 Feb 2005 Posts: 87
|
|
| Back to top |
|
 |
Kyo Kusanagi Corporal

Joined: 18 Jan 2005 Posts: 95 Location: New Jersey\USA
|
Posted: Mon Feb 21, 2005 8:16 pm Post subject: |
|
|
It Works Good I try That on my "Spear of Dreams:Special Edition" _________________ I'm The DDR King!!!!!!!!!!!!!!!!!!  |
|
| Back to top |
|
 |
Conner94 Moderator

Joined: 15 Jan 2005 Posts: 249 Location: ???
|
Posted: Tue Apr 05, 2005 3:54 pm Post subject: |
|
|
Ok, tried it, loved it! It looked so good from the other junk! Oh, and with some of my own magic, it looks like this when you pick something up:
Hows the little box? I can write a tutorial on it if you guys want, but you can't really center the text. Is there a way to do that? If so I would like it so the longer/shorter pickups look better. _________________ My Wolfenstein Website:
http://www.wolf94.cjb.net
Status: Falling apart over a product I ordered that is taking forever to arrive. |
|
| Back to top |
|
 |
Flamer46 Newbie

Joined: 16 Feb 2005 Posts: 25 Location: Italy
|
Posted: Tue Apr 05, 2005 5:08 pm Post subject: |
|
|
Well nice box Conner. Please write a tutorial on that. To center the text you should try to find out what is the width of the screen then set up something like this: printx = (SCREENWIDTH-MESSAGELENGHT)/2
You could find the MESSAGELENGHT by using that for loop in the code where you display map name on the get psiched thing. As for the Screenwidth i don`t know how your going to find that out. _________________ Join my forum at
[url]wolfingdays.exoboards.com[/url]
and visit my site at
www.wolfer.co.nr |
|
| Back to top |
|
 |
|