Show / Hide Table of Contents

Class PlayerEnterExit

Assist player controller to enter and exit building interiors and dungeons. Should be attached to player object with PlayerGPS for climate tracking.

Inheritance
Object
Object
Component
Behaviour
MonoBehaviour
PlayerEnterExit
Namespace: DaggerfallWorkshop.Game
Assembly: Assembly-CSharp.dll
Syntax
public class PlayerEnterExit : MonoBehaviour

Fields

| Improve this Doc View Source

blockWaterLevel

If different than 10000 this is the height level of water in current dungeon. Otherwise player is not inside a dungeon with water.

Declaration
public short blockWaterLevel
Field Value
Type Description
Int16
| Improve this Doc View Source

DungeonParent

Declaration
public GameObject DungeonParent
Field Value
Type Description
GameObject
| Improve this Doc View Source

ExteriorParent

Declaration
public GameObject ExteriorParent
Field Value
Type Description
GameObject
| Improve this Doc View Source

InteriorParent

Declaration
public GameObject InteriorParent
Field Value
Type Description
GameObject
| Improve this Doc View Source

OverrideLocation

Declaration
public DaggerfallLocation OverrideLocation
Field Value
Type Description
DaggerfallLocation

Properties

| Improve this Doc View Source

BuildingDiscoveryData

Gets current building's discovery data. Only valid when player is inside a building. This is set every time player enters a building and is saved/loaded with each save game. Notes: Older save games will not carry this data until player exits and enters building again. When consuming this property, try to handle empty BuildingDiscoveryData (buildingKey == 0) if possible.

Declaration
public PlayerGPS.DiscoveredBuilding BuildingDiscoveryData { get; set; }
Property Value
Type Description
PlayerGPS.DiscoveredBuilding
| Improve this Doc View Source

BuildingType

Gets current building type. Only valid when player inside building.

Declaration
public DFLocation.BuildingTypes BuildingType { get; }
Property Value
Type Description
DFLocation.BuildingTypes
| Improve this Doc View Source

Dungeon

Gets current player dungeon. Only valid when player is inside a dungeon.

Declaration
public DaggerfallDungeon Dungeon { get; }
Property Value
Type Description
DaggerfallDungeon
| Improve this Doc View Source

DungeonBlock

Gets information about current player dungeon block. Only valid when player is inside a dungeon.

Declaration
public DFLocation.DungeonBlock DungeonBlock { get; }
Property Value
Type Description
DFLocation.DungeonBlock
| Improve this Doc View Source

ExteriorDoors

Gets or sets exterior doors of current interior. Returns empty array if player not inside.

Declaration
public StaticDoor[] ExteriorDoors { get; set; }
Property Value
Type Description
StaticDoor[]
| Improve this Doc View Source

FactionID

Gets current building's faction ID.

Declaration
public uint FactionID { get; }
Property Value
Type Description
UInt32
| Improve this Doc View Source

Interior

Gets current building interior. Only valid when player inside building.

Declaration
public DaggerfallInterior Interior { get; }
Property Value
Type Description
DaggerfallInterior
| Improve this Doc View Source

IsCreatingDungeonObjects

True when GameObjectHelper is creating the RDB Base Game Objects

Declaration
public bool IsCreatingDungeonObjects { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInDarkness

True when player is in darkness. Same as !IsPlayerInSunlight.

Declaration
public bool IsPlayerInDarkness { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInHolyPlace

True when player is in a holy place. Holy places include all Temples and guildhalls of the Fighter Trainers (faction #849) https://en.uesp.net/wiki/Daggerfall:ClassMaker#Special_Disadvantages Refreshed once per game minute.

Declaration
public bool IsPlayerInHolyPlace { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInside

True when player is inside any structure.

Declaration
public bool IsPlayerInside { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInsideBuilding

True only when player is inside a building.

Declaration
public bool IsPlayerInsideBuilding { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInsideDungeon

True only when player is inside a dungeon.

Declaration
public bool IsPlayerInsideDungeon { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInsideDungeonCastle

True only when player inside castle blocks of a dungeon. For example, main hall in Daggerfall castle.

Declaration
public bool IsPlayerInsideDungeonCastle { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInsideOpenShop

True when player is inside an open shop. Set upon entry, so doesn't matter if shop 'closes' with player inside.

Declaration
public bool IsPlayerInsideOpenShop { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInsideResidence

True when player is inside a residence. Set upon entry.

Declaration
public bool IsPlayerInsideResidence { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInsideSpecialArea

True only when player inside special blocks of a dungeon. For example, treasure room in Daggerfall castle.

Declaration
public bool IsPlayerInsideSpecialArea { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInsideTavern

True when player is inside a tavern. Set upon entry.

Declaration
public bool IsPlayerInsideTavern { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerInSunlight

True when player is in sunlight.

Declaration
public bool IsPlayerInSunlight { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerSubmerged

True when player is submerged in water.

Declaration
public bool IsPlayerSubmerged { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerSwimming

True when player is swimming in water.

Declaration
public bool IsPlayerSwimming { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsRespawning

True when a player respawn is in progress. e.g. After loading a game or teleporting back to a marked location.

Declaration
public bool IsRespawning { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

LastInteriorStartFlag

Gets start flag from most recent interior transition. Helps inform other systems if first-time load or enter/exit transition

Declaration
public bool LastInteriorStartFlag { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

PlayerTeleportedIntoDungeon

True when player just teleported into a dungeon via Teleport spell, otherwise false. Flag is only raised by Teleport spell and is lowered any time player exits a dungeon or interior, or teleports to a non-dungeon anchor.

Declaration
public bool PlayerTeleportedIntoDungeon { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

UnderwaterFog

Gets instance of UnderwaterFog controlling fog when below the surface of dungeon water.

Declaration
public UnderwaterFog UnderwaterFog { get; }
Property Value
Type Description
UnderwaterFog
| Improve this Doc View Source

WorldContext

Gets player world context.

Declaration
public WorldContext WorldContext { get; }
Property Value
Type Description
WorldContext

Methods

| Improve this Doc View Source

DisableAllParents(Boolean)

Declaration
public void DisableAllParents(bool cleanup = true)
Parameters
Type Name Description
Boolean cleanup
| Improve this Doc View Source

EnableDungeonParent(Boolean)

Enable DungeonParent.

Declaration
public void EnableDungeonParent(bool cleanup = true)
Parameters
Type Name Description
Boolean cleanup
| Improve this Doc View Source

EnableExteriorParent(Boolean)

Enable ExteriorParent.

Declaration
public void EnableExteriorParent(bool cleanup = true)
Parameters
Type Name Description
Boolean cleanup
| Improve this Doc View Source

EnableInteriorParent(Boolean)

Enable InteriorParent.

Declaration
public void EnableInteriorParent(bool cleanup = true)
Parameters
Type Name Description
Boolean cleanup
| Improve this Doc View Source

MovePlayerToDungeonStart()

Moves player to main start marker inside current dungeon.

Declaration
public void MovePlayerToDungeonStart()
| Improve this Doc View Source

MovePlayerToMarker(GameObject)

Moves player to a start marker inside current dungeon.

Declaration
public void MovePlayerToMarker(GameObject marker)
Parameters
Type Name Description
GameObject marker

Marker gameobject. See StartMarkers.

| Improve this Doc View Source

RaiseOnFailedTransition(PlayerEnterExit.TransitionType)

Declaration
protected virtual void RaiseOnFailedTransition(PlayerEnterExit.TransitionType transitionType)
Parameters
Type Name Description
PlayerEnterExit.TransitionType transitionType
| Improve this Doc View Source

RaiseOnMovePlayerToDungeonStartEvent()

Declaration
protected virtual void RaiseOnMovePlayerToDungeonStartEvent()
| Improve this Doc View Source

RaiseOnPreTransitionEvent(PlayerEnterExit.TransitionType)

Declaration
protected virtual void RaiseOnPreTransitionEvent(PlayerEnterExit.TransitionType transitionType)
Parameters
Type Name Description
PlayerEnterExit.TransitionType transitionType
| Improve this Doc View Source

RaiseOnPreTransitionEvent(PlayerEnterExit.TransitionType, StaticDoor)

Declaration
protected virtual void RaiseOnPreTransitionEvent(PlayerEnterExit.TransitionType transitionType, StaticDoor staticDoor)
Parameters
Type Name Description
PlayerEnterExit.TransitionType transitionType
StaticDoor staticDoor
| Improve this Doc View Source

RaiseOnRespawnerCompleteEvent()

Declaration
protected virtual void RaiseOnRespawnerCompleteEvent()
| Improve this Doc View Source

RaiseOnTransitionDungeonExteriorEvent()

Declaration
protected virtual void RaiseOnTransitionDungeonExteriorEvent()
| Improve this Doc View Source

RaiseOnTransitionDungeonInteriorEvent(StaticDoor, DaggerfallDungeon)

Declaration
protected virtual void RaiseOnTransitionDungeonInteriorEvent(StaticDoor staticDoor, DaggerfallDungeon daggerfallDungeon)
Parameters
Type Name Description
StaticDoor staticDoor
DaggerfallDungeon daggerfallDungeon
| Improve this Doc View Source

RaiseOnTransitionExteriorEvent()

Declaration
protected virtual void RaiseOnTransitionExteriorEvent()
| Improve this Doc View Source

RaiseOnTransitionInteriorEvent(StaticDoor, DaggerfallInterior)

Declaration
protected virtual void RaiseOnTransitionInteriorEvent(StaticDoor staticDoor, DaggerfallInterior daggerfallInterior)
Parameters
Type Name Description
StaticDoor staticDoor
DaggerfallInterior daggerfallInterior
| Improve this Doc View Source

RespawnPlayer(Int32, Int32, Boolean, Boolean)

Respawn player at the specified world coordinates, optionally inside dungeon.

Declaration
public void RespawnPlayer(int worldX, int worldZ, bool insideDungeon = false, bool importEnemies = true)
Parameters
Type Name Description
Int32 worldX
Int32 worldZ
Boolean insideDungeon
Boolean importEnemies
| Improve this Doc View Source

RespawnPlayer(Int32, Int32, Boolean, Boolean, StaticDoor[], Boolean, Boolean, Boolean)

Respawn player at the specified world coordinates, optionally inside dungeon or building. Player can be forced to respawn to closest start marker or origin.

Declaration
public void RespawnPlayer(int worldX, int worldZ, bool insideDungeon, bool insideBuilding, StaticDoor[] exteriorDoors = null, bool forceReposition = false, bool importEnemies = true, bool start = true)
Parameters
Type Name Description
Int32 worldX
Int32 worldZ
Boolean insideDungeon
Boolean insideBuilding
StaticDoor[] exteriorDoors
Boolean forceReposition
Boolean importEnemies
Boolean start
| Improve this Doc View Source

RestorePositionHelper(PlayerPositionData_v1, Boolean, Boolean)

Helper to reposition player to anywhere in world either at load or during player.

Declaration
public void RestorePositionHelper(PlayerPositionData_v1 playerPosition, bool start, bool importEnemies)
Parameters
Type Name Description
PlayerPositionData_v1 playerPosition

Player position data.

Boolean start

Use true if this is a load/start operation, otherwise false.

Boolean importEnemies
| Improve this Doc View Source

ShowHolidayText()

Shows UI message with text for current holiday, if any.

Declaration
public void ShowHolidayText()
| Improve this Doc View Source

StartBuildingInterior(DFLocation, StaticDoor, Boolean)

Starts player inside building with no exterior world.

Declaration
public void StartBuildingInterior(DFLocation location, StaticDoor exteriorDoor, bool start = true)
Parameters
Type Name Description
DFLocation location
StaticDoor exteriorDoor
Boolean start
| Improve this Doc View Source

StartDungeonInterior(DFLocation, Boolean, Boolean)

Starts player inside dungeon with no exterior world.

Declaration
public void StartDungeonInterior(DFLocation location, bool preferEnterMarker = true, bool importEnemies = true)
Parameters
Type Name Description
DFLocation location
Boolean preferEnterMarker
Boolean importEnemies
| Improve this Doc View Source

TransitionDungeonExterior(Boolean)

Player is leaving dungeon, transition them back outside.

Declaration
public void TransitionDungeonExterior(bool doFade = false)
Parameters
Type Name Description
Boolean doFade

Fade HUD after transition if true.

| Improve this Doc View Source

TransitionDungeonExteriorImmediate()

Prepares for leaving dungeon, but do not perform transition logic. Reposition process is up to the caller.

Declaration
public void TransitionDungeonExteriorImmediate()
| Improve this Doc View Source

TransitionDungeonInterior(Transform, StaticDoor, DFLocation, Boolean)

Transition player through a dungeon entrance door into dungeon interior.

Declaration
public void TransitionDungeonInterior(Transform doorOwner, StaticDoor door, DFLocation location, bool doFade = false)
Parameters
Type Name Description
Transform doorOwner

Parent transform owning door array.

StaticDoor door

Exterior door player clicked on.

DFLocation location
Boolean doFade
| Improve this Doc View Source

TransitionExterior(Boolean)

Transition player through an interior door to building exterior. Player must be inside. Interior stores information about exterior, no need for extra params.

Declaration
public void TransitionExterior(bool doFade = false)
Parameters
Type Name Description
Boolean doFade
| Improve this Doc View Source

TransitionInterior(Transform, StaticDoor, Boolean, Boolean)

Transition player through an exterior door into building interior.

Declaration
public void TransitionInterior(Transform doorOwner, StaticDoor door, bool doFade = false, bool start = true)
Parameters
Type Name Description
Transform doorOwner

Parent transform owning door array..

StaticDoor door

Exterior door player clicked on.

Boolean doFade
Boolean start

Events

| Improve this Doc View Source

OnFailedTransition

This event is raised when a transition has started being performed and OnPreTransition was fired but it couldn't be finished correctly due to an unexpected issue (i.e when "thisHouseHasNothingOfValue" is also shown).

Declaration
public static event Action<PlayerEnterExit.TransitionEventArgs> OnFailedTransition
Event Type
Type Description
Action<PlayerEnterExit.TransitionEventArgs>
| Improve this Doc View Source

OnMovePlayerToDungeonStart

Declaration
public static event PlayerEnterExit.OnMovePlayerToDungeonStartEventHandler OnMovePlayerToDungeonStart
Event Type
Type Description
PlayerEnterExit.OnMovePlayerToDungeonStartEventHandler
| Improve this Doc View Source

OnPreTransition

Unlike other events in this class, this one is raised before the transition has been performed. It's always followed by OnFailedTransition or one of the other events for success.

Declaration
public static event PlayerEnterExit.OnPreTransitionEventHandler OnPreTransition
Event Type
Type Description
PlayerEnterExit.OnPreTransitionEventHandler
| Improve this Doc View Source

OnRespawnerComplete

Declaration
public static event PlayerEnterExit.OnRespawnerCompleteEventHandler OnRespawnerComplete
Event Type
Type Description
PlayerEnterExit.OnRespawnerCompleteEventHandler
| Improve this Doc View Source

OnTransitionDungeonExterior

Declaration
public static event PlayerEnterExit.OnTransitionDungeonExteriorEventHandler OnTransitionDungeonExterior
Event Type
Type Description
PlayerEnterExit.OnTransitionDungeonExteriorEventHandler
| Improve this Doc View Source

OnTransitionDungeonInterior

Declaration
public static event PlayerEnterExit.OnTransitionDungeonInteriorEventHandler OnTransitionDungeonInterior
Event Type
Type Description
PlayerEnterExit.OnTransitionDungeonInteriorEventHandler
| Improve this Doc View Source

OnTransitionExterior

Declaration
public static event PlayerEnterExit.OnTransitionExteriorEventHandler OnTransitionExterior
Event Type
Type Description
PlayerEnterExit.OnTransitionExteriorEventHandler
| Improve this Doc View Source

OnTransitionInterior

Declaration
public static event PlayerEnterExit.OnTransitionInteriorEventHandler OnTransitionInterior
Event Type
Type Description
PlayerEnterExit.OnTransitionInteriorEventHandler

Extension Methods

MBExtensions.Invoke(MonoBehaviour, Action, Single)
MBExtensions.Invoke<T>(MonoBehaviour, Action<T>, T, Single)
MBExtensions.Invoke<T1, T2>(MonoBehaviour, Action<T1, T2>, T1, T2, Single)
MBExtensions.Invoke<T1, T2, T3>(MonoBehaviour, Action<T1, T2, T3>, T1, T2, T3, Single)
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX