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

    MG42 problem

    Officer-Michael John
    Officer-Michael John
    Seasoned Wolfer
    Seasoned Wolfer


    Male
    Number of posts : 332
    Age : 26
    Hobbie : Video and Wolf 3D mode making
    Registration date : 2014-08-04

    MG42 problem Empty MG42 problem

    Post by Officer-Michael John Thu Nov 05, 2015 8:09 am

    I adding a MG42,but use an ammos (normal ammo,shells). How to fixed not use an ammos? 

    WL_AGENT.CPP:

    Code:
    case -1:
                    ob->state = &s_player;
                    if (!gamestate.ammo && gamestate.weapon == wp_pistol ||
                        !gamestate.ammo && gamestate.weapon == wp_machinegun ||
                        !gamestate.ammo && gamestate.weapon == wp_chaingun ||
                        !gamestate.shells && gamestate.weapon == wp_flakgun ||
                   !gamestate.fuel && gamestate.weapon == wp_flame)
                    {
                        gamestate.weapon = gamestate.chosenweapon = wp_knife;
                        DrawWeapon ();
                    }
                    else
                    {
                        if (gamestate.weapon != wp_mg42_mounted &&
                            gamestate.weapon != gamestate.chosenweapon)
                        {
                            gamestate.weapon = gamestate.chosenweapon;
                            DrawWeapon ();
                        }
                    }
                    gamestate.attackframe = gamestate.weaponframe = 0;
                    return;

                case 4:
             case 6:
                    if (!gamestate.ammo && !gamestate.shells && !gamestate.fuel)
                        break;
                    if (buttonstate[bt_attack])
                        gamestate.attackframe -= 2;
                case 1:
                    if (!gamestate.ammo && gamestate.weapon == wp_pistol ||
                        !gamestate.ammo && gamestate.weapon == wp_machinegun ||
                        !gamestate.ammo && gamestate.weapon == wp_chaingun ||
                        !gamestate.shells && gamestate.weapon == wp_flakgun ||
                   !gamestate.fuel && gamestate.weapon == wp_flame)
                    {      // can only happen with chain gun
                        gamestate.attackframe++;
                        break;
                    }
                    GunAttack (ob);
                    if (gamestate.chosenweapon == wp_pistol)
                    {
                        gamestate.ammo--;
                        DrawAmmo ();
                    }
                    if (gamestate.chosenweapon == wp_machinegun)
                    {
                        gamestate.ammo--;
                        DrawAmmo ();
                    }
                    if (gamestate.chosenweapon == wp_chaingun)
                    {
                        gamestate.ammo--;
                        DrawAmmo ();
                    }
                    if (gamestate.chosenweapon == wp_flakgun)
                    {
                        gamestate.shells--;
                        DrawAmmo ();
                    }
                    break;
                   
                case 2:
                    KnifeAttack (ob);
                    break;

                case 3:     
                    if (gamestate.ammo && buttonstate[bt_attack])
                        gamestate.attackframe -= 2;
                    break;
                
             case 5:     
                    if (buttonstate[bt_attack])
                        gamestate.attackframe -= 4;
                    break;       
                   
                case 7:
                    if (gamestate.shells && buttonstate[bt_attack])
                        gamestate.attackframe -= 2;
                    break; 
    stathmk
    stathmk
    Veteran
    Veteran


    Male
    Number of posts : 1791
    Age : 44
    Location : Indiana, United States
    Job : fast food worker & wolfensteingoodies.com webmaster
    Hobbie : old games & young dames
    Registration date : 2008-04-08

    MG42 problem Empty Fix one coding problem at a time.

    Post by stathmk Thu Nov 05, 2015 7:06 pm

    I don't know the specifics of Wolfenstein 3D coding, but somebody on Diehard Wolfers commented to you to start coding a mod from scratch & fix one problem at a time.  But I'm more interested in learning to edit sprites than to edit code, so I hope I'm not naive.  I'm sorry I don't know how to help you more.  Sad
    Officer-Michael John
    Officer-Michael John
    Seasoned Wolfer
    Seasoned Wolfer


    Male
    Number of posts : 332
    Age : 26
    Hobbie : Video and Wolf 3D mode making
    Registration date : 2014-08-04

    MG42 problem Empty Re: MG42 problem

    Post by Officer-Michael John Fri Nov 06, 2015 9:28 am

    DHW forum? No!!!! I leave permanently from DHW forum. My definitive leave new:http://diehardwolfers.areyep.com/viewtopic.php?t=7310

    Sponsored content


    MG42 problem Empty Re: MG42 problem

    Post by Sponsored content


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