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

    Two minor code changes...

    avatar
    WLHack
    Senior Member
    Senior Member


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

    Two minor code changes... Empty Two minor code changes...

    Post by WLHack Mon Mar 26, 2007 6:22 am

    First I pressume how to add new images (VGAGraph) to
    engine... Since that is what you have to do first.

    Well... after you done that, open WL_Agent.C and search for
    "case -1:" (without quotes)...

    Now you should see something like this:
    Code:

    case -1:
              ob->state = &s_player;
              if (!gamestate.ammo)
              {
                    gamestate.weapon = wp_knife;
       DrawWeapon ();
              }
              else

    Change it to this:

    Code:


    case -1:
              ob->state = &s_player;
              if (!gamestate.ammo)
              {
                  StatusDrawPic (17,4,BJMADPIC);  // Change to your liking
                  facecount = 0;gotgatgun=1;

                    gamestate.weapon = wp_knife;
       DrawWeapon ();
              }
              else

    And now every time you strike with the knife or run out
    of ammo, BJ's face will change for a second to another
    expression...

    ---

    Now for the second minor tutorial:

    Open up WL_Main.C and search for the "NewGame"
    (without guotes)...

    Now change it to this:
    Code:

    void NewGame (int difficulty,int episode)
    {
       memset (&gamestate,0,sizeof(gamestate));
       gamestate.difficulty = difficulty;

       gamestate.nextextra = EXTRAPOINTS;
       gamestate.episode=episode;
       startgame = true;

    if(gamestate.difficulty =< gd_medium)
    {
       gamestate.weapon = gamestate.bestweapon
          = gamestate.chosenweapon = wp_pistol;
       gamestate.health = 100;
       gamestate.ammo = STARTAMMO;
       gamestate.lives = 3;
    }
    else
    {
       gamestate.weapon = gamestate.bestweapon
          = gamestate.chosenweapon = wp_machinegun;
       gamestate.health = 75;
       gamestate.ammo = STARTAMMO;
       gamestate.lives = 3;
                    gamestate.mapon=9;
    }

    }

    Now whenever you start game with hardest difficulty setting,
    you only have 75% health and machinegun... Oh, and the
    level is 10.
    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

    Two minor code changes... Empty Re: Two minor code changes...

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

    so this is for adding new graphics?
    i didn't really get it (but i never get anything)



    Wolf3d Haven
    Minute Logic Blog

      Current date/time is Thu Nov 21, 2024 5:38 am