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...


    change wep sound

    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

    change wep sound Empty change wep sound

    Post by Dark_wizzie 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 Nov 21, 2024 7:39 am