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       

[Tutorial] Displaying Number of Kills in the StatusBar
Page 1 of 1
DieHard Wolfers Forum Index -> Code Tutorials 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
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 02 Jun 2018

Topics: 45
Posts: 510
Location: Ohio
usa.gif

PostPosted: Sat Dec 18, 2004 3:55 pm
   Subject: [Tutorial] Displaying Number of Kills in the StatusBar
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

This is very easy to do exactly, the code is already there, you just need to add some code to draw the kills on the status bar.
I will not mess with status coords so x = your coords.

Open up WL_AGENT.C
Locate this line:
::: CODE :::
int   strafeangle[9] = {0,90,180,270,45,135,225,315,0};

Underneath it add:
::: CODE :::
void DrawKills (void);


Add this after the DrawAmmo Function:
::: CODE :::
/*
============
=
= DrawKills
=
============
*/

void DrawKills (void)
{
     LatchNumber(x,x,3,gamestate.killcount);
     // x,x = coordinates to draw it on the statusbar
}


Now search for UpdateFace
When you get to the Funcution's code, add this at the top of the code:
DrawKills();
so it look like this:
::: CODE :::

void   UpdateFace (void)
{
                DrawKills();
   if (SD_SoundPlaying() == GETGATLINGSND)
     return;


Open up WL_STATE.C and search for KillActor
When you get to the function's code, go to the bottom of it and add
DrawKills ();
It should now look like:
::: CODE :::
gamestate.killcount++;
   ob->flags &= ~FL_SHOOTABLE;
   actorat[ob->tilex][ob->tiley] = NULL;
   ob->flags |= FL_NONMARK;
   DrawKills();

Again this code is at the end of the KillActor function.

Compile and Link up, on your status bar you should have the number of kills displayed.
If you have any problems, please post them.

_________________
Steam: http://steamcommunity.com/id/stormx312
Tris
Guest



Last Visit:





PostPosted: Fri Jan 16, 2015 1:26 pm
   Subject: [Tutorial] Displaying Number of Kills in the StatusBar
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

How would I go about when I would like the number of kills displayed on the status bar instead of the "weapons pics"?
Any pointers?
Thanks in advance!
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 20:50 ago.

Topics: 165
Posts: 8276
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Fri Jan 16, 2015 2:05 pm
   Subject: Re: [Tutorial] Displaying Number of Kills in the StatusBar
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The "x,x" part can have whatever coordinates you want. It doesn't use any weapons pics to draw the number of kills. It uses the same fonts as you see for the level, lives, health, and ammo.
Tris
Guest



Last Visit:





PostPosted: Fri Jan 16, 2015 2:22 pm
   Subject: Re: [Tutorial] Displaying Number of Kills in the StatusBar
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hi Tricob!
What I meant was, I'd like the Weapons Pic segment on the statusbar to be replaced by the kill stats counter.
Thanks!
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 20:50 ago.

Topics: 165
Posts: 8276
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Fri Jan 16, 2015 6:12 pm
   Subject: Re: [Tutorial] Displaying Number of Kills in the StatusBar
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Well, it's not that hard. Go to WL_AGENT.CPP. Remove the DrawWeapon routine. Then delete all lines that call that routine. Then change the "x,x" part of the DrawKills routine to use coordinates 32,8.

You'll probably have to fuss around with the DrawKills coordinates for a while before they're finally aligned correctly.
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Tutorials 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 [Code] Blood Splatz Tutorial - Blood Splatters
Author: Dugtrio17
45 14703 Tue Mar 11, 2008 12:02 am
AlumiuN View latest post
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 2962 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Adding a Frames per Second Counter - Darkone
Author: BrotherTank
0 2153 Sat Mar 13, 2004 2:07 pm
BrotherTank View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 2469 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 3314 Sun Oct 26, 2003 1:21 am
Guest 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