• View unanswered postsView active topics

  • Wolf3d SDL coding tutorials (?)

    Discuss Wolf3D and Wolf3D modding/ports

    Postby Ron 04 Dec 2011, 20:35

    Change the -1 to 0. I think there is one more instance where you need to do that.

    As for the other tutorial, it's for the original source code and not for 4SDL. So there are probably some wrong definitions or something. I don't know enough of the code to know what to change, perhaps Tricob can help.
    Ron
    User avatar
    Team RayCast member
    Team RayCast member
     
    Posts: 6237

        

    Postby WolferCooker 04 Dec 2011, 20:44

    Yeah I still have build error problems in WL_AGENT.C. Same lines. Changing -1 to 0 solved line 38 problem, but the rest of the problems keep cropping up. Yeah that tutorial is useless for SDL.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 04 Dec 2011, 22:46

    I think I'll have to look at the files WL_DRAW, WL_AGENT, and WL_DEF. Is there some place you can upload them?
    Tricob1974
    Team RayCast member
    Team RayCast member
     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby DoomJedi 04 Dec 2011, 23:07

    You can just share a DropBox folder....
    DoomJedi
    User avatar
    Administrator
    Administrator
     
    Posts: 14227
    Location: Israel

        

    Postby WolferCooker 04 Dec 2011, 23:50

    DropBox folder? Tricob, maybe I should email you my entire source folder. There may be more build errors than just WL_AGENT.C.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 05 Dec 2011, 03:15

    WolferCooker - please select the "Clean" command before doing so. This gets rid of "O" files and things like that, which nearly double the size of the zip. Anyway, just E-Mail it to the address below, removing the "gobbledegook." part in the address. Thanks. :)

    kellyarbr@gobbledegook.aol.com
    Tricob1974
    Team RayCast member
    Team RayCast member
     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 05 Dec 2011, 05:29

    Email sent.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 05 Dec 2011, 07:34

    From what I can tell, the problem exists solely in WL_AGENT.CPP. I believe CheckWeaponChange should look like this:
    Code: Select all
    void CheckWeaponChange (void)
    {
        int newWeapon = -1;

        if (!gamestate.ammo)            // must use knife with no ammo
            return;

    #ifdef _arch_dreamcast
        int joyx, joyy;
        IN_GetJoyFineDelta (&joyx, &joyy);
        if(joyx < -64)
            buttonstate[bt_prevweapon] = true;
        else if(joyx > 64)
            buttonstate[bt_nextweapon] = true;
    #endif

        if(buttonstate[bt_nextweapon] && !buttonheld[bt_nextweapon])
        {
            newWeapon = gamestate.weapon + 1;
            if(newWeapon > gamestate.bestweapon) newWeapon = 0;
        }
        else if(buttonstate[bt_prevweapon] && !buttonheld[bt_prevweapon])
        {
            newWeapon = gamestate.weapon - 1;
            if(newWeapon < 0) newWeapon = gamestate.bestweapon;
        }
        else
        {
            for(int i = wp_knife; i <= gamestate.bestweapon; i++)
            {
                if (buttonstate[bt_readyknife + i - wp_knife])
                {
                    newWeapon = i;
                    break;
                }
            }
        }

        if(newWeapon != -1)
        {
            gamestate.weapon = gamestate.chosenweapon = (weapontype) newWeapon;
            DrawWeapon();
        }
    }

    Everything else appears to be correct. Good job. :)
    Tricob1974
    Team RayCast member
    Team RayCast member
     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 05 Dec 2011, 18:16

    Thanks, but there's bad news along with it. I made sure I replaced the flat skeleton with the rifle sprite since I changed the SPR_STAT for the flat skeleton to the rifle and added the firing frames after the chaingun firing frames.

    I can't pick up the rifle (formerly the flat skeleton). I can go through it, but the sprite just stays there. Any idea what else I'm missing?
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Ron 05 Dec 2011, 18:57

    In WL_ACT1 behind {SPR_STAT_9} (I think that's the flat skeleton?) have you added bo_rifle (or whatever you named it) behind it?
    Ron
    User avatar
    Team RayCast member
    Team RayCast member
     
    Posts: 6237

        

    Postby WolferCooker 05 Dec 2011, 19:48

    Yes ronwolf. This is what I wrote:

    Code: Select all
    {SPR_STAT_9,bo_rifle},
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Ron 05 Dec 2011, 20:01

    I just looked at the tutorial, have you replaced bo_spear with bo_rifle? In that case you have to remove the #ifdef SPEAR and #endif surrounding it.
    Ron
    User avatar
    Team RayCast member
    Team RayCast member
     
    Posts: 6237

        

    Postby WolferCooker 05 Dec 2011, 20:08

    I see what I did wrong now! I didn't add a case to the spawn static WL.ACT1! I got it to pick up now!

    Next question. I lose the rifle if I switch back to the original weapons. How do I assign a key for the rifle? I want to the rifle to draw when you hit key 5 after key 4 for the chaingun. Or I'd like to learn how to assign all weapons to different keys kind of like Coming of the Storm with the Chaingun on button 6 and putting the rifle (button 4) and STG44 (button 5) before the MP40 (button 3).

    BTW, I still got plenty of questions regarding weapons so I'm far from done with this.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Ron 05 Dec 2011, 21:19

    Sounds like a problem in the Checkweaponchange function. I could be wrong though, Tricob can probably help you better than me.
    Ron
    User avatar
    Team RayCast member
    Team RayCast member
     
    Posts: 6237

        

    Postby WolferCooker 06 Dec 2011, 00:02

    Sure sounds like it. I retried the modified code for the checkweaponschange, but even that didn't work.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    PreviousNext

    Return to General Wolf3D/modding Discussion and tutorials


    Who is online

    Users browsing this forum: No registered users and 3 guests