BASIC DOORS and DTM_TEAMDOORS DOCUMENTATION v0.5
Prepared by Colin Capstick/ Entrafis

Disclaimer:
"THIS DOCUMENT IS NOT MADE BY OR SUPPORTED BY Monolith Productions, or any of its
affiliates and subsidiaries."  I am new at this stuff myself...so with that said you understand that it is possible that I don't know what the hell I am doing. If your computer explodes when you compile any map that I made...don't say I did not warn you.

Included Files:
     
File Name:  DTM_DoorTest1.ed with compiled .dat
File Description: Sample implementation of 2 team doors.
     
File Name:  DTM_DoorTest2.ed with compiled .dat
File Description: Sample implementation of 2 team doors and Dynamic Hullmakers.      
     
File Name: Object.lto
File Description: Modified Shogo Objects for use with the DTM mod. 



SECTION A: INTRODUCTION

1.  What is this tutorial gonna do for me?

In the tutorial we will take a look at how you go about adding a door in your level. It will also take a look at some new door and trigger features from DTM.

1. What treats did we give you?

In the zip you will see that you have a new "object.lto" that was designed for use with the DTM mod. Put this file in your Project directory and you should be able to start building. I threw in some sample maps to show you how to get started. If you are only interested in making doors and are not interested in DTM mapping, DO NOT use our object.lto. All of our references to team triggering could also be ignored. 


2. What makes these doors so special?

The doors have same functionality as the previous shogo doors but now possess a new important feature that allows the control of team access.  The new feature is made possible due to a  modification that we have made to the "door object" and the "trigger object".  In the properties of these objects you will see the addition of the "RedTriggerable, BlueTriggerable" flags. You simply set one of these flags to "false" if you want to restrict access to a  team. Leave them set to their default value of "true" to allow the team
to have access to that area.  This new feature has been seen before in the Quake 2 mod Weapons Factory and Team Fortress for Quake 1.  In these mods, the doors kept the other team from getting in to spawn areas and Supply depots.  How you use them is up to you.


3. Do I have to use "team doors" in maps I make for DTM!?!?

No. We felt it would be "a cool thing" to let people have the option of using the feature since Myrik went through the trouble of adding it :) However its use is not essential.  We will leave it to you to decide whether or not it fits with your level's style. We just thought it would be a nice option.

4. That is cool and all but I never had to make a door before.....SO HOW THE HELL DO
YOU DO THAT?!!?!?!?

For those of you that are new to this like me, I have made a quick run through tutorial on how to add team doors.



SECTION B: DTM_TeamDoors1.ed 

Getting ready:
Place the "DTM_TeamDoors1.ed" and the new "object.lto" in to your Project Directory. Fire up Dedit and open the "DTM_TeamDoors1.ed" from your worlds tab.

A look at the first map:
This map consists of a room that has two different doors. If you were run the map, you would see that the "Red Team" would not be able to open the "Blue Team's " doors, and vice versa. Cool eh? 

Getting the Door Ready
First I built a simple room, threw on some quick textures and lighting.   Next came the door frames that will encase our doors.  Most door textures are 128x128, so I built it with that in mind. In the frames I placed the brushes that would act as the doors. So far, this is stuff that would have been covered in the tutorials found on PlanetShogo's Editing section.. So on to the fun stuff.

Once the room was built, I added the frames and doors brushes. It was then time to make them work.  In order to get a brush to act as a door, it must be bound to a Door object.  You will want to place the Door object close to the "door brush". Add it by selecting the brush that is to be the door,then, right click, choose "bind to object". This will bring up the "Shogo Object dialog box", select Door. In the node list you will know see Door listed, noting that it is also attached to the door brush. You can also bind doors to a brush by adding the Door object and dragging the "door brush" underneath the "Door Object" in the node list.  Both methods are fine.  If wish for your doors to be of a "dual sliding doors"
style you will need to make two separate brushes.  This is because the doors open in different directions. Both of these door brushes would have to be attached to there own "door object".  I have included both these types of doors in the sample map. 

The doors need some values set so that they will function. In the nodes list select the door object that you have just added, and select the properties tab. The name of your Door objects must be a distinct name to set apart from other doors.  Use a naming convention like Door0, Door1, Door2, etc. The names of the brushes do not matter.
     
Before we go any further we have to discuss how the Doors know how to open. The doors use a
trigger to detect what it should be doing.  When it is activated, the trigger sends a message to the door and tells it what action the door is to perform. Doors have a built in trigger that allows them to handle these events itself, however, the trigger object is sometimes needed in special cases.  We have modified both of these to objects so that it supports team control no matter what method you use. A simple door probably would use the built in trigger, but doors that are more complex such as the "dual sliding doors" or button activated doors most likely would use the trigger object. If you are going to have the door self triggering, then it would be a good idea to place the green marker at the center of your door brush when you add the door object. This is so that the self trigger will be centered. Both styles are in the sample map. With that out of the way we can go on with the door properties.


DOOR PROPERTIES
This is a quick breakdown of things that you will need to have set in the door properties. These are also detailed in "Level Editing Documentation" found on Planetshogo.

1. StateFlags: 
This has to be set to 1 if you want your door to use its built in trigger. It is set to 0 at default which requires the use of the "trigger object" to open the door.

2. Speed:
You have to indicate the speed at which the Door will travel.

3. MoveDelay:
This is how much time it waits to take action after it is triggered. You can leave this set to 0 if you wish to have no delay time.

4. MoveDist:
Set the distance that you want the door to open. Leave a little over-hang. If your door is 128x128, move it about 124 so that 4 units over-hang the frame of the door. Read the docs for more info.

5. MoveDir:
Set the direction on axis you wish the door to travel. They are set to a default of 0, and will not move. Set to 1 for moving in the positve range. -1 for negative range.

6. SoundPos
Not really neccessary. Special case.

7.  PortalNames
For using dynamic hullmakers. Discussed later.

8. Sounds
To set a sound such as OpenStartSound and CloseStartSound set them to something like sounds\doors\tech2.wav. OpenStartSound sets the sound heard when the door begins to open.  CloseStartSound sets the sound heard when the door begins to close. Refer to the docs to see what the others do.

9. SoundRadius
Sets where the area in which the sounds are heard.               

10. OpenWaitTime
You have to set this or the door will not stay open. 2 or 4 are good numbers.

11. CloseWaitTime
This is how long to wait until door can be activated again.      

 
12.  Trigger Dims
This defines an area that will cause the door to open when the player is inside it.  Set this if the door handles its own triggering. Check that StateFlags is set appropriately.

13.  ClosingSpeed
This is how fast the door will close.

14.  AITriggerable
Not neccessary.

15. Waveform
Sets the motion type of the door. Constant speed is default. There are other cool ones. See the docs.

16.  Debris Type
Not Necessary.

17.  Mass
Default is fine


TRIGGER PROPERTIES

Note about the door object:
When using a trigger, the stateflags in the door object can use the default value of 0 since it will not be using it own trigger. Set trigger dims to zero as well.

The name of the trigger should be distinct. Use something like Trigger0, Trigger1, etc.
There are only a couple of things you have to be concerned with to get the trigger to work with a door.  Triggers can be used to activate more than one door which is very useful.  Doors that have 2 parts that move in different directions can be given one trigger.  When you want to trigger more than one door, you have to use multiple target-names to state which ones. 

1.  TriggerDelay
This is the time that it takes before it can be triggered again. Without this set to a non-zero value, I could not get this work. A value of 1 is fine.

2.  TargetName 
The name of the target to trigger. Use Door0 if you want it to open Door0.

3.  MessageName
Tells the door what action is to be performed.  Use "trigger" to tell it to open. 

4. TriggerTouch
The door won't open without this set to true.

Triggers can be used to open more than just doors.  You could make team triggered traps and things of that nature. What you use them for is up to you.


SECTION C: DTM_TeamDoors2.ed 

Getting ready:
Place the "DTM_TeamDoors2.ed" and the new object.lto in to your Project Directory. Fire up Dedit and open the "DTM_TeamDoors2.ed" from your worlds tab.

A look at the map:
This map is the same as the other map, but has dynamic hullmakers.  Dynamic hullmakers are 
hullmakers that shut "off" when the door is open and are set to "on" when they are not.  Anything that is beyond a closed door will not be rendered. It makes sense that almost all doors would use them to improve your frame rates.

Dynamic Hullmakers(portal):
I tried my best to find out as much about this as possible. This is what I have concluded, and is not neccessarily "CORRECT". The "Potentially Visible Set (PVS)" is used to determine what is visible from a given point. The processor would build the level and after everything was complete it would calculate the PVS. It was the PVS that would be used to figure out what was to be drawn depending on where you were. Sometimes the levels would have some complex areas and you would want to have more control over how much the renderer would have to consider.  Portals were used in cases such as this, where you may be considering more polygons than you should have too. These portals can be used to section off areas to limit what was rendered. 


Adding the Dynamic Hullmaker:
To add the dynamic hullmakers, make a brush inside the door frame with a thickness of 0. In the brush's properties, set the name to Portal0. Additional portals should have distinct names as well such as Portal1, Portal 2,ect.  Set the portal to true. Everything else to false. You should also set the name in the node list to portal so that you don't confuse it with any other brushes. In the door object properties set the portal name to the name of the portal that you have just created. That should be about it for making a dynamic hullmaker. 

What kind of results do they offer?
I have not used them much. So I can't say how to use them to get the best results. I have noticed in the Lith maps that the bigger the level, the more hullmakers you would see.  If you were to put one in a door way and did not set it to turn off when the door opened, something very strange would be seen.  The door would open and a "hall of mirrors" effect would be visible. If you typed "forceclear 1" into the console, that same portal would turn black.  It would then appear that it was the end of the level and only black space was on the other side. If you walk through it, you soon find out that everything is indeed there.  You can see this effect as evidence that the portal acts as a clipping plane which does not draw what is on the other side. Whether or not they offer a significant boost in performance is unknown to me.  They may cause an undesirable effect if you have to many....not sure. See OF_Comm2 in the shogo-tools/multi/levels for a look at how they can be used.

A few last words
This is how I did it. This may have been confusing in areas, so any questions are welcome.
If you know better ways of doing it or have suggestions please drop me an email. 

Thanks
Monolith for making great games. Planetshogo for putting out documentation that has saved me some major headaches. I82 and the other great mappers that have contributed to DTM.


Written by Colin Capstick/Entrafis DTM Level Designer
Email: entrafis@hotmail.com
ICQ: Scum 15226192

Date: May 27, 1999
