Wolf3d Haven Forum

Please log in or register. Smile

Join the forum, it's quick and easy

Wolf3d Haven Forum

Please log in or register. Smile

Wolf3d Haven Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


2 posters

    Cheat-system...

    avatar
    WLHack
    Senior Member
    Senior Member


    Male
    Number of posts : 800
    Age : 35
    Location : Finland
    Registration date : 2007-03-26

    Cheat-system... Empty Cheat-system...

    Post by WLHack Mon Mar 26, 2007 5:36 am

    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:

    gamestate.episode=episode;

    [color=red]cheater = false; [/color]
    startgame = true

    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).
    Dark_wizzie
    Dark_wizzie
    I am Death Incarnate!
    I am Death Incarnate!


    Female
    Number of posts : 5120
    Age : 30
    Location : California, USA
    Job : Investor
    Hobbie : Computers, chess, computer chess, fashion, and philosophy
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    Cheat-system... Empty Re: Cheat-system...

    Post by Dark_wizzie Mon Mar 26, 2007 2:56 pm

    i didn't read it yet (i have 5 minutes to reply to ever post) but from the skimming of it i like it
    well all coding scripts look nice...



    Wolf3d Haven
    Minute Logic Blog
    avatar
    Guest
    Guest


    Cheat-system... Empty Re: Cheat-system...

    Post by Guest Mon Mar 26, 2007 8:19 pm

    Can you make a cheat so my ammo doesn't go down when I shoot?
    Dark_wizzie
    Dark_wizzie
    I am Death Incarnate!
    I am Death Incarnate!


    Female
    Number of posts : 5120
    Age : 30
    Location : California, USA
    Job : Investor
    Hobbie : Computers, chess, computer chess, fashion, and philosophy
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    Cheat-system... Empty Re: Cheat-system...

    Post by Dark_wizzie Mon Mar 26, 2007 8:20 pm

    erm i belive wlhack can. or you can ask schabbs but he is not on for now.
    press mli for 100% hp, 99 ammo, 2 keys



    Wolf3d Haven
    Minute Logic Blog
    avatar
    WLHack
    Senior Member
    Senior Member


    Male
    Number of posts : 800
    Age : 35
    Location : Finland
    Registration date : 2007-03-26

    Cheat-system... Empty Re: Cheat-system...

    Post by WLHack Mon Mar 26, 2007 11:32 pm

    Its rather easy:

    In WL_Def.H (at the bottom):

    Code:

    int unlimited;

    Then change the ammunition cheat to this:

    Code:

        if(Keyboard[sc_W]) // ammunition cheat
        {
              GiveWeapon(wp_chaingun);
              gamestate.ammo=99; 
              unlimited = true;

              GetMessage("Weapons and ammo.");
              DrawAmmo();
     
              IN_ClearKeysDown(); 
        }

    Then open WL_Agent.C and search for
    these lines (in T_Attack):

    Code:

    case 1:
      if (!gamestate.ammo)
      {
      // can only happen with chain gun
        gamestate.attackframe++;
        break;
      }
      GunAttack (ob);
      gamestate.ammo--;
      DrawAmmo ();
    break;

    And change it to this:
    Code:

    case 1:
      if (!gamestate.ammo)
      {
      // can only happen with chain gun
        gamestate.attackframe++;
        break;
      }
      GunAttack (ob);
      if(!unlimited)
      {  gamestate.ammo--;  }
      else{}
      DrawAmmo ();
    break;

    Now you just need to add this line:
    Code:

    unlimited = false;

    To NewGame function in WL_Main.C,
    To Died function in WL_Game.C,
    And of course if you want, to the GameLoop
    (also in WL_Game.C).
    Dark_wizzie
    Dark_wizzie
    I am Death Incarnate!
    I am Death Incarnate!


    Female
    Number of posts : 5120
    Age : 30
    Location : California, USA
    Job : Investor
    Hobbie : Computers, chess, computer chess, fashion, and philosophy
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    Cheat-system... Empty Re: Cheat-system...

    Post by Dark_wizzie Tue Mar 27, 2007 3:49 pm

    you are always here with wolf3d coding tips, eh?



    Wolf3d Haven
    Minute Logic Blog
    avatar
    WLHack
    Senior Member
    Senior Member


    Male
    Number of posts : 800
    Age : 35
    Location : Finland
    Registration date : 2007-03-26

    Cheat-system... Empty Re: Cheat-system...

    Post by WLHack Tue Mar 27, 2007 11:15 pm

    Heh... Atleast, trying to...
    I soon release new tutorial.

    Sponsored content


    Cheat-system... Empty Re: Cheat-system...

    Post by Sponsored content


      Current date/time is Thu Nov 21, 2024 6:12 am