Wolf Planet Forum Index Wolf Planet
We want you here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Basic Tutorial] Adding Godmode and Noclip Cheats

 
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance
View previous topic :: View next topic  
Author Message
Deathshead
Corporal


Joined: 18 Feb 2005
Posts: 87

PostPosted: Thu Apr 07, 2005 9:10 am    Post subject: [Basic Tutorial] Adding Godmode and Noclip Cheats Reply with quote

This is two tutorials I wrote up for my first forum, and thought I'd put them here for any n00bs:

------------------------------------------------------------------

Enabling the NoClip Debug cheat

For those who like playing with debug mode, this is how to enable the NoClip function for Wolfenstein.

Open WL_DEBUG.C and do a search for "noclip". You should get this:

Code:

#ifdef SPEAR
   else if (Keyboard[sc_N])         // N = no clip
   {
      noclip^=1;
      CenterWindow (18,3);
      if (noclip)
         US_PrintCentered ("No clipping ON");
      else
         US_PrintCentered ("No clipping OFF");
      VW_UpdateScreen();
      IN_Ack ();
      return 1;
   }
#endif


To enable it, simply delete the "#ifdef SPEAR" and "#endif" statements.

Code:

   else if (Keyboard[sc_N])         // N = no clip
   {
      noclip^=1;
      CenterWindow (18,3);
      if (noclip)
         US_PrintCentered ("No clipping ON");
      else
         US_PrintCentered ("No clipping OFF");
      VW_UpdateScreen();
      IN_Ack ();
      return 1;
   }


How about enabling NoClip as a normal cheat? Simply open WL_PLAY.C and search for "MLI". You should get the following:

Code:

   //
   // SECRET CHEAT CODE: 'MLI'
   //
   if (Keyboard[sc_M] &&
      Keyboard[sc_L] &&
      Keyboard[sc_I])
   {
      gamestate.health = 100;
      gamestate.ammo = 99;
      gamestate.keys = 3;
      gamestate.score = 0;
      gamestate.TimeCount += 42000L;
      GiveWeapon (wp_chaingun);

      DrawWeapon();
      DrawHealth();
      DrawKeys();
      DrawAmmo();
      DrawScore();


Above this cheat, type the following:

Code:

   //
   // SECRET NOCLIP CHEAT
   //
   if (Keyboard[sc_J] &&      //You can customize these
      Keyboard[sc_K] &&   //keys to suit your needs
      Keyboard[sc_L])      //in your code.

   {
      noclip^=1;
      CenterWindow (18,3);
      if (noclip)
         US_PrintCentered ("No clipping ON");   //You may customize this message
      else
         US_PrintCentered ("No clipping OFF");   //You may customize this message
      VW_UpdateScreen();
      IN_Ack ();
      return 1;
   }


When you compile, you may get a warning which reads that such and such can't return a value, but you just ignore that. Now when in the game, pressing the keys JKL will activate NoClip mode, allowing you to go through walls!

~~~~~~~~~~~~~~~~~~~~

Activating the God Mode cheat in Wolfenstein.

In Spear of Destiny, pressing TAB-G-F10 activated GodMode. This cheat was not available in the original, so here's how to activate it.

Open up WL_PLAY.C and search for godmode until you get this:

Code:

#ifdef SPEAR
   //
   // SECRET CHEAT CODE: TAB-G-F10
   //
   if (Keyboard[sc_Tab] &&
      Keyboard[sc_G] &&
      Keyboard[sc_F10])
   {
      WindowH = 160;
      if (godmode)
      {
         Message ("God mode OFF");
         SD_PlaySound (NOBONUSSND);
      }
      else
      {
         Message ("God mode ON");
         SD_PlaySound (ENDBONUS2SND);
      }

      IN_Ack();
      godmode ^= 1;
      DrawAllPlayBorderSides ();
      IN_ClearKeysDown();
      return;
   }
   #endif


"#ifdef SPEAR" means that the cheat is only active in Spear of Destiny. To fix this, simply delete or comment out "#ifdef SPEAR" and "#endif". Now the cheat is accessable in Wolfenstein.

Before you compile, you will have to change the sounds used in this code; namely "NOBONUSSND" and "ENDBONUS2SND" as they are only available in Spear of Destiny. I would change them to "BONUS1SND" and "BONUS2SND". The code would now look like this:

Code:

   //
   // SECRET CHEAT CODE: TAB-G-F10
   //
   if (Keyboard[sc_Tab] &&
      Keyboard[sc_G] &&
      Keyboard[sc_F10])
   {
      WindowH = 160;
      if (godmode)
      {
         Message ("God mode OFF");
         SD_PlaySound (BONUS1SND);
      }
      else
      {
         Message ("God mode ON");
         SD_PlaySound (BONUS2SND);
      }

      IN_Ack();
      godmode ^= 1;
      DrawAllPlayBorderSides ();
      IN_ClearKeysDown();
      return;
   }


Now, the last thing you can do is customize the messages and buttons to activate godmode. In this next example I have changed the code to G-O-D and customized the message to read "You're invincible!". It now looks like this:

Code:

   //
   // SECRET CHEAT CODE: G-O-D   You don't need to change this line
   //
   if (Keyboard[sc_G] &&
      Keyboard[sc_O] &&
      Keyboard[sc_D])
   {
      WindowH = 160;
      if (godmode)
      {
         Message ("You're gonna die!");   //you're custom message
         SD_PlaySound (BONUS1SND);
      }
      else
      {
         Message ("You're Invincible!");   //you're custom message
         SD_PlaySound (BONUS2SND);
      }

      IN_Ack();
      godmode ^= 1;
      DrawAllPlayBorderSides ();
      IN_ClearKeysDown();
      return;
   }


Save, compile, and play. Simple.

--------------------------------------------------------

I hope this helps someone learn more about the code.

There you go
-Deathshead
_________________
Myspace
VampireFreaks
Music4Life
Wolfing Time
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance All times are GMT
Page 1 of 1

Jump to:  

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


Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.