Code Editing Tutorials
Adding a new Unlocked Door


In an original VSWAP.WL6 the last 8 wall-images are reserved for the doors(4x2 horizontal + vertical). To add extra doors you can either highten this number with 2 per extra door(one "adding" in FloEdit) or use some walls.

Step 1. Open up WL_DRAW.C And do a search for "DOORWALL". You'll see this:

#define DOORWALL (PMSpriteStart-8)

Step 2. Highten the 8 with 2 for each unlocked door you want to add.

Step 3. Add the images for the doors in VSWAP.WL6 with FloEdit or skip this step if you want to use walls.

Step 4. Add definitions for the extra doors in WL_DEF.H by searching for "dr_normal" and placing under it, for example, dr_tvp for each door(each door MUST have it's own name!).

Step 5. Add the extra doors in WL_DRAW.C. Search for "case dr_normal" and put the dr_tvp and so on in here too. This has to be done twice, for both the horizontal as the vertical door positions. Be warned that the "doorpage = DOORWALL + <digit>" matches the entry you wanna use for the door-images in the VSWAP file!

Step 6. Now the engine still needs to know which wall tiles need to be handled as door tiles. Open up WL_GAME.C and search for "InitDoorList". 7 lines after your first hit you'll find this:

"if (tile >=90 && tile <= 101)"

Step 7. Highten the 101 with 2 for each extra door and edit the "case" statements a little further on in the code accordingly.

Step 8. Compile the whole stuff and link it up. Now you have new unlocked doors. However, we DO want to use them, aren't we? Go to your Wolfenstein directory and open up MAPEDIT's MAPDATA file. Add this at the door section:

0066 6070 New door
0067 6060 New door

Done! Now have fun with your doors!

Get back to the Dome tutorials
Jump to the top