Wolf3d Haven Forum

Please log in or register. Smile
Wolf3d Haven Forum

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


    change wep sound

    Share

    Dark_wizzie
    I am Death Incarnate!
    I am Death Incarnate!

    Male
    Number of posts : 5090
    Age : 22
    Location : USA or Tawain
    Job : Student, Part time Cactuar fanatic
    Hobbie : Planting Cactuars.
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    change wep sound

    Post by Dark_wizzie on Sun Apr 29, 2007 1:16 pm

    From wolf3d dome
    Code Editing Tutorials
    Adding a Weapon Change sound




    Step 1. Open WL_AGENT.C and do a search for "CheckWeaponChange". Rewrite the function as follows:

    void CheckWeaponChange (void)
    {
    int i,buttons;
    if (!gamestate.ammo) // must use knife with no ammo
    return;
    switch (LastScan)
    {
    case 2:
    LastScan=0;
    gamestate.weapon = gamestate.chosenweapon = wp_knife;
    break;
    case 3:
    LastScan=0;
    SD_PlaySound (YOURSOUND); // insert a sound slot you don't need here
    gamestate.weapon = gamestate.chosenweapon = wp_pistol;
    break;
    case 4:
    LastScan=0;
    if (gamestate.bestweapon >= wp_machinegun)
    {
    SD_PlaySound (YOURSOUND); // insert a sound slot you don't need here
    gamestate.weapon = gamestate.chosenweapon = wp_machinegun;
    }
    break;
    case 5:
    LastScan=0;
    if (gamestate.bestweapon >= wp_chaingun)
    {SD_PlaySound (YOURSOUND); // insert a sound slot you don't need here
    gamestate.weapon = gamestate.chosenweapon = wp_chaingun;
    }
    break;
    }
    DrawWeapon();
    }


    If you use more than 4 weapons, add more "case" statements for each extra weapon. That's it. Compile and link it up. Have fun with your weapon change sound!




    Wolf3d Haven
    Minute Logic Blog

      Current date/time is Thu Dec 08, 2016 10:09 am