[CODE] Health Shown as a message with full screen view
Select messages from
# through # FAQ
[/[Print]\]

DieHard Wolfers -> SDL Code Crackers

#1: [CODE] Health Shown as a message with full screen view Author: RazielLocation: Israhell PostPosted: Sun Jul 27, 2008 6:03 pm
    —
I think I have found a quick and nice solution for those who usually play with full screen mode and doesn't like to press "TAB" all of the time to check on their health.
First off you need to input the in-game messages feature by WSJ.
Second off you need to input those lines I'll put in this tutorial ;]

in WL_DEF.H look for these lines:

::: CODE :::
void    GetMessage (char *lastmessage);
void    DrawMessage (void);


Underneath those lines put this line:

::: CODE :::
void DrawHltMessage (void);


After that open WL_DRAW.CPP and locate these lines:

::: CODE :::
if (messagetime > 0)
    DrawMessage ();


Underneath those lines add:

::: CODE :::
if(viewsize == 21 && gamestate.weapon != -1)
    DrawHltMessage ();


After that you should go to the end of the WL_DRAW.CPP file and modify this function:

::: CODE :::
/*
========================
=
= 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(gamestate.message);

   SETFONTCOLOR(0x4,0x0); // set the color
   PrintX=8; PrintY=2; // position the message
   US_Print(gamestate.message); // print message
    DrawPlayBorderSides();
}


to look like this:

::: CODE :::
/*
========================
=
= 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(gamestate.message);

   SETFONTCOLOR(0x4,0x0); // set the color
   PrintX=8; PrintY=2; // position the message
   US_Print(gamestate.message); // print message
    DrawPlayBorderSides();
}

void DrawHltMessage (void)
{
   fontnumber = 0;
   SETFONTCOLOR(0x0,0x1);
   PrintX=8; PrintY=14;
   US_Print("Health: ");
   US_PrintUnsigned (gamestate.health);
   SETFONTCOLOR(0x4,0x0);
   PrintX=9; PrintY=15;
   US_Print("Health: ");
   US_PrintUnsigned (gamestate.health);
   DrawPlayBorderSides ();
}


That's it! Very Happy
Now you can play in full screen mode without pressing the "TAB" key anymore!
Hope anyone will ever use it. And if you do please don't forget to Credit WSJ for the in-game messages code.
And yeah I wouldn't mind to get a little credit too... Wink

#2: Re: [CODE] Health Shown as a message with full screen view Author: TricobLocation: Neo-traditions, Inc. PostPosted: Sun Jul 27, 2008 6:20 pm
    —
You might want ammo displayed, too; always useful. Smile

#3: Re: [CODE] Health Shown as a message with full screen view Author: RichterBelmont12Location: New Jersey PostPosted: Sun Jul 27, 2008 6:29 pm
    —
Tricob wrote:
You might want ammo displayed, too; always useful. Smile


ditto.. Smile

#4: Re: [CODE] Health Shown as a message with full screen view Author: RazielLocation: Israhell PostPosted: Sun Jul 27, 2008 6:32 pm
    —
lol I have just input that code XD
I was playing and I saw something was wrong.. the ammo was missing too Razz
it's working on the same function.. just need to duplicate it and change the gamestate.health to gamestate.ammo Smile

[edit]:
One thing though.. if anyone can please answer..
How can I input a picture near to where it says, Health: or Ammo: ??
I would really like to know that! Smile

#5: Re: [CODE] Health Shown as a message with full screen view Author: TricobLocation: Neo-traditions, Inc. PostPosted: Sun Jul 27, 2008 7:37 pm
    —
Raziel wrote:
How can I input a picture near to where it says, Health: or Ammo: ??
I would really like to know that! Smile
Not 100% sure what you're asking here. First off, is the pic from the VGAGRAPH or a sprite from the VSWAP? Second, what position is the Top Left pixel of the pic to be placed in? Just give us the coordinates for 320x200, if you will, and it can be converted from there. Thumbs Up

#6: Re: [CODE] Health Shown as a message with full screen view Author: RazielLocation: Israhell PostPosted: Mon Jul 28, 2008 5:03 am
    —
the pic is from the VGAGRAPH. Hmm.. I don't really know much about coordinates :\
so I can't answer on that >_< I just now that the Score: message that I made to show the scores on the top of the screen is: X axis: 8 and Y axis is: 14
that's all I know.. Hope it helps :/

#7: Re: [CODE] Health Shown as a message with full screen view Author: TricobLocation: Neo-traditions, Inc. PostPosted: Mon Jul 28, 2008 7:26 pm
    —
You'll need your code to be something like this. Change "PG13PIC" to whatever name is the chunk of VGAGRAPH you want to show up, such as HEALTHPIC.

You'll have to tinker with "160" to have it as close to the health and ammo as you'd like.

::: CODE :::
    CA_CacheGrChunk (PG13PIC);
    VWB_DrawPic (160, 0, PG13PIC);
    UNCACHEGRCHUNK (PG13PIC);

#8: Re: [CODE] Health Shown as a message with full screen view Author: Zombie_PlanLocation: A hole in the wall PostPosted: Wed Jul 30, 2008 4:26 am
    —
They did this in Resistant too Smile

#9: Re: [CODE] Health Shown as a message with full screen view Author: RazielLocation: Israhell PostPosted: Wed Jul 30, 2008 5:18 am
    —
Tricob wrote:
You'll need your code to be something like this. Change "PG13PIC" to whatever name is the chunk of VGAGRAPH you want to show up, such as HEALTHPIC.

You'll have to tinker with "160" to have it as close to the health and ammo as you'd like.

::: CODE :::
    CA_CacheGrChunk (PG13PIC);
    VWB_DrawPic (160, 0, PG13PIC);
    UNCACHEGRCHUNK (PG13PIC);


and where exactly I put those lines? |:

#10: Re: [CODE] Health Shown as a message with full screen view Author: TricobLocation: Neo-traditions, Inc. PostPosted: Wed Jul 30, 2008 10:42 pm
    —
Raziel wrote:
and where exactly I put those lines? |:


I'd just place it in DrawHltMessage, right before the command -

::: CODE :::
DrawPlayBorderSides ();

#11: Re: [CODE] Health Shown as a message with full screen view Author: RazielLocation: Israhell PostPosted: Thu Jul 31, 2008 1:14 am
    —
Okay cool it worked. i still need to make the background of the image that I put transparent...
I think I know how to fix that.. But if not I'll just ask Smile

#12: Re: [CODE] Health Shown as a message with full screen view Author: RazielLocation: Israhell PostPosted: Thu Jul 31, 2008 1:41 am
    —
Now there is still one more thing. How do I put BJ's face on the screen? I mean the animated face..
Hope there's an easy way to do this >_<

Ah, and the keys, I was wondering about that for some time now.. It's more urgent than the animated face issue.
Thanks again for all of the help Smile

p.s.
Sorry for the double posting!

#13: Re: [CODE] Health Shown as a message with full screen view Author: TricobLocation: Neo-traditions, Inc. PostPosted: Thu Jul 31, 2008 7:42 pm
    —
Raziel wrote:
Now there is still one more thing. How do I put BJ's face on the screen? I mean the animated face..
Hope there's an easy way to do this >_<

Ah, and the keys, I was wondering about that for some time now.. It's more urgent than the animated face issue.
Uh - there's a catch to that. VGAGRAPH chunks use *no* transparencies whatsoever. Any key or BJ face you have displayed will have a colored border around it, in the shape of a box or rectangle. That's just the way the code's written. Sad

#14: Re: [CODE] Health Shown as a message with full screen view Author: RazielLocation: Israhell PostPosted: Thu Jul 31, 2008 8:07 pm
    —
nvm that. I remembered how to fix it ;]
so I got his face, and the keys displayed pretty well.. Smile
Thanks for the help though! Very Happy I really appreciate the efforts.



DieHard Wolfers -> SDL Code Crackers


output generated using printer-friendly topic mod. All times are GMT

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group