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


    MG42 problem

    Share

    Officer-Michael John
    Seasoned Wolfer
    Seasoned Wolfer

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

    MG42 problem

    Post by Officer-Michael John on 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
    Hardcore Wolfer
    Hardcore Wolfer

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

    Fix one coding problem at a time.

    Post by stathmk on 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
    Seasoned Wolfer
    Seasoned Wolfer

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

    Re: MG42 problem

    Post by Officer-Michael John on 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

    Re: MG42 problem

    Post by Sponsored content Today at 6:28 pm


      Current date/time is Thu Sep 29, 2016 6:28 pm