Door events
The two events tell you when a door has finished moving.
Doors the two door events
Subscribe to Opened and Closed on Doors to hear when a door has finished moving.
public static class Doors
{
public static event Action<DoorChangedArgs> Opened;
public static event Action<DoorChangedArgs> Closed;
}
| Event | Gives you | When it fires |
|---|---|---|
Opened | DoorChangedArgs | A door has just finished opening. |
Closed | DoorChangedArgs | A door has just finished closing. |
DoorChangedArgs what happened
Opened and Closed give you one of these. Its Id is the same as DoorInfo.Id, so you can look the door up with Doors.Get.
public sealed class DoorChangedArgs
{
public string Id { get; }
}
| Property | Type | What it means |
|---|---|---|
Id | string | The same id as DoorInfo.Id. |
Things to know
OpenedandClosedfire when the door reaches fully open or fully shut, not when it starts to move. (They come from the game’s privateOnFullyOpenandOnFullyClosed, which onlyDoor.Updatecalls.)- A door that is stopped halfway fires neither event. (
Door.Stopdoes not reachOnFullyOpenorOnFullyClosed.) - Loading a save does not fire the events by itself. A move that a save was in the middle of finishes after the load, and fires then.
- The events do not tell you who opened the door. The game does not record who started a move, and many things can start one: the player, NPCs, elevators, relays and delayed key unlocks. (Callers include
Interact, NPCForceOpen, elevators, relays and a delayed key unlock.) - Lock changes are on the Interaction page. Use
Locks.LockedandLocks.Unlockedfor those.