Home » 2015 » November » 27 » How to create Doors in SwatEditor
0:08 AM
How to create Doors in SwatEditor
How To Create Doors
This tutorial will demonstrate how to construct doorways and how to setup a functioning SwatDoor actor for both single player and multiplayer game modes. It assumes you already know how to create BSP geometry and manipulate Static Meshes.
Doors in SWAT4 are created by placing an instance of the SwatDoor class in your map, by default this actor actually consists of a several other actors that make up a complete door.

Door (Static Mesh): The mesh is the rendered representation of the door, it's the part we think of as the door but it only affects the graphical aspects of the door.

DoorBufferVolume: This is used to repulse and/or block players from getting too close to the door when it is closed; this guarantees the player cannot be inside the middle of the door's AntiPortalActor. This actor is automatically generated when the map is rebuilt.

AntiPortalActor: This is used in conjunction with ZonePortals to occlude the players view whenever the door is closed, meaning it will prevent the engine from rendering what is beyond the door while it is in a closed position. This actor is automatically generated when the map is rebuilt.

Stackup Points: Labelled as S these points are used by the AI to determine where they should stand and what direction they should face when ordered to "Stack-Up". They are further explained in section 6. Stack and Clear Points.

Clear Points: Labelled as C these points are used by the AI to determine where they should manourver too when ordered to "Clear" the room beyond a door. They are further explained in section 6. Stack and Clear Points.

Although you can have any sized opening in your map, doorways and other openings where you want to use special doorway tactics, such as the "Stack-up And Clear" commands, must be a specific size. It is always assumed that you or the AI will be a certain distance away from the door when interacting with it.

When carving a BSP opening for a doorway; single doors must be 80 Unreal Units (uu) wide, 160 uu high, and 16 uu deep; double doors must be 160 uu wide, 160 uu high, and 16 uu deep.

Doorway dimensions

After the door frame has been added the available space must be 78 uu wide and 158 uu high for a single door, or 158 uu wide and 158 uu high for a double door; this means the door frame's mesh can be inset by 1 uu on all sides to prevent 'Z-Fighting'.

Note: Most door frames will not have a base and will not be raised up from the floor by 1 uu, making the available height 159 uu. The thickness of the door frame does not have to measure 1 uu, it can be moulded around the geometry or overlap it.

First of all you need to make the doorway connecting two rooms, remember to use the dimensions outlined above and you should end up with a subtracted space similar to the image below. For this example I've choosen to create a single door.
Doorway Opening

Once you have created the geometry you need to add a door frame, the door frame is just an ordinary Static Mesh; there are plenty to be found in the Doors_sm package. Here I'm going to use Doors_sm.door_door01frame you might recgonise it from the Fairfax Residence. You need to position the frame so that its base is touching the floor but the other edges are inset from the geometry by 1 uu.

Door Frame Alignment
Next you need to add and position the door itself. Open the Class Browser and locate the SwatDoor classes, these can be found in theSwatGame package or by browsing to Object.Actor.NavigationPoint.Door.SwatDoor along the class path.

Select the type of door you want to use; either a SingleDoor or DoubleDoor, and add it to your map. Note: There are several subclasses or SingleDoor and DoubleDoor but the only modifications seem to be the default Static Mesh.

You'll notice a number of actors have appeared in the location where you added the door; by default a SwatDoor actor actually exists as a group of actors. These are explained further in section 1. Door Components.

SwatDoor Actor

Ignore the Stack and Clear Points for now as you can move and rotate a SwatDoor just like any other actor. You need to position the door so that it's sides fit flush to the door frame, however you'll notice that the door is vertically offset by half a unit. I normally leave this gap at the bottom; between the door's mesh and the floor, leaving the top of the door's mesh overlapping the door frame. Note: This gap appears to be intentional.

Door Position
Once the door is correctly positioned you need to set the two Static Meshes used to display it; one is used to show the door as normal, and the other is for when the door has been breached. There are plenty to be found in the Doors_sm package.

Note: There are no double door meshes except for the "FusedDoubleDoor" place-holder mesh that is used to display a double door in SwatEd. Instead it uses single door meshes that are automatically duplicated in-game.

Before you can assign the door a new Static Mesh you must Unlock it. To do this; right-click the SwatDoor actor in any viewport, then highlight Grouping from the pop-up menu and select Unlock. You can now select the individual parts that make up the SwatDoor actor. Alternatively you can use the Group Browser to do this.

Grouping Menu Selection

Right-click the Door (Static Mesh) in any viewport and then select Properties from the pop-up menu. Alternatively you can select the Door (Static Mesh) in any viewport and then click the Actor Properties button on the toolbar.

Door Properties Menu Selection
To begin make sure the door is unlocked and that you can access its properties. Open the Static Mesh Browser and find the door you want to use, select the damaged version and then switch back to the properties window of the door.

Select the BrokenStaticMesh property, click the arrow ( > ) button on the right-hand side, and then select Use from the pop-up menu. This will set the BrokenStaticMesh to the damaged version of the desired door; if the door is ever breached this mesh will be displayed in-game.

Broken Static Mesh Property

Note: There are no double door meshes, instead use a single door mesh because it will be automatically duplicated in-game.

Before you begin, make sure the door is unlocked and that you can access its properties. To set the Static Mesh that will be used to display the single door normally; open the Static Mesh Browser and find the door you want to use, select the un-damaged version and then switch back to the properties window.

Expand the Display section and select the StaticMesh property, click the arrow ( > ) button on the right-hand side, and then select Use from the pop-up menu. This will set the StaticMesh to the un-damaged version of the desired door; this mesh will be displayed in-game.

Static Mesh Property
Before you begin, make sure the door is unlocked and that you can access its properties. To set the Static Mesh that will be used to display the double door normally; open the Static Mesh Browser and find the door you want to use, select the un-damaged version and then switch back to the properties window.

Note: There are no double door meshes, instead use a single door mesh because it will be automatically dupliated in-game.

Select the OneOfTheDoubleDoorsSM property, click the arrow ( > ) button on the right-hand side, and then select Use from the pop-up menu. This will set the StaticMesh to the un-damaged version of the desired door; you won't see any changes in SwatEd, but the mesh will be duplicated when displayed in-game.

OneOfTheDoubleDoorsSM Property
Stack & Clear points cannot be added or deleted like every other actor; they are not considered placeable and attempting to delete them will crash SwatEd. The only way this can be done is to change the AcceptCommandsFrom property of the Swatdoor actor. After changing this value you will be prompted to confirm your choice; so just click Yes.
AcceptCommandsFrom Property

If your map only supports adversarial game modes you do not need any Stack & Clear points, by setting this property to CD_NeitherSide the editor will remove them.

These points are used to mark the locations of where the AI officers should stand when ordered to "Stack-up" on the door. The officers will stand at the first available point (Starting from a priority of 1) when they arrive at the door.

If the officers are ordered to interact with the door, for example checking if the door is locked, they will automatically move to the correct position relative to the door to carry out the action. Any officer stood at a particular point will carry out the specific tasks needed to complete an action, if they are unable to do so they will swap with an officer that can.

Any officer stood at point 1 will interact with the door, i.e. they are responsible for opening or breaching. If the door is closed the officer stood at point 2 will deploy the tactical aids; otherwise the officer at point 1 will do so. Officers stood at points 3 and 4 provide cover.

You can move the Stackup Points just like any other actor, so make sure points 1 and 2 are closest to the door since these officers will interact with it. Points 3 and 4 should be further away since these officers will only be covering.

Stackup Points Positions

Once the Stackup Points are in position, you need to set the direction that an officer should look or cover when stood at a particular point. This can be done by using the Actor Rotate tool to set the arrow to the correct angle.

Stackup Points Direction
In some situations a Stackup Point may become blocked or vulnerable when a door is opened towards the AI officers, so you must add anAlternateStackupPoint to allow them to stack-up correctly.

In the image below you can see that point 2 is blocked by the door, and point 4 is in an awkward position. To ensure the AI can still stack-up intelligently, two Alternate Stackup Points should be added.

Blocked Stackup Point

To add an AlternateStackupPoint, open the Class Browser and locate the BaseDoorPoint classes, these can be found in theSwatAICommon package or by browsing to Object.Actor.NavigationPoint.Pathnode.BaseDoorPoint along the class path.

Once the points have been added you need to assign them to a SwatDoor actor; this allows the AI to know if there are any alternative points available. To do this; right-click the Door (Static Mesh) in any viewport and then select Properties from the pop-up menu.

Now you need to find out which side of the door you are adding the points too. The sides are determined by drawing an imaginary line from the door's hinges to the doorknob. For example the left side of the door is where this line is drawn from the hinges on the right, to the doorknob on the left. For this example I will be using the right side.

Scroll down too, and expand the appropriate AlternatePlacedStackupPoints property. Select the first entry in the list, click the arrow ( > )button on the right-hand side, and then select Find from the pop-up menu.

AlternateStackupPoints Property

Switch back to the viewports and you'll notice the cursor has changed; if you select an AlternateStackupPoint that needs to be added to this door it will appear in the list of AlternatePlacedStackupPoints.

Select AlternateStackupPoint

After all of the AlternateStackupPoints have been assigned to the door, you need to set the AlternatePriority property for each of the points. This is required so that any officer stood at a particular point will know what tasks need to be carried out to complete a specific action. To set the AlternatePriority; right-click a Stackup Point or AlternateStackup Point and then select Properties from the pop-up menu.

Select the AlternatePriority property and enter a value between 0 and 4. Remember points 1 and 2 should be closest to the door since these officers will interact with it. Points 3 and 4 should be further away since these officers will only be covering. Any point with an AlternatePriorityof 0 will be ignored, so use this for the Stackup Points you are replacing.

AlternatePriority Property

To clarify this see the image below: StackupPoints 2 and 4 have been replaced by AlternateStackupPoints so they have an AlternatePriorityof 0, meaning they are not used when the door is opened towards the right. StackupPoint 1 has the same value for it's AlternatePriorityproperty since it is still closest to the door. One of the AlternateStackupPoints has been given an AlternatePriority of 2 because it is also closest to the door. The two remaining points have been assigned AlternatePriority values of 3 and 4 since they are furthest away from the door.

AlternatePriority Property Examples
There may be occasions where none of a door's Stackup Points provide an ideal place to deploy tactical aids from, this can often happen for openings with no door. To fix this you can use a PlacedThrowPoint, which causes the AI officer to move to this point before deploying tactical aids.

To add a PlacedThrowPoint, open the Class Browser and go to the SwatAICommon package or browse toObject.Actor.NavigationPoint.Pathnode along the class path; you should see it listed there.

Once the point has been positioned correctly (Remember to rotate it too the direction that the officer should look) you need to assign it to a SwatDoor actor; this allows the AI to know if there is a specific throw point to be used. To do this; right-click the Door (Static Mesh) in any viewport and then select Properties from the pop-up menu.

Now you need to find out which side of the door you are adding the points too. The sides are determined by drawing an imaginary line from the door's hinges to the doorknob. For example the left side of the door is where this line is drawn from the hinges on the right, to the doorknob on the left. For this example I will be using the right side.

Scroll down too and select the appropriate PlacedThrowPoint property. Click the arrow ( > ) button on the right-hand side, and then selectFind from the pop-up menu.

PlacedThrowPoint Property

Switch back to the viewports and you'll notice the cursor has changed; if you select the PlacedThrowPoint that needs to be assigned to this door, it's name will be added to the PlacedThrowPoint property. That's all you need to do, but remember if a PlacedThrowPoint has been assigned to a door it will always be used instead of the Stackup Points.

Select PlacedThrowPoint
When the AI officers are ordered to "Clear" a room, they will go through the doorway and move to a Clear Point that has the same priority as the Stackup Point they were stood at. Upon reaching a Clear Point they report in to the element leader and hold position until given another order.

You can move the Clear Points just like any other actor, make sure they are positioned so that the AI officers will have searched the entire room and finished in a good spot to cover any openings.

Clear Points Positions

Once the Clear Points are in position, you need to set the direction that an officer should look or cover when they arrive at a particular point. This can be done by using the Actor Rotate tool to set the arrow to the correct angle.

Stackup Points Direction
When the AI officers are ordered to "Clear" a room, they will go through the doorway and move to a Clear Point, but how they get there is up to them. The route they use may be unsuitable because they miss out parts of a room or move through an exposed area.

To avoid this you can use ClearRoutePoints; these are points the AI should move through on their way to a Clear Point, essentially they provide hints to the AI officers of where to go when clearing a room.

To add a ClearRoutePoint, open the Class Browser and locate the BaseDoorPoint classes, these can be found in the SwatAICommonpackage or by browsing to Object.Actor.NavigationPoint.Pathnode.BaseDoorPoint along the class path.

Once the points have been added you need to assign them a Clear Point; this allows the AI to know if there are points they need to move through when clearing. To do this; right-click a ClearRoutePoint in any viewport and then select Properties from the pop-up menu.

Select the ClearPoint property, click the arrow ( > ) button on the right-hand side, and then select Find from the pop-up menu.

ClearPoint Property

Switch back to the viewports and you'll notice the cursor has changed; now if you select the ClearPoint that you want to change the AI's route too, it's name will be added to the ClearPoint property.

Select ClearPoint

After all of the ClearRoutePoints have been assigned a ClearPoint, you need to set the ClearRoutePriority property for each of theClearRoutePoints. This is required so that the AI officer will know what order to move through them. To set the ClearRoutePriority; right-click a ClearRoutePoint and then select Properties from the pop-up menu.

Select the ClearRoutePriority property and enter a value starting at 0 and incremented by 1 for each further ClearRoutePoint the AI officer needs to move through.

ClearRoutePriority Property

To clarify this see the image below: the first ClearRoutePoint (Closest to the door) has a ClearRoutePriority of 0, meaning the AI officer should move through this point first. The last ClearRoutePoint (furthest from the door) has a ClearRoutePriority of 2, meaning the AI officer should move through this point last.

ClearRoutePriority Property Examples
The SwatDoor actor has numerous properties that can be tweaked; many for the AI's benefit, but some are useful for all game modes. Considering the scope of this tutorial I am going to focus mainly on properties declared in the SwatDoor class, however there are also some inherited properties mentioned because of their importance.

Note: Many of the properties refer to the left or right side of the door; the sides are determined by drawing an imaginary line from the door's hinges to the doorknob. For example the left side of the door is where this line is drawn from the hinges on the right, to the doorknob on the left.

AcceptsCommandsFrom [Enumeration] : This property only affects Single-Player mode; it designates which sides of the door (if any) the player can issue commands to their element.

AntiPortalScaleFactor [Vector] : This scales the size of the door's anti-portal by the factors given, as long as you set-up your map's doors correctly you shouldn't need to change this.

bIsAntiPortal [Boolean] : When set to True, this generates an AntiPortalActor and enables a closed door to occlude the player's view.

bIsLocked [Boolean] : Determines if the door should start locked and therefore require the use of tools to be opened.

bIsMissionExit [Boolean] : This property only affects Single-Player mode; if the player attempts to open the door, they will be prompted with an option to end the mission, regardless of the current objective's status.

bIsPushable [Boolean] : Notifies the AI actors whether this door has a doorknob or not. This allows for the correct animations to play when the AI officers are ordered to "Check the Lock". An example of pushable doors can be seen in SP-Hospital.

bNoDoor [Boolean] : When set to True, this doorway acts as if there is no door present (Although a valid mesh is still required). Avoid using this property and insert a Generic_DoorwayWithoutDoor actor instead. Note: The only way to have a double door way without a door is to use the Generic_DoubleDoorwayWithoutDoor actor.

bPlayerCanUse [Boolean] : This property determines if the player can interact with the door. Normally True, but there are some examples of doors on SP-Training that the player cannot interact with.

bPropagatesSound [Boolean] : A SwatDoor actor provides a navigational link between two rooms that the AI can follow, for this reason it is also part of the 'SoundPropagation' system. There is little reason to prevent sounds being propagated through a doorway, but you may want to change it.

BrokenStaticMesh [StaticMesh] : This mesh is used to display the door after it has been breached; it is used to graphically show the player when the door is broken.

Display > StaticMesh [StaticMesh] : This mesh is used to display the door when it is not broken (i.e. when the player can interact with it).

ExternalFacingSide [Enumeration] : Designates which side of the door (if any) faces an area of your map considered to be outside. It is used to transform the "Breach and Clear" order to "Breach and Make Entry", when moving from an outside area to inside a building.

ExtraCost [Integer] : This property is inherited from UT 2K3, and would have been used as part of the AI's navigation system to determine the best route to a particular point. However I would not recommend that you alter this value for any navigation point in SWAT 4.

InitialPosition [Enumeration] : Decides whether the door should start open or closed; you can choose to have it open to the left or the right.

IsCoverForAIs [Boolean] : Should always be set to False, since doorways do not provide any cover for AIs.

LeftAdditionalGrenadeThrowdistance [Float] : This value is added to the distance of how far the AI should deploy a tactical aid into a room beyond the door. It is only used when the AI officer is stood on the left side of the door.
Note: I do not know the unit of measurement.

LeftAlternatePlacedStackupPoints [Actor] : This is a list of extra Stackup Points that can be used by the AI officers to stack up on the left side of the door, if one of the preferred Stackup Points were to become inaccessible.

LeftPlacedThrowPoint [Actor] : This property specifies a PlacedThrowPoint that should be used by the AI officers to deploy tatical aids from the left side of the door.

RightAdditionalGrenadeThrowDistance [Float] : This value is added to the distance of how far the AI should deploy a tactical aid into a room beyond the door. It is only used when the AI officer is stood on the right side of the door.
Note: I do not know the unit of measurement.

RightAlternatePlacedStackupPoints [Actor] : This is a list of extra Stackup Points that can be used by the AI officers to stack up on the right side of the door, if one of the preferred Stackup Points were to become inaccessible.

RightPlacedThrowPoint [Actor] : This property specifies a PlacedThrowPoint that should be used by the AI officers to deploy tatical aids from the right side of the door.

RoomName [String] : This name is used to group together all of the navigation points for a single room, and as a result speed up path finding. However since a door belongs to more than room you should always leave this blank.

SoundPropagationDistancePenalty [Float] : The SDK states, "Distance this door will add to the attenuation distance for a sound playing behind this door when closed".

 Brought

Views: 451 | Added by: Hot | Rating: 0.0/0
Total comments: 0
avatar