• View unanswered postsView active topics

  • Wolf3d SDL coding tutorials (?)

    Discuss Wolf3D and Wolf3D modding/ports

    Postby WolferCooker 23 Dec 2011, 21:10

    I started over again, this time with the SPEAR source code because I want to get back to basics. Lets say I want to add a toilet as a new static object. What are the steps to adding just a new static object?

    I need to get the adding a static/bonus object down so I can work on the separate ammo code later.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 27 Dec 2011, 04:26

    My apologies for the delayed response. I haven't been in the apartment for a few days, so I haven't gotten much done here. I'll try to get your question answered tomorrow; today's been kind of messy. :%)
    Tricob1974
    Team RayCast member
    Team RayCast member
     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 27 Dec 2011, 05:36

    Don't worry about it. It's just practice. I intend on getting serious with making a mod once your Base of Operations source code is released.

    I still need some more practice to get my confidence up.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby WolferCooker 05 Jan 2012, 03:17

    Okay I'm gonna start coding again. I have 3 new questions for you Tricob:

    1. Your in-game messages feature works differently than WSJ's with the GetMessage routine I see. I see in that routine you put in STR_SOMETHING. How does this work? Can you assist me on how your version works and how to properly add new messages?

    2. I want to make ammo separate. I'm looking at the DHW tutorial for it and it tells you to first define the separate ammo in the version.h. I could do that, but your custom.h, advanced.h files seem to be extensions of version.h. From your source code, which file is the best to define new items and features?

    3. Before I make the ammo separate, I have to add a new ammo clip and I want to define it in your BONUSFEATURES section where you have added your own new objects instead of with the original objects. Unfortunately I'm getting these
    problems.

    Image

    I admit I've gotten rusty with this already.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 05 Jan 2012, 08:13

    WolferCooker wrote:Okay I'm gonna start coding again. I have 3 new questions for you Tricob:

    1. Your in-game messages feature works differently than WSJ's with the GetMessage routine I see. I see in that routine you put in STR_SOMETHING. How does this work? Can you assist me on how your version works and how to properly add new messages?

    Let's say you want to change the message for picking up Key #1. In "_messages.h", change this line:
    Code: Select all
    #define STR_GOTKEY1                 "Got the yellow key."


    ... and change the message in quotes.
    Code: Select all
    #define STR_GOTKEY1                 "Key #1 retrieved."


    2. I want to make ammo separate. I'm looking at the DHW tutorial for it and it tells you to first define the separate ammo in the version.h. I could do that, but your custom.h, advanced.h files seem to be extensions of version.h. From your source code, which file is the best to define new items and features?
    For now, just put them in "(custom).h".

    3. Before I make the ammo separate, I have to add a new ammo clip and I want to define it in your BONUSFEATURES section where you have added your own new objects instead of with the original objects. ...

    I admit I've gotten rusty with this already.
    No, you just need to set the H files to run the MyMod4SDL files. :) I can send the modified files into DropBox, but I have an updated, "official" version of MyMod4SDL to send to Brian first, now that I'm done fine-tuning it. :)
    Tricob1974
    Team RayCast member
    Team RayCast member
     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 05 Jan 2012, 09:33

    Not sure how you set the H files, but hopefully all that can take a load of stress off my back. I'll try again with your official version.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 06 Jan 2012, 19:03

    The H files you need are here. Just Copy and Paste them where the source code files are, then Rebuild your project. Just tell Windows it's okay to overwrite the old files. :)
    Tricob1974
    Team RayCast member
    Team RayCast member
     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 06 Jan 2012, 22:31

    Thanks Tricob. My EXE wouldn't even function without those modified files.

    Now this is weird. I've added the new ammo clip as it is recognized in Chaosedit and in the game, but I can't get it to pick up. You would think I would solve that problem again by defining the new ammo clip (bo_chaingunclip) in the Spawn Static section of WL.ACT1 as it worked with my rifle problem months ago (warm-up) when I just started coding. Problem is, I think I did everything in WL.AGENT, WL.ACT1, etc. and made sure I didn't make any spelling errors. I even tried making the clip a static object and a non-static object (removing the STAT in SPR_STAT).

    What am I doing wrong now that I managed to solve it myself before?
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 06 Jan 2012, 23:16

    Well, let's take things one step at a time. :)

    First, let's say that the object you're trying to change is SPR_TRUCKREAR. First, go into _ACT1STATICOBJ.H, and change line:
    Code: Select all
        {SPR_TRUCKREAR,block},                 //  SOD truck rear

    to this:
    Code: Select all
        {SPR_TRUCKREAR,bo_chaingunclip},                 //  SOD truck rear

    Second, I now realize I missed something in the code. Until it's fixed, go into WL_DEF.H, and do a search for "bo_clip". You should see this:
    Code: Select all
        bo_clip,

    Insert this line just below it:
    Code: Select all
        bo_chaingunclip,

    Now go into WL_ACT1.CPP, and do a search for "bo_clip" again. You should see this:
    Code: Select all
            case    bo_clip:

    Insert this line of code just below it:
    Code: Select all
            case    bo_chaingunclip:

    Now rebuild your code. I believe that's all you have to do, hopefully. :)
    Tricob1974
    Team RayCast member
    Team RayCast member
     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 07 Jan 2012, 00:14

    Okay that works! :D But my problems are from adding a NEW object and not replacing one.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby WolferCooker 07 Jan 2012, 03:17

    Okay I'm looking at BrotherTank's "Working with Weapons" tutorial. Apparently I must add in his base code with the weapons (first post with tutorial) before I can make my way to the separate ammo feature.

    I did all the steps he said correctly, and now I have these problems that conversions from int to weapontype are invalid.

    Image

    Then again, his thread is 8 years old, so I would have to assume that this tutorial is for the DOS version.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 08 Jan 2012, 00:30

    The CheckWeaponChange code was re-written in Wolf4SDL somewhere between v1.2 and v1.7. I'm actually not surprised the Working With Weapons tutorial doesn't work. :)

    Anyway, I need to update the code to patch the bugs you pointed out about two days ago, and post a tutorial on implementing them for those who are already using the old code at this point in time. After that, I'll post how to add additional Static Object types in the code.

    After that, then I can help with the weapons code. :)
    Tricob1974
    Team RayCast member
    Team RayCast member
     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 08 Jan 2012, 01:09

    Good idea. I'm sure others would be asking the same things I am with your code.

    Yeah a lot of code for features should be updated from DOS versions because I can assure you there will be more problems like this in the future.
    WolferCooker
    User avatar

     
    Posts: 168
    Location: Bethlehem, Pennsylvania

        

    Postby Officer-Michael John 10 Apr 2016, 14:01

    Hey WolferCooker! I writte an one own new ammo tutorial.

    New ammo tutorial:http://wolf3dfanboys.usersboard.com/t35-tutorial-adding-new-ammo-my-version
    Officer-Michael John
    User avatar

     
    Posts: 185
    Location: Hungary

        

    Previous

    Return to General Wolf3D/modding Discussion and tutorials


    Who is online

    Users browsing this forum: No registered users and 2 guests

    cron