Team Aardwolf Forums(wolf3d mods,addons)

A place for Team Aardwolf and anyone else to discuss the Team Aardwolf mods
 
HomePortalFAQSearchRegisterMemberlistUsergroupsLog in

Share | 
 

 [Tutorial] Cheat System

View previous topic View next topic Go down 
AuthorMessage
WLHack



Posts : 15
Join date : 2007-07-26
Age : 28
Location : Loppi - Finland

PostSubject: [Tutorial] Cheat System   Sat Jul 28, 2007 12:06 pm

Well, I decided to post some of my tutorials here...
Okay, this is the first one. In this I teach you how to make new
Cheat-system.

---

I have used WSJ's ingame-message in this tutorial,
they can be found here (just scroll down the page):

http://diehardwolfers.areyep.com/viewtopic.php?t=1795


First open WL_DEF.H and add this somewhere
to the WL_PLAY.C definitions.

Code:

int cheater;

Then open the WL_PLAY.C and go to the "CheckKeys"-function.

Now we shall modify the "M-L-I"-cheat a bit (to make the
cheat-system work but you can make your own letter
combination for the cheats too):

Code:

//
// Activate cheat-system
//
if (Keyboard[sc_M] &&
    Keyboard[sc_L] &&
    Keyboard[sc_I])
{
    GetMessage("Press 'W' for weapons and ammo,\n 'K' for all keys and\n 'H' for full health.");
    cheater = true;

    IN_ClearKeysDown();
}

// Cheats
if (!cheater)
    SD_PlaySound(DONOTHINGSND);
else
{
    if(Keyboard[sc_W]) // ammunition cheat
    {
          GiveWeapon(wp_chaingun);
          gamestate.ammo=99; 

          GetMessage("Weapons and ammo.");
          DrawAmmo();
 
          IN_ClearKeysDown(); 
    }
    if(Keyboard[sc_K]) // cheat for keys
    {
            gamestate.keys = 3; // change the value to 15 for four keys           

            GetMessage("All keys acquired.");
            DrawKeys();
 
            IN_ClearKeysDown();
      }
      if(Keyboard[sc_H]) // cheat for life
      {       
            gamestate.health = 100;
            GiveExtraMan();

            GetMessage("Full recovery.");
             
              IN_ClearKeysDown();
      }
}             

Then we must add this red line to the "NewGame"-function
in the WL_MAIN.C (So the debugmode won't be open
when player starts the game):

Code:


cheater = false;


Remember to add this line to the "Died"-funcion
in the WL_GAME.C too (so the cheats will turn of
if player die) and if you want, to the GameLoop function
(it can be find also in the WL_GAME.C).
Back to top Go down
View user profile http://www.freewebs.com/tsalop
 
[Tutorial] Cheat System
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Great Tank and Weathering tutorial
» Pre-WotLK System Requirements
» Power Sword Tutorial (with more to follow)
» Tau Smart Missile System
» SYSTEM-OF-A-DOWN app

Permissions in this forum:You cannot reply to topics in this forum
Team Aardwolf Forums(wolf3d mods,addons) :: Team Aardwolf discussion :: Coding quides and help-
Jump to: