Sections:
    Space Hulk: C&B
    Vampire: Redemption
    Toy Wars
    X-Files Postmortem
       (or on Gamasutra)
    X-Files Episode Guide
    Battle Beasts

Features:
    Redemption FAQ

Maps:
    A Private House
    Escape Into Darkness

Tutorials:
    Doors That Open
    Chronicles With Scenes
    Publishing Expansions

Resources:
    Vampire Patch 1.1
    NOD SDK 1.1
    GenSurf

Good Hunting:
    PlanetVampire
    QERadiant.com
    Nihilistic BBS
    White Wolf
    Activision

darklord.com

Doors that Open
by Jason VandenBerghe

Printer Friendly Version

This document is copyright (c) 2000 Corporation X.  All rights reserved because... because they are.  Do not reprint this document without explicit written permission from the author, or your shoes will smell. Badly.

Vampire: the Masquerade is a registered trademark and Vampire: Redemption is a trademark of White Wolf Publishing, Inc..
 

The Big Idea

This tutorial is written to give you an idea of how to put openable doors into your Vampire: Redemption levels. That's it! That's all! If you want more than that, you'll have to go somewhere else!

The Basics

In the NOD engine, a door is just a brush that you give certain attributes to and assign one of several possible door Java scripts to. (If you don't know what a brush is then you're likely ahead of yourself. Try this tutorial first.) The concept of a "door" is really better said as "moving brush", because you can do a lot more with these types of brushes than just make doors. Anywhere you want a brush that moves between two locations when it's clicked on (sliding doors, hatches, movable altars, whatever) you can use these scripts to serve your needs.

Carve Yourself A Door-Like Brush

So, to get started, draw yourself a doorpractice.map level; two little 512x512x256 rooms that share a wall (the wall that the door will be in). Carve a door-shaped brush out of the shared wall. (For a great tutorial on how to do this, check out Kiramin's Embrace tutorial.)

You should end up with something that looks about like this:

I picked the Prague texture set, and pulled out some textures that look good together. Mmmmm, Prague texture set.

(In order to get the door texture lined up right, I selected the visible surface of the door brush (not the door itself, just the front face), and pressed (Ctrl-F)it To Surface. FYI.)

Turn It Into A Door

Nihilistic was kind enough to provide a very simple method of turning this brush into an openable door. Select the door, right click, and pick the QuickDoor menu item.

You will see five options: Door, PivotDoor, DoubleDoor, DoublePivotDoor, and SwitchDoor. Select PivotDoor (because that's the one we want for this case). You should see something that looks like this:

What has happened? The Embrace has:

  1. Turned your door brush into a templatebrush. It has done this so that you can associate scripts and other attributes to it. Your door now is highlighted in blue (or another color, if you have changed your color scheme).
  2. Associated the tracker_thing template with the door. This is so that you can roll your mouse over the door in the game and make it highlight, and to allow you to click it.
  3. Created a path_corner object, and associated it (through arcane magic that I do not yet grok) with your door. This is the little brown box that is highlighted in the center of the door, and it is the key to the door movement. This path_corner has a TARGETNAME key (probably set to "t1"), and your door has a TARGET key (also probably set to "t1"). There is some other step in this process that actually connects the two; if anyone knows what it is, please email me.
  4. Associated the PivotDoor script with your door templatebrush, which the NOD engine will send messages to when you interface with the door in the game.

So, *poof* you have a door. However, if you export and build your level right now, you will be able to click on the door, and you will hear a satisfying click-clack, but the darn thing just won't open. Why?

Let me introduce the magic of the path_corner.

path_corner

The settings of the path_corner tell the engine what to do with the door when you click it. Each door script is a little different, so we'll handle each one in turn. There is, however, a concept that applies to each case: orientation. This is the center of the mystery, so here goes:

Select your path_corner (you may have to temporarily move your door brush out of the way). Press 'N' to switch the texture pane (or the console, depending on what you have selected) to the Entity Info pane. Select the "Main" tab on the upper right, which should give you something about like this (you may need to resize frames within the window to get it to look right):

Templates & Orientation

Most template object have an "orientation" which tells the engine which direction to face them. When you are placing objects like a couch or a lamp, you might think that if you wanted the object to face a different direction that you should simply turn the templatebrush by hand. This is not so; it will cause the engine to simply not draw your object in the level. Orienting templatebrushes is done here, in the Entity Info pane. You're given the choice of selecting one of the "standard" orientations (0, 45, 90, 135, etc), or entering your own (which may be any value, positive or negative) in the fields given. Pitch will tilt the templatebrush around the X-axis, Yaw will tilt it around the Z-axis, and Roll will tilt it around the Y-axis. Yaw is most commonly used, because normally objects are oriented straight up and down in a map, and pitch and roll will tilt the object one way or the other.

Back to path_corner

So, your path_corner object has an orientation, which is the key to determining how your door will open. The orientation you give to this path_corner object tells the engine how far to turn the door, using the number of degrees to assign to the orientation, and in what direction, based on whether that number is positive or negative (positive=counter-clockwise, negative=clockwise).

Make sense? We'll try an example to help illustrate this. With your path_corner selected, click the button on the Main tab in the Entity Info pane marked "90". You should see a little arrow appear inside your path_corner:

You've told the engine "turn my door 90 degrees counter-clockwise as it opens", which means... uh, hmmm. Nope, that's not right. With the door texture the way I've got it, to open the door outward we would want the door to turn clockwise. Okay, so click in the edit box where the "90" appeared in the Entity Info pane, and type "-90". Hit enter. Now the arrow should be pointing the other way:

That should do it. Now, the PivotDoor will pivot around the center of your path_corner (clockwise, if you followed the instructions above), which means that the centerpoint of the path_corner is effectively our "hinge" for the door. So, move the path_corner to where the hinge would be, here:

Duration

Finally, we'll change how long it takes for the door to open.

Every new door (built using the QuickDoor menu) starts out taking three seconds to open. To change this behavior, you must modify the duration variable using the Codex Linker.

The Codex Linker

Select your door brush and press Shift+C to bring up the Codex Linker. A window will pop up that looks like this:

The one we're interested in here is Duration. Initially, your duration is set to 3, which means that your door will take 3 seconds to open. Change this by clicking on the number in the linker once, and then again (not a double click, two clicks with a pause between them). You should be granted an edit box to change the value. Enter "1", press enter, and then click the Apply button.

What we have done is changed the data that is given to the PivotDoor class object when the user does something to the door. This Codex Linker is the way that you pass all data from The Embrace Land (where everything's a brush) to Java Land (where everything's a class). Codex Linker good!

Opening The Door

Make sure you've got a playerstart (and some lights if you're feeling spunky) in your map, export it, and run it.

Holy freakin' molasses! If you followed the steps in this tutorial correctly, your door should open away from you, pivoting on the right, like you see above. Victory!

Boy, that's one thick door. Let's fix that real quick, like this:

So, you have a working PivotDoor! But wait, you say, there are four other kinds of doors! True. I can help with one of those for now: Doors.

In the case of a Door class object, the path_corner indicates where you want the centerpoint of the door templatebrush (as indicated by where the little brown arrow that points to the path_corner originates inside the templatebrush) to end up when it opens. You may apply an orientation to the path_corner if you wish the door to turn as it moves, but remember that this is centerpoint-to-centerpoint movement. This is useful, for example, for making sliding doors that open sideways.

DoubleDoor, DoublePivotDoor, and SwitchDoors will have to wait until later. I have a question in to NSI about how these work, because I don't freakin' know! I'll update this tutorial when I have it figured it out.

Please email the author with comments, concerns, or corrections to this document. Good luck, and happy bloodsucking!