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

    Defining T_Attack for new weapons (SDL)

    ToMi
    ToMi
    Freshmen
    Freshmen


    Male
    Number of posts : 23
    Age : 16
    Location : Czech Republic
    Registration date : 2021-03-29

    Defining T_Attack for new weapons (SDL) Empty Defining T_Attack for new weapons (SDL)

    Post by ToMi Sun May 09, 2021 10:04 am

    Hello again.

    I'm searching for help if there is some easy way how to define the missile launcher and other new weapons with extra ammo in the T_Attack function in WL_AGENT.C.

    I did added the weapon and its ammo type using these tutorials: New weapon (archive.org) and New ammo (archive.org) by Paal Olstad. (I did not any changed CheckWeaponChange as I did it easier way. I also corrected the GiveWeapon part little bit with help from another member, as the original code was preventing other weapons giving me ammo when picking them up).

    However, in this tutorial, there is no mention about changing T_Attack. I was looking on this thread at DHW, however, I still didn't figured it out.

    Thanks.
    --ToMi
    Nexion
    Nexion
    Seasoned Wolfer
    Seasoned Wolfer


    Number of posts : 275
    Age : 112
    Location : Dimension of Anti-Time
    Hobbie : bringing chaos & madness into universe
    Message : Planet N
    Registration date : 2008-02-27

    Defining T_Attack for new weapons (SDL) Empty Re: Defining T_Attack for new weapons (SDL)

    Post by Nexion Sun May 09, 2021 11:50 am

    It's not mentioned in the tutorial since the missile attack is included in the GunAttack which is used by every gun through T_Attack. I'm not sure if i get your exact problem or if you just want something easier on the eyes. In case you could just do a new case in T_Attack:
    Code:
               case 5:
                    if (gamestate.missile <= 0)
                    {      
                        ob->state = &s_player;
                        gamestate.weapon = wp_knife;
                        DrawWeapon ();
                        gamestate.attackframe = gamestate.weaponframe = 0;
                        break;
                    }

                    MissileAttack (ob);
                    gamestate.missiles--;
                    DrawMissile ();
                    break;
    Nexion
    Nexion
    Seasoned Wolfer
    Seasoned Wolfer


    Number of posts : 275
    Age : 112
    Location : Dimension of Anti-Time
    Hobbie : bringing chaos & madness into universe
    Message : Planet N
    Registration date : 2008-02-27

    Defining T_Attack for new weapons (SDL) Empty Re: Defining T_Attack for new weapons (SDL)

    Post by Nexion Tue May 18, 2021 12:10 pm

    Since it seems to work so flawlessly you might want to include this "case 5" in the actual weapon by placing a 5 in one of the frames, somwhere at the top in wl_agent.c:
    Code:
    { {6,0,1},{6,5,2},{6,0,3},{6,-1,4} },
    So you won't need GunAttack because it's in "case 1".
    {6,5,2}
    The first number (6) is the time, the second number (5) is the T_Attack case and the last number (2) is the frame. If you ask for such type of help try to be precise about your code, steps or possible questions. 4 could be 2+2 or 5-1 or 100/25 or maybe 4 isn't even the problem.
    avatar
    Guest
    Guest


    Defining T_Attack for new weapons (SDL) Empty Re: Defining T_Attack for new weapons (SDL)

    Post by Guest Tue May 18, 2021 3:19 pm

    Looks like ToMi is now getting such expert advice from Tricob on DHW that he forgot about this place.  Really, Really Happy

    Is ToMi short for ToMeanToDie? If so, he might enjoy this thread there too:
    http://dhw.wolfenstein3d.com/viewtopic.php?p=109535#109535
    ToMi
    ToMi
    Freshmen
    Freshmen


    Male
    Number of posts : 23
    Age : 16
    Location : Czech Republic
    Registration date : 2021-03-29

    Defining T_Attack for new weapons (SDL) Empty Re: Defining T_Attack for new weapons (SDL)

    Post by ToMi Wed May 19, 2021 4:45 am

    Nope, "ToMi" stands for Tom (my real name).

    But I see it's quite similar tho. Hope it'll won't cause confusion.

    Sponsored content


    Defining T_Attack for new weapons (SDL) Empty Re: Defining T_Attack for new weapons (SDL)

    Post by Sponsored content


      Current date/time is Sat Apr 27, 2024 7:58 pm