Show / Hide Table of Contents

Class PlayerGPS

Tracks player position in virtual world space. Provides information about world around the player.

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

Constructors

| Improve this Doc View Source

PlayerGPS()

Declaration
public PlayerGPS()

Fields

| Improve this Doc View Source

WorldX

Declaration
[Range(0F, 32735232F)]
public int WorldX
Field Value
Type Description
Int32
| Improve this Doc View Source

WorldZ

Declaration
[Range(0F, 16351232F)]
public int WorldZ
Field Value
Type Description
Int32

Properties

| Improve this Doc View Source

ClimateSettings

Gets climate properties based on player world position.

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

CurrentClimateIndex

Gets climate index based on player world position.

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

CurrentLocation

Gets location data based on player world position. Location may be empty, check for Loaded=true.

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

CurrentLocationIndex

Gets current location index. Returns -1 when HasCurrentLocation=false

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

CurrentLocationType

Gets current location type. Undefined when HasCurrentLocation=false

Declaration
public DFRegion.LocationTypes CurrentLocationType { get; }
Property Value
Type Description
DFRegion.LocationTypes
| Improve this Doc View Source

CurrentMapID

Gets current location MapID. Returns -1 when HasCurrentLocation=false

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

CurrentMapPixel

Gets current player map pixel.

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

CurrentPoliticIndex

Gets political index based on player world position.

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

CurrentRegion

Gets region data based on player world position.

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

CurrentRegionIndex

Gets region index based on player world position.

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

CurrentRegionName

Gets current region name based on world position.

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

HasCurrentLocation

True if CurrentLocation is valid.

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

IsPlayerInLocationRect

True if player inside actual location rect.

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

LocationRect

Gets current location rect. Contents not valid when HasCurrentLocation=false

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

LocationRevealedByMapItem

The name of the last location revealed by a map item. Used for %map macro.

Declaration
public string LocationRevealedByMapItem { get; set; }
Property Value
Type Description
String

Methods

| Improve this Doc View Source

ClearDiscoveryData()

Clear discovered locations. Intended to be used when loading an old save without discovery data. Otherwise live discovery state from previous session is retained.

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

DiscoverBuilding(Int32, String)

Discover the specified building in current location. Does nothing if player not inside a location or building already discovered.

Declaration
public void DiscoverBuilding(int buildingKey, string overrideName = null)
Parameters
Type Name Description
Int32 buildingKey

Building key of building to be discovered

String overrideName

If provided, ignore previous discovery and override the name

| Improve this Doc View Source

DiscoverLocation(String, String)

Discover location with regionName and locationName.

Declaration
public void DiscoverLocation(string regionName, string locationName)
Parameters
Type Name Description
String regionName
String locationName
| Improve this Doc View Source

DiscoverRandomLocation()

Declaration
public DFLocation DiscoverRandomLocation()
Returns
Type Description
DFLocation
| Improve this Doc View Source

GetAnyBuilding(Int32, out PlayerGPS.DiscoveredBuilding)

Gets discovery information from any building in current location. Does not change discovery state, simply returns data as if building is always discovered.

Declaration
public bool GetAnyBuilding(int buildingKey, out PlayerGPS.DiscoveredBuilding discoveredBuildingOut)
Parameters
Type Name Description
Int32 buildingKey

Building key in current location.

PlayerGPS.DiscoveredBuilding discoveredBuildingOut

Discovered building data.

Returns
Type Description
Boolean

True if successful.

| Improve this Doc View Source

GetCourtOfCurrentRegion()

Gets the factionID of noble court in player's current region

Declaration
public int GetCourtOfCurrentRegion()
Returns
Type Description
Int32
| Improve this Doc View Source

GetCurrentRegionFaction()

Gets the factionID of player's current region.

Declaration
public int GetCurrentRegionFaction()
Returns
Type Description
Int32
| Improve this Doc View Source

GetCurrentRegionVampireClan()

Declaration
public int GetCurrentRegionVampireClan()
Returns
Type Description
Int32
| Improve this Doc View Source

GetDiscoveredBuilding(Int32, out PlayerGPS.DiscoveredBuilding)

Gets discovered building data for current location. Does not change discovery state (NOTE: it kind of does for now with player house override but this will eventually be fixed)

Declaration
public bool GetDiscoveredBuilding(int buildingKey, out PlayerGPS.DiscoveredBuilding discoveredBuildingOut)
Parameters
Type Name Description
Int32 buildingKey

Building key in current location.

PlayerGPS.DiscoveredBuilding discoveredBuildingOut

Building discovery data out.

Returns
Type Description
Boolean

True if building discovered, false if building not discovered.

| Improve this Doc View Source

GetDiscoverySaveData()

Gets discovery dictionary for save.

Declaration
public Dictionary<int, PlayerGPS.DiscoveredLocation> GetDiscoverySaveData()
Returns
Type Description
Dictionary<Int32, PlayerGPS.DiscoveredLocation>
| Improve this Doc View Source

GetEntityFlags(DaggerfallEntityBehaviour)

Declaration
public PlayerGPS.NearbyObjectFlags GetEntityFlags(DaggerfallEntityBehaviour entity)
Parameters
Type Name Description
DaggerfallEntityBehaviour entity
Returns
Type Description
PlayerGPS.NearbyObjectFlags
| Improve this Doc View Source

GetLastLockpickAttempt(Int32)

Gets skill value of last lockpick attempt on this building in current location.

Declaration
public int GetLastLockpickAttempt(int buildingKey)
Parameters
Type Name Description
Int32 buildingKey

Building key in current location.

Returns
Type Description
Int32
| Improve this Doc View Source

GetLootFlags(DaggerfallLoot)

Declaration
public PlayerGPS.NearbyObjectFlags GetLootFlags(DaggerfallLoot loot)
Parameters
Type Name Description
DaggerfallLoot loot
Returns
Type Description
PlayerGPS.NearbyObjectFlags
| Improve this Doc View Source

GetNameBankOfCurrentRegion()

Gets NameHelper.BankType in player's current region. In practice this will always be Redguard/Breton. Supporting other name banks for possible diversity later.

Declaration
public NameHelper.BankTypes GetNameBankOfCurrentRegion()
Returns
Type Description
NameHelper.BankTypes
| Improve this Doc View Source

GetNearbyObjects(PlayerGPS.NearbyObjectFlags, Single)

Gets nearby objects matching flags and within maxRange. Can be used as needed, does not trigger a scene search. This only searches pre-populated list of nearby objects which is updated at low frequency.

Declaration
public List<PlayerGPS.NearbyObject> GetNearbyObjects(PlayerGPS.NearbyObjectFlags flags, float maxRange = 14F)
Parameters
Type Name Description
PlayerGPS.NearbyObjectFlags flags

Flags to search for.

Single maxRange

Max range for search. Not matched to classic range at this time.

Returns
Type Description
List<PlayerGPS.NearbyObject>

NearbyObject list. Can be null or empty.

| Improve this Doc View Source

GetPeopleOfCurrentRegion()

Gets the factionID for "people of region" in player's current region.

Declaration
public int GetPeopleOfCurrentRegion()
Returns
Type Description
Int32
| Improve this Doc View Source

GetRaceOfCurrentRegion()

Gets the dominant race in player's current region.

Declaration
public Races GetRaceOfCurrentRegion()
Returns
Type Description
Races
| Improve this Doc View Source

GetTempleOfCurrentRegion()

Gets the dominant temple in player's current region.

Declaration
public int GetTempleOfCurrentRegion()
Returns
Type Description
Int32
| Improve this Doc View Source

HasDiscoveredBuilding(Int32)

Check if player has discovered building in current location.

Declaration
public bool HasDiscoveredBuilding(int buildingKey)
Parameters
Type Name Description
Int32 buildingKey

Building key to check.

Returns
Type Description
Boolean

True if building discovered.

| Improve this Doc View Source

HasDiscoveredLocation(Int32)

Check if player has discovered location. MapPixelID is derived from longitude/latitude or MapPixelX, MapPixelY. See MapsFile.GetMapPixelID() and MapsFile.GetMapPixelIDFromLongitudeLatitude().

Declaration
public bool HasDiscoveredLocation(int mapPixelID)
Parameters
Type Name Description
Int32 mapPixelID

ID of location pixel.

Returns
Type Description
Boolean

True if already discovered.

| Improve this Doc View Source

IsPlayerInTown(Boolean, Boolean)

Checks if player is inside a location world cell, optionally inside location rect, optionally outside

Declaration
public bool IsPlayerInTown(bool mustBeInLocationRect = false, bool mustBeOutside = false)
Parameters
Type Name Description
Boolean mustBeInLocationRect
Boolean mustBeOutside
Returns
Type Description
Boolean

True if player inside a township

| Improve this Doc View Source

RaiseOnClimateIndexChangedEvent(Int32)

Declaration
protected virtual void RaiseOnClimateIndexChangedEvent(int climateIndex)
Parameters
Type Name Description
Int32 climateIndex
| Improve this Doc View Source

RaiseOnEnterLocationRectEvent(DFLocation)

Declaration
protected virtual void RaiseOnEnterLocationRectEvent(DFLocation location)
Parameters
Type Name Description
DFLocation location
| Improve this Doc View Source

RaiseOnExitLocationRectEvent()

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

RaiseOnMapPixelChangedEvent(DFPosition)

Declaration
protected virtual void RaiseOnMapPixelChangedEvent(DFPosition mapPixel)
Parameters
Type Name Description
DFPosition mapPixel
| Improve this Doc View Source

RaiseOnPoliticIndexChangedEvent(Int32)

Declaration
protected virtual void RaiseOnPoliticIndexChangedEvent(int politicIndex)
Parameters
Type Name Description
Int32 politicIndex
| Improve this Doc View Source

RaiseOnRegionIndexChangedEvent(Int32)

Declaration
protected virtual void RaiseOnRegionIndexChangedEvent(int regionIndex)
Parameters
Type Name Description
Int32 regionIndex
| Improve this Doc View Source

ReadyCheck()

Declaration
public bool ReadyCheck()
Returns
Type Description
Boolean
| Improve this Doc View Source

RestoreDiscoveryData(Dictionary<Int32, PlayerGPS.DiscoveredLocation>)

Restores discovery dictionary for load.

Declaration
public void RestoreDiscoveryData(Dictionary<int, PlayerGPS.DiscoveredLocation> data)
Parameters
Type Name Description
Dictionary<Int32, PlayerGPS.DiscoveredLocation> data
| Improve this Doc View Source

SetLastLockpickAttempt(Int32, Int32)

Sets skill value at time of last lockpicking attempt after failure in current location. Player must increase skill past this value before they can try again.

Declaration
public void SetLastLockpickAttempt(int buildingKey, int skillValue)
Parameters
Type Name Description
Int32 buildingKey

Building key in current location.

Int32 skillValue

Skill value at time attempt failed.

| Improve this Doc View Source

UndiscoverBuilding(Int32, Boolean, String)

Undiscover the specified building in current location. used to undiscover residences when they are a quest resource (named residence) when "add dialog" is done for this quest resource or on quest startup or on quest tombstone otherwise previously discovered residences will automatically show up on the automap when used in a quest

Declaration
public void UndiscoverBuilding(int buildingKey, bool onlyIfResidence = false, string matchName = null)
Parameters
Type Name Description
Int32 buildingKey

Building key of building to be undiscovered

Boolean onlyIfResidence

gets undiscovered only if buildingType is residence

String matchName

use a name for matching (only undiscover if building name matches matchName) - this is used if two quests "occupy" the same residence with different names, and one tries to hide residence on map but other quest's residence name was used and is still running

| Improve this Doc View Source

UpdateWorldInfo()

Force update of world information (climate, politic, etc.) when Update() not running.

Declaration
public void UpdateWorldInfo()

Events

| Improve this Doc View Source

OnClimateIndexChanged

Declaration
public static event PlayerGPS.OnClimateIndexChangedEventHandler OnClimateIndexChanged
Event Type
Type Description
PlayerGPS.OnClimateIndexChangedEventHandler
| Improve this Doc View Source

OnEnterLocationRect

Declaration
public static event PlayerGPS.OnEnterLocationRectEventHandler OnEnterLocationRect
Event Type
Type Description
PlayerGPS.OnEnterLocationRectEventHandler
| Improve this Doc View Source

OnExitLocationRect

Declaration
public static event PlayerGPS.OnExitLocationRectEventHandler OnExitLocationRect
Event Type
Type Description
PlayerGPS.OnExitLocationRectEventHandler
| Improve this Doc View Source

OnMapPixelChanged

Declaration
public static event PlayerGPS.OnMapPixelChangedEventHandler OnMapPixelChanged
Event Type
Type Description
PlayerGPS.OnMapPixelChangedEventHandler
| Improve this Doc View Source

OnPoliticIndexChanged

Declaration
public static event PlayerGPS.OnPoliticIndexChangedEventHandler OnPoliticIndexChanged
Event Type
Type Description
PlayerGPS.OnPoliticIndexChangedEventHandler
| Improve this Doc View Source

OnRegionIndexChanged

Declaration
public static event PlayerGPS.OnRegionIndexChangedEventHandler OnRegionIndexChanged
Event Type
Type Description
PlayerGPS.OnRegionIndexChangedEventHandler

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