• View unanswered postsView active topics

  • Wolf3d SDL coding tutorials (?)

    Discuss Wolf3D and Wolf3D modding/ports

    Postby WolferCooker 23 Dec 2011, 22: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: 164
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 27 Dec 2011, 05: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

     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 27 Dec 2011, 06: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: 164
    Location: Bethlehem, Pennsylvania

        

    Postby WolferCooker 05 Jan 2012, 04: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: 164
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 05 Jan 2012, 09: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

     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 05 Jan 2012, 10: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: 164
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 06 Jan 2012, 20: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

     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 06 Jan 2012, 23: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: 164
    Location: Bethlehem, Pennsylvania

        

    Postby Tricob1974 07 Jan 2012, 00: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

     
    Posts: 1384
    Location: Huntsville, Alabama

        

    Postby WolferCooker 07 Jan 2012, 01:14

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

     
    Posts: 164
    Location: Bethlehem, Pennsylvania

        

    PreviousNext

    Return to General Wolf3D/modding Discussion and tutorials


    Who is online

    Users browsing this forum: No registered users and 1 guest