Source Code

   TUTORIAL 3: Changing the Secret Elevator Back Maps

   How's this for a let-down: I picked up my first Wolfy editor, made my first Wolfy level, put in a secret elevator, and a short time later discovered that the elevator returned to the wrong floor after I finished the secret level. Yes, the damn elevator back maps, as they're called, are hard-coded. But now, you can change them! So do it! No one who has access to a compiler and the source code should ever again have an excuse to release a set of levels where the secret elevators are on the same floors as they've always been, because really, how "secret" is that? You know the drill: E1L1, E2L1, E3L7, E4L3, E5L5, E6L3. If the secret elevators aren't there, the game doesn't care -- you'll still go back to L2, L2, L8, L4, L6, and L4. Borrring. Fortunately, you can change all of that in just one line of code, how about that! For more complex operations, and to precisely control which level the elevator takes you to, you'll have to get into WL_INTER.C and do some more heavy modification. More on that at a later date. Hint: Study the code and do it the same way Spear of Destiny handles secret floors... (you're on your own.) Now, if you still want the secret floor to be level 10, but you just want the elevator to be somewhere different in the episode, here's what to do.

Step 1.
   Open up your favorite text editor. (I actually use DOS Edit.)
Step 2.
   Open the file WL_GAME.C from your Wolfy source code directory.
Step 3.
   Do a text/ASCII search for "back maps", or if you haven't changed anything yet, go right down to line 37. The section has a huge comment in front of it that says "ELEVATOR BACK MAPS - REMEMBER (-1)!!". Why does it say this? Because technically, the values here are the level numbers that you return to after the secret level is completed. But since in the source code the map numbers start at 0 and go to 59, the programmers wanted to remind themselves to reduce the logical level number by 1 before putting it in here, so the game knows what to do. So in essence, since the secret elevator is always placed on the floor before the one you return to, you can think of these values as being the levels that the secret elevators go on in each episode. Got it?

   A courtesy shot:

Source code image

Step 4.
   To change the level you should put your secret elevator on in Mapedit, just change the numbers in the braces {}. If you want the secret elevator in your new Episode 1 to be hidden somewhere on level 6, for instance, put a 6 in there instead of a 1 for the first digit. That way, you can go to the secret level and return to level 7 when you're done.
Step 6.
   Save and compile the file. Link it.
Step 7.
   Build your levels accordingly in Mapedit, and test later.

   To some of you, this is something you've wanted to do for the longest time...isn't it nice that it's so blasted easy? Okay, we are now leaving the realm of easy, so you better enjoy it while it lasts. This next tutorial is a bit more in-depth. It's also a popular mod these days. Are you ready? Here's how to add up to two more keys to your Wolfenstein game.


On to the next tutorial: Adding New Keys and Their Status Bar Icons


[ Welcome ] [ News ] [ About the Bunker ] [ Add-ons ] [ Design Tips ]
[ Source Code ] [ My Project ] [ Links ]