Line

D a r k n e s s     F a l l s
T u t o r i a l

Line

How to make a subway car in Dark Forces

by Eric Pauker

Here is a description of how the subway car in my level "Energy Mine on Parux" works.

The subway car is made up of 5 parts

1. A switch to trigger the elevator.
2. A move_floor elevator for the door.
3. A morph_move1 elevator for the subway car.
4. A scroll_floor elevator to make the floors in the subway car move with the subway car.
5. A scroll_ceiling elevator to make the ceilings in the subway car move with the subway car.
The subway car and it's parts


INF for Subway Car Switch:

seq
class: trigger toggle
entity_mask: 2147483648This # means that the player can activate the trigger
event: 1024This # will be sent to the subway_car sector when the trigger is activated
event_mask: 48This # means the trigger is activated when it is nudged
client: subway_car
seqend


INF for Subway Car Door:

seq
class: elevator move_floor
speed: 10
stop: 66 holdThe height of the floor when the door is down
stop: 68 holdThe height of the floor when the door is up
seqend


INF for Subway Car:

seq
class: elevator morph_move1This moves the walls of the subway car
flags: 1This flag will make the player move with the scrolling floor
angle: 0
speed: 50
event_mask: 1024When this # is recieved , the elevator will move to the next stop
stop: 0 hold
message: 0 scw4 goto_stop 0Open the door
message: 0 subway_car(13) doneReset the switch
message: 0 subway_car(12) clear_bits 3 10Let the player walk through the door
stop: 0.01 0
message: 1 scw4 goto_stop 1Shut the door
message: 1 subway_car(12) set_bits 3 10Block the player from walking through the door
stop: 1492 hold
message: 2 scw4 goto_stop 0Open the door
message: 2 subway_car(13) doneReset the switch
message: 2 subway_car(12) clear_bits 3 10Let the player walk through the door
stop: 1491.99 0
message: 3 scw4 goto_stop 1Shut the door
message: 3 subway_car(12) set_bits 3 10Block the player from walking through the door
slave: subway_trackMake these sectors move with this one
slave: scp1
slave: scp2
slave: scp3
slave: scp4
slave: scp5
slave: scp6
slave: scp7
slave: scp8
class: elevator scroll_floorThis moves the floors of the subway car
angle: 0
speed: 50
event_mask: 1024When this # is recieved, the floor will scroll to the next stop
stop: 0 hold
stop: 1492 hold
slave: scw1
slave: scw2
slave: scw3
slave: scw4
class: elevator scroll_ceilingThis moves the ceilings of the subway car
angle: 0
speed: 50
event_mask: 1024When this # is recieved, the ceiling will scroll to the next stop
stop: 0 hold
stop: 1492 hold
slave: scw1
slave: scw2
slave: scw3
slave: scw4
seqend


How it works:

When the player activates the trigger with the space bar, the trigger changes to it's "on" texture and sends an event #1024 to the morph_move1 elevator sector named subway_car. When the elevator recieves the event #, it will move from stop 0 to stop 0.01, closing the door and blocking the player from walking through the door. Stop 0.01 happens so fast that it looks like the door closes as soon as the trigger is activated. Since the delay at stop 0.01 is 0, the elevator will continue on to stop 1492. When it arives at stop 1492 the elevator will stop, the door will open, the player will be allowed to walk through the door, and the trigger will be reset to it's original "off" texture. If the player activates the trigger again, the elevator will move to stop 1491.99, close the door, block the player, and move back to stop 0 where everything started out.

To get the walls in the subway_car and each of it's slaves to move with the elevator, flag 1 has to have bit #6 (WALL MORPH WITH SECTOR) set. To do this a 32 is added to the flag. If you use WDFuse you will see this flag labeled as 32. You will notice that all of the walls that make up the subway car will have this bit set.

The subway_car sector is made up of 3 elevators. The one just described and 2 to scroll the floor and ceiling. If the floor and ceiling are not scrolled, then the textures would stay in a fixed position relitive to the subway car, and they would appear to be moving.

You may have noticed the 8 sectors named scp1 - scp8. If these sectors are not included, certain points on the subway car will not move with the elevator. I have not been able to find out why it will not work without these sectors myself. I had just noticed these in other subway cars and trams in various different levels so I did the same thing. Try removing 1 or more of these sectors yourself and see what happens.