
|
|
Author |
Message |
KyleRTCW
DieHard Officer

Joined: 30 Jul 2003
Last Visit: 05 Aug 2018
Topics: 45
Posts: 510
Location: Ohio

|
Posted: Sat Dec 18, 2004 3:55 pm
Subject: [Tutorial] Displaying Number of Kills in the StatusBar
[ IP : Logged ]
|

 
|
|
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:
|
Posted: Fri Jan 16, 2015 1:26 pm
Subject: [Tutorial] Displaying Number of Kills in the StatusBar
[ IP : Logged ]
|

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


Joined: 14 Mar 2005
Last Visit: 10:39 ago.
Topics: 165
Posts: 8330
Location: Neo-traditions, Inc.

|
Posted: Fri Jan 16, 2015 2:05 pm
Subject: Re: [Tutorial] Displaying Number of Kills in the StatusBar
[ IP : Logged ]
|

  
|
|
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:
|
Posted: Fri Jan 16, 2015 2:22 pm
Subject: Re: [Tutorial] Displaying Number of Kills in the StatusBar
[ IP : Logged ]
|

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


Joined: 14 Mar 2005
Last Visit: 10:39 ago.
Topics: 165
Posts: 8330
Location: Neo-traditions, Inc.

|
Posted: Fri Jan 16, 2015 6:12 pm
Subject: Re: [Tutorial] Displaying Number of Kills in the StatusBar
[ IP : Logged ]
|

 
|
|
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. |
|
|
 |
|
|
|
|
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
|