MCS' Coding Tips
                 "Success!"



  
Displaying current ratios while in a game

   Written by MCS
   Tested by Quinnsey


   
Main Page

News

Wolfenstein 3D
Texture Library


MCS' Coding
Tips - "Success"!


Utilities

Spear
Resurrection


Wolfendoom

Wolf
Collection


Original Wolf 3D

Doom/Duke
maps


Other Stuff

Links

Questions?
Email us!
In Blake Stone, you can view your current statistics while in a game by pressing the Tab key.
By making the following modifications, you will add this function as an extra cheat to your addon. It also might come in handy for testing purposes.

Open
WL_DEBUG.C and do a search for:

void DebugMemory (void)
{
int i;
char    scratch[80],str[10];
long mem;
spritetype _seg *block;

CenterWindow (16,7);

US_CPrint ("Memory Usage");
US_CPrint ("------------");
US_Print ("Total     :");
US_PrintUnsigned (mminfo.mainmem/1024);
US_Print ("k\nFree      :");
US_PrintUnsigned (MM_UnusedMemory()/1024);
US_Print ("k\nWith purge:");
US_PrintUnsigned (MM_TotalFree()/1024);
US_Print ("k\n");
VW_UpdateScreen();
IN_Ack ();
}


Right after this block, add the following:

void GetCurrentRatio (void)
{
CenterWindow (18,7);

US_CPrint ("Current Ratio");
US_CPrint ("-------------");
US_Print ("\Kills       :  ");
US_PrintUnsigned (gamestate.killcount);
US_Print (" of ");
US_PrintUnsigned (gamestate.killtotal);
US_Print ("\nSecret    :  ");
US_PrintUnsigned (gamestate.secretcount);
US_Print (" of ");
US_PrintUnsigned (gamestate.secrettotal);
US_Print ("\nTreasure :  ");
US_PrintUnsigned (gamestate.treasurecount);
US_Print (" of ");
US_PrintUnsigned (gamestate.treasuretotal);
US_Print ("\n");
VW_UpdateScreen();
IN_Ack ();
}


Next, do a search for:

if (Keyboard[sc_C])  // C = count objects
{
  CountObjects();
  return 1;
}


after this, add the following:

if (Keyboard[sc_D])  // D = display current ratio
{
  GetCurrentRatio();
  return 1;
}

That's all. Compile and link up.
When you're in a game, press TAB and D simultaneously. A window will be displayed that looks like this:




                                                




Success!
MCS