Wolf Planet Forum Index Wolf Planet
We want you here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[code] A variation on WSJ's Ingame Messages

 
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance
View previous topic :: View next topic  
Author Message
Deathshead
Corporal


Joined: 18 Feb 2005
Posts: 87

PostPosted: Sat Feb 19, 2005 9:41 am    Post subject: [code] A variation on WSJ's Ingame Messages Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Sat Feb 19, 2005 4:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Deathshead
Corporal


Joined: 18 Feb 2005
Posts: 87

PostPosted: Mon Feb 21, 2005 12:04 am    Post subject: Reply with quote

I hope so, the messages people use (they just use the base) is quite boring.
_________________
Myspace
VampireFreaks
Music4Life
Wolfing Time
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Kyo Kusanagi
Corporal


Joined: 18 Jan 2005
Posts: 95
Location: New Jersey\USA

PostPosted: Mon Feb 21, 2005 8:16 pm    Post subject: Reply with quote

It Works Good I try That on my "Spear of Dreams:Special Edition"
_________________
I'm The DDR King!!!!!!!!!!!!!!!!!! Laughing Laughing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Tue Apr 05, 2005 3:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Flamer46
Newbie


Joined: 16 Feb 2005
Posts: 25
Location: Italy

PostPosted: Tue Apr 05, 2005 5:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance All times are GMT
Page 1 of 1

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.