DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

[CODE] Health Shown as a message with full screen view
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Sun Jul 27, 2008 6:03 pm
   Subject: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

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

_________________
Raziel A.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 03 Dec 2019

Topics: 167
Posts: 8475
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Jul 27, 2008 6:20 pm
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You might want ammo displayed, too; always useful. Smile
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 24 Sep 2019

Topics: 98
Posts: 1524
Location: New Jersey
usa.gif

PostPosted: Sun Jul 27, 2008 6:29 pm
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricob wrote:
You might want ammo displayed, too; always useful. Smile


ditto.. Smile

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Sun Jul 27, 2008 6:32 pm
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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

_________________
Raziel A.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 03 Dec 2019

Topics: 167
Posts: 8475
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Jul 27, 2008 7:37 pm
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Mon Jul 28, 2008 5:03 am
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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

_________________
Raziel A.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 03 Dec 2019

Topics: 167
Posts: 8475
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Jul 28, 2008 7:26 pm
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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);
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 3:52 ago.

Topics: 111
Posts: 1757
Location: A hole in the wall
australia.gif

PostPosted: Wed Jul 30, 2008 4:26 am
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

They did this in Resistant too Smile

_________________
WolfSource - Your news source since the beginning of time (2019)
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Wed Jul 30, 2008 5:18 am
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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

_________________
Raziel A.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 03 Dec 2019

Topics: 167
Posts: 8475
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Wed Jul 30, 2008 10:42 pm
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Raziel wrote:
and where exactly I put those lines? |:


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

::: CODE :::
DrawPlayBorderSides ();
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Thu Jul 31, 2008 1:14 am
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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

_________________
Raziel A.
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Thu Jul 31, 2008 1:41 am
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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!

_________________
Raziel A.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 03 Dec 2019

Topics: 167
Posts: 8475
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Thu Jul 31, 2008 7:42 pm
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Thu Jul 31, 2008 8:07 pm
   Subject: Re: [CODE] Health Shown as a message with full screen view
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

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.

_________________
Raziel A.
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Announcement: Wolf3d & Spear of Destiny Shareware SDL Downloads
Author: BrotherTank
10 19688 Tue Aug 24, 2010 10:18 am
dcbasic View latest post
No new posts Sticky: [Tutorial] Compiling Wolf4SDL with Code::Blocks
Author: dcbasic
99 38303 Tue Dec 03, 2019 12:53 pm
Tris View latest post
No new posts [Help] Adding a weapon problem
Author: Zombie_Plan
10 2852 Thu Jul 24, 2008 4:26 pm
RichterBelmont12 View latest post
No new posts [Wolf4SDL Help] Inserting a second palette (like in SoD)
Author: Andy_Nonymous
10 4445 Mon Jun 02, 2008 3:59 pm
Adam Biser View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 4105 Sat May 17, 2008 11:26 am
Mortimer View latest post
 
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


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group