(Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Go down

(Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Post by Officer-M. John (Admin) on Thu Dec 01, 2016 12:25 pm

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

Writte by Deathshead on Sat Feb 19, 2005 9:41 am
avatar
Officer-M. John (Admin)
Admin

Posts : 399
Join date : 2015-10-02
Age : 21

View user profile http://wolf3dfanboys.forumotion.com

Back to top Go down

Re: (Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Post by Officer-M. John (Admin) on Sat Feb 24, 2018 12:11 pm

I tested on 4GW and it didn't show the Messages. With this you can fix the problem. I used of WSJ's In-Game Messages:

WL_DEF.H (WL_DRAW DEFINITIONS):

You add these typedef struct above:

Code:

void  Msg_Printf (char *lastmessage);
void  DrawMessage (void);   

WL_DRAW.CPP:

You search these:

Code:

int        fps_frames=0, fps_time=0, fps=0;

And you add under:

Code:

int    messagetime=0;

Finally these you place DrawScaleds(); and DrawPlayerWeapon(); under:

Code:

        if (messagetime > 0)
          DrawMessage (); 

These solve the problems. Surprised
avatar
Officer-M. John (Admin)
Admin

Posts : 399
Join date : 2015-10-02
Age : 21

View user profile http://wolf3dfanboys.forumotion.com

Back to top Go down

Re: (Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Post by Ferir987 on Mon Feb 26, 2018 10:08 pm

So many mods and codes...
for what end?
avatar
Ferir987
Wolf 3D fan boys member
Wolf 3D fan boys member

Posts : 254
Join date : 2016-04-15
Age : 22
Location : Hungary, Budapest

View user profile https://jhoni196.blogspot.hu/

Back to top Go down

Re: (Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Post by Officer-M. John (Admin) on Wed Feb 28, 2018 5:05 pm

Because I like creatings and add many function on mods.
avatar
Officer-M. John (Admin)
Admin

Posts : 399
Join date : 2015-10-02
Age : 21

View user profile http://wolf3dfanboys.forumotion.com

Back to top Go down

Re: (Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Post by Ferir987 on Sat Mar 03, 2018 8:47 pm

Thats right...
But why do you have to... never mind...
avatar
Ferir987
Wolf 3D fan boys member
Wolf 3D fan boys member

Posts : 254
Join date : 2016-04-15
Age : 22
Location : Hungary, Budapest

View user profile https://jhoni196.blogspot.hu/

Back to top Go down

Re: (Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Post by Officer-M. John (Admin) on Sun Mar 04, 2018 4:31 pm

I once said to you.
avatar
Officer-M. John (Admin)
Admin

Posts : 399
Join date : 2015-10-02
Age : 21

View user profile http://wolf3dfanboys.forumotion.com

Back to top Go down

Re: (Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Post by Ferir987 on Thu Mar 08, 2018 4:56 pm

Officer-M. John (Admin) wrote:I once said to you.

Yes yes i know... silent
avatar
Ferir987
Wolf 3D fan boys member
Wolf 3D fan boys member

Posts : 254
Join date : 2016-04-15
Age : 22
Location : Hungary, Budapest

View user profile https://jhoni196.blogspot.hu/

Back to top Go down

Re: (Old code tutorial) A variation on WSJ's Ingame Messages from Wolf Planet forum

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum