MCS' Coding Tips
                 "Success!"



  
Customized exit and error messages

   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!
When you exit the game,the ID software "do not distribute" screen appears.
Also, if the game bombs to DOS, the error screen with the infamous message "Call Apogee etc." is displayed.
If you want your own exit and error messages instead of the ID ones, you have to modify the Quit function.

Open WL_MAIN.C, locate the Quit function and modify as follows:

void Quit (char *error)
{
unsigned        finscreen;
memptr screen;

ClearMemory ();
if (!*error)
{
WriteConfig ();
SD_MusicOff();
_AX = 3;
geninterrupt(0x10);
}
else
{
//  CA_CacheGrChunk (ERRORSCREEN);
//  screen = grsegs[ERRORSCREEN];

}

ShutdownId ();

if (error && *error)
{
//   movedata ((unsigned)screen,7,0xb800,0,7*160);
printf(" My Addon Error!\n");
printf(" The error message is:\n");

printf(" \n");

   gotoxy (2,4);
   puts(error);
   printf(" \n");
   gotoxy (1,8);
   exit(1);
}
else
if (!error || !(*error))
{
  clrscr();
 
printf("-= (C)2002 MyAddon\n");
  printf("  Thanks for playing!\n");

  printf(" \n");
}

exit(0);
}


Modify the text between quotes in the yellow lines to your likings. Remember, the \n stands for carriage return and line feed, and has to stay intact.
Compile and link up. The engine should display your customized error and exit messages.


Success!
MCS