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


Search found 4 matches for define

Zombie_Plan

Wolf4SDL + WASD - Tue Mar 17, 2020 9:06 am

Hello all!

I come to you today with my barebones knowledge with something small and hacky but hopefully interesting to some; customizable strafe controls in core-Wolf4SDL. The idea is to bring another optional extra feature to the code that will hopefully open mods/Wolf4SDL in general to more people, particularly an audience that might prefer familiar control schemes.

Topics tagged under define on Wolf3d Haven Forum Wasd1 Topics tagged under define on Wolf3d Haven Forum Wasd2

Instead of having options for the joystick, I've set it up to have options to rebind the strafe left and right buttons, as well as the next and previous weapon buttons (Though those could be changed to something else, I just didn't want to waste space).

You can also specifically disable mouse movement in the menu, so that it only controls turning.

In the code itself, everything is behind a #define, so that if you want to keep the classic Joystick/Keyboard controls, that is an option.

Notes:

My code isn't 100% efficient and there is a lot I am not totally happy with, because I know it can be better but I personally lack the skillset. I'll be uploading the source shortly for people to mess with. I'll be posting further with one of the things I'm most unhappy with, but I welcome anyone to look at the code and come up with better solutions.

It would be much better if a more dynamic/better menu system were developed, but this tries to work within those current constraints.

I'd also be interested in how this changes level design for those that design around that control scheme, but that's more of a conceptual idea than anything else.

Download

For those interested in at least testing my changes, here's the [url=http://wolf3d.net/files/wolf4sdlwasd.zip]executable files (For use with the WL6 files of Wolf3D) [/url].

Edit: temporarily pulled because crashing issues.

Edit2: Reuploaded with fixes

[solved]Wolf4SDL - Add more than 8 doors - Mon Feb 11, 2019 9:51 am

Hi!

In WL_GAME.CPP I add some new doors to case number 105 (this is 4 new doors) and everything works fine...

Where is the problem? Well, I found that cases from number 106 are reserved to floors, then I moved case number for more 2 new doors to 144 (this is the first tile after floor tiles).

I used Chaos edit to add textures, tile configuration and put that new doors on map.(There is everything ok. I attached sprinfo)
Everything is ok in WL_DEF.H too:


WL_DEF.H related code:



typedef enum {
    dr_normal,
    dr_lock1,
    dr_lock2,
    dr_lock3,
    dr_lock4,
    dr_elevator,
    dr_lock5,
    dr_lock6,
    dr_lock5keys,
    dr_wood
} door_t;


----------------------------------------------

I have problem with these last two doors.

WL_DRAW.CPP code related to doors:


#define DOORWALL        (PMSpriteStart-30)

.............................

[i].............................[/i]
/*
====================
= HitVertWall - Adjacent textures
====================
*/

            switch(doorobjlist[tilemap[xtile-xtilestep][ytile] & 0x80-1].lock)
            {
               case dr_normal:
                  wallpic = DOORWALL+3;
                  break;

               case dr_lock1:
               case dr_lock2:
               case dr_lock3:
               case dr_lock4:
               case dr_lock5:
               case dr_lock6:
               case dr_lock5keys:
                  wallpic = DOORWALL+11;
                  break;

               case dr_elevator:
                  wallpic = DOORWALL+9;
                  break;

               case dr_wood:
                  wallpic = DOORWALL+29;
                  break;
          }
        }
        else
            wallpic = vertwall[tilehit & ~0x40];


/*
====================
= HitHorizWall - Adjacent textures
====================
*/

switch(doorobjlist[tilemap[xtile][ytile-ytilestep] & 0x80-1].lock)

            {
               case dr_normal:
                  wallpic = DOORWALL+2;
                  break;

               case dr_lock1:
               case dr_lock2:
               case dr_lock3:
               case dr_lock4:
               case dr_lock5:
               case dr_lock6:
               case dr_lock5keys:
                  wallpic = DOORWALL+10;
                  break;

               case dr_elevator:
                  wallpic = DOORWALL+8;
                  break;

               case dr_wood:
                  wallpic = DOORWALL+28;
                  break;
          }
        }
        else
            wallpic = horizwall[tilehit & ~0x40];

/*
====================
= HitHorizDoor
====================
*/

    switch(doorobjlist[doornum].lock)
    {
        case dr_normal:
            doorpage = DOORWALL;
            break;
        case dr_lock1:
            doorpage = DOORWALL+12;
            break;
        case dr_lock2:
            doorpage = DOORWALL+14;
            break;
        case dr_lock3:
            doorpage = DOORWALL+16;
            break;
        case dr_lock4:
            doorpage = DOORWALL+18;
            break;
        case dr_elevator:
            doorpage = DOORWALL+4;
            break;
        case dr_lock5:
            doorpage = DOORWALL+20;
            break;
        case dr_lock6:
            doorpage = DOORWALL+22;
            break;
        case dr_lock5keys:
            doorpage = DOORWALL+24;
            break;
        case dr_wood:
            doorpage = DOORWALL+26;
            break;
    }

/*
====================
= HitVertDoor
====================
*/


    switch(doorobjlist[doornum].lock)
    {
        case dr_normal:
            doorpage = DOORWALL+1;
            break;
        case dr_lock1:
            doorpage = DOORWALL+13;
            break;
        case dr_lock2:
            doorpage = DOORWALL+15;
            break;
        case dr_lock3:
            doorpage = DOORWALL+17;
            break;
        case dr_lock4:
            doorpage = DOORWALL+19;
            break;
        case dr_elevator:
            doorpage = DOORWALL+5;
            break;
        case dr_lock5:
            doorpage = DOORWALL+21;
            break;
        case dr_lock6:
            doorpage = DOORWALL+23;
            break;
        case dr_lock5keys:
            doorpage = DOORWALL+25;
            break;
        case dr_wood:
            doorpage = DOORWALL+27;
            break;
    }

--------------------------------------------------------
WL_GAME.CPP spawn doors code:


if ((tile >= 90 && tile <= 105) || [i](tile >= 144 && tile <= 147))
            {
                // door
                switch (tile)
                {
                    case 90:
                    case 92:
                    case 94:
                    case 96:
                    case 98:
                    case 100:
                    case 102:
                    case 104:
                        SpawnDoor (x,y,1,(tile-90)/2);
                        break;[/i]


                  case 144:
                  case 146:
                        SpawnDoor (x,y,1,(tile-144)/2);
                        break;


                    case 91:
                    case 93:
                    case 95:
                    case 97:
                    case 99:
                    case 101:
                    case 103:
                    case 105:
                        SpawnDoor (x,y,0,(tile-91)/2);
                        break;




[i]                  case 145:
                  case 147:
                        SpawnDoor (x,y,0,(tile-145)/2);
                        break;
[/i]
                }
            }

--------------------------------------------------------

When I run game with this WL_GAME.CPP code, instead of wooden doors there are normal doors, instead of 5-lock doors there are gold key doors for horizontal and silver key doors for vertical.

When I run game with changed values there are no object in game or there are some certain walls..

Thank you.

[solved]Wolf4SDL - How to add a new sounds - Wed Feb 06, 2019 1:27 pm

[SOLUTION]

Use WDC program:
In "Sound Tools" menu use "Add a new sound" wizard to add all of three types for your new sound (PC, Adlib and Digital sound).
In "File" menu, compile all OR compile only "AUDIOT" and "VSWAP".
In AUDIOWL6.H above LASTSOUND add a new sound name.
In WL_MAIN add a new sound name in wolfdigimap after sound number 45(ROSESND).

Of course, don't forget to compile all of these changes. But before that, one more thing.

I did all of these steps already before, but where was my problem...
It is in VERSION.H:
WDC program needs some test folder(different from base folder). So, in that test folder I forgot to change the WOLF3D DATA FILES location.
Every time, when I run the game with compiler or game itself in its folder, the game crushes because I forget to change this line in VERSION.H:
#define DATADIR "/xxx/xxx/.../xxx/Wolf4SDL Folder/"

This line represents location of the WOLF3D data files.
Instead of that address just put:

#define DATADIR ""

OR

#define DATADIR "./"

Finally, now the game is ready for compiling and running with your new sound.

Good luck!

[solved]Wolf4SDL - How to add a new sounds - Mon Feb 04, 2019 6:37 am

Hi Princess Peach!
I know that and I did it before as I wrote in my first post, but that didn't work!
There must be something more to change in the code(I don't know in which files exactly)..
Exactly, I don't understand a NUMSOUNDS and NUMSNDCHUNKS state in code for Wolf4SDL. In Wolf3d source code it was not the case(requires only to increase the values).
My first entailment was that there should be some #define for NUMSOUNDS and NUMSNDCHUNKS or something what is connected with it somewhere in the files, but I didn't find any..
There must be solution in the code for this (for me simple) case, but I'm not that good with Wolf4SDL, so I need help Smile


Back to top

Current date/time is Wed Apr 01, 2020 10:32 am