Note: Some of this is likely obsolete. For example, bashing has been largely deprecated and is used only in special-case situations now.
Doors are a part of the Placeable system but are more complicated than most other Interactive Objects. They are connected to door attachment points that are built into area layouts; to find door attachment points click on the blue sphere that becomes visible when a door is selected in the area editor (this is the door's 'hinge') and corresponding attachment points throughout the area will become visible.
There are two types of doors: Area Transition Doors and Room-To-Room Doors
Any interactive object (including doors) placed in the Designer toolset does not get proper lighting. Art needs to have control over the look of these Area Transition doors.
Area Transition Doors
These are placed in the ART TOOLSET. They are static. They do not animate when opened. They are both the door and the door frame as one static piece of art. These have a door hook built into them
User interacts with them and then are teleported into the next area. No door opening animation.
Design hooks a door in the design toolset to the art door by dropping the design door into the DOOR HOOK on the static door
There is a flag called “Invisible” for doors. Design sets this to true for this kind of door. Design can still set properties on this door (i.e., locking it). The connection between the "Art" door and the "Design" door is established by the fact that the Design-door was placed on the door-hook of the Art-door.
To make a door into an area transition door, the following variables must be set:
- PLC_AT_DEST_AREA_TAG - tag of the destination area
- PLC_AT_DEST_TAG - tag of the destination waypoint within the destination area
If the destination waypoint is in the same area as the door, you may need a bug fix.
Door frames are built in two pieces. The frames will applied to each room. This is to avoid issues of knowing “who owns the door-frame” for fog-of-war and visibility purposes.
The See Thru Flag: If this flag is true the door DOES NOT block visibility. Design will use this for doors that look like they can be seen through (i.e., a prison door)
How doors open in-game
Doors in Dragon Age open by swinging on a hinge. There are no sliding doors.
The swinging arc will vary from door to door but will be either 90 degrees or 180 degrees (flat against opposing wall).
Doors open in both directions, depending on which side of the door the player is on. The door will always open away from the player.
Doors cannot be blocked from opening. The tactical element of “door hogging” will be determined by creatures blocking doorways, not doors.
You can have these types of door outside but they can’t be area transitions (i.e., they can be a gate).
There is no closing animation when closing a door.
Doors And Fog-Of-War/Visiblity/Perception
Door Bashing and Alert System
The system can improve game play experience and make the open-lock skill more useful. Basically, if a player bashes down a door he would alert the creatures on the other side: they would move to strategic positions, buff themselves, and so forth. If the player picks the lock he would be rewarded by surprising the creatures on the other side.
The door signals the door-bash event whenever someone attacks it. The signal is sent to any nearby creatures from the same group of the door. A creature receives the signal and reacts to it as appropriate.
Most of the scripting is inside the generic scripts for doors and creatures. However, the door and the signaled creatures must be of the same group. A group can be set by the SetGroupID function or by setting the group-faction on the object.
By default, the door calls the AlertGroup() function to alert all nearby creatures of the same group. This function has a parameter of distance that can be set to any maximum distance in which creatures would react to the door (default is 20m).
To customize the handling of the event by the creature simply set the following variables on the on-spawn event for the creature. The function that uses these values is called inside the default creature core script. By default, the creature would face the door, draw weapons and buff himself with potions and spells. The function has the following parameters:
DBASH_DISABLE: disable all door bashing behavior for this creature.
DBASH_EQUIP_TYPE: Tells the creature what type of weapons to equip:
- 1 - melee weapons.
- 2 - ranged weapons.
- 0 - best weapon (either melee or ranged)
DBASH_RUNTO_WP: The creature would run to the specified way-point. If no wp has been specified then the creature would run to a wp with a tag of "DBASH_WP_" + (creature's tag). If no way-points have been found the creature would remain in place.
DBASH_AREA_ALARM: Raise area alarm if set to TRUE. This would send a signal to the area. The area object is responsible for handling the alarm. Default value is FALSE.
DBASH_NOBUFF: By default, every creature would try to drink potions and cast buffing spells. Setting this var to TRUE would make the creature skip the buffing step.
DBASH_SCRIPT: The string stored in this variable is the name of the script to be executed when all other actions are done.
Lockable Doors and Unique Keys
Implementing locked doors that can be lockpicked by a rogue is a simple process. After the door has been placed within the level, simply set the door's status to Closed_Locked (or simply Locked, if the door is also an area transition) and set the desired difficult for the lock.
If you wish a door to only open with a specific key, then you will need to create two new resources - one for the key, and another for the door itself. The key needs to be of the Base Item Type of "Other - Key". Give the key a unique tag, as this is what the door will need to check against in order to determine it is the correct key to open the door. In the properties for the new door resource, ensure Initial State is set to Locked. Then fill in the values of the "Key" section of the resource as required. "Key Tag" will be the tag you previously entered as the tag for the key. If "Auto Remove Key" is true, the door will remove the key from the player's inventory after the door has been opened, and "Key Required" will make it impossible for the player to lockpick the door if it is true.