Class PlayerGPS
Tracks player position in virtual world space.
Provides information about world around the player.
Assembly: Assembly-CSharp.dll
Syntax
public class PlayerGPS : MonoBehaviour
Constructors
|
Improve this Doc
View Source
PlayerGPS()
Declaration
Fields
|
Improve this Doc
View Source
WorldX
Declaration
[Range(0F, 32735232F)]
public int WorldX
Field Value
|
Improve this Doc
View Source
WorldZ
Declaration
[Range(0F, 16351232F)]
public int WorldZ
Field Value
Properties
|
Improve this Doc
View Source
ClimateSettings
Gets climate properties based on player world position.
Declaration
public DFLocation.ClimateSettings ClimateSettings { get; }
Property Value
|
Improve this Doc
View Source
CurrentClimateIndex
Gets climate index based on player world position.
Declaration
public int CurrentClimateIndex { get; }
Property Value
|
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
|
Improve this Doc
View Source
CurrentLocationIndex
Gets current location index.
Returns -1 when HasCurrentLocation=false
Declaration
public int CurrentLocationIndex { get; }
Property Value
|
Improve this Doc
View Source
CurrentLocationType
Gets current location type.
Undefined when HasCurrentLocation=false
Declaration
public DFRegion.LocationTypes CurrentLocationType { get; }
Property Value
|
Improve this Doc
View Source
CurrentMapID
Gets current location MapID.
Returns -1 when HasCurrentLocation=false
Declaration
public int CurrentMapID { get; }
Property Value
|
Improve this Doc
View Source
CurrentMapPixel
Gets current player map pixel.
Declaration
public DFPosition CurrentMapPixel { get; }
Property Value
|
Improve this Doc
View Source
CurrentPoliticIndex
Gets political index based on player world position.
Declaration
public int CurrentPoliticIndex { get; }
Property Value
|
Improve this Doc
View Source
CurrentRegion
Gets region data based on player world position.
Declaration
public DFRegion CurrentRegion { get; }
Property Value
|
Improve this Doc
View Source
CurrentRegionIndex
Gets region index based on player world position.
Declaration
public int CurrentRegionIndex { get; }
Property Value
|
Improve this Doc
View Source
CurrentRegionName
Gets current region name based on world position.
Declaration
public string CurrentRegionName { get; }
Property Value
|
Improve this Doc
View Source
HasCurrentLocation
True if CurrentLocation is valid.
Declaration
public bool HasCurrentLocation { get; }
Property Value
|
Improve this Doc
View Source
IsPlayerInLocationRect
True if player inside actual location rect.
Declaration
public bool IsPlayerInLocationRect { get; }
Property Value
|
Improve this Doc
View Source
LocationRect
Gets current location rect.
Contents not valid when HasCurrentLocation=false
Declaration
public RectOffset LocationRect { get; }
Property Value
|
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
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
|
Improve this Doc
View Source
DiscoverRandomLocation()
Declaration
public DFLocation DiscoverRandomLocation()
Returns
|
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
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
|
Improve this Doc
View Source
GetCurrentRegionFaction()
Gets the factionID of player's current region.
Declaration
public int GetCurrentRegionFaction()
Returns
|
Improve this Doc
View Source
GetCurrentRegionVampireClan()
Declaration
public int GetCurrentRegionVampireClan()
Returns
|
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
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
|
Improve this Doc
View Source
GetEntityFlags(DaggerfallEntityBehaviour)
Declaration
public PlayerGPS.NearbyObjectFlags GetEntityFlags(DaggerfallEntityBehaviour entity)
Parameters
Returns
|
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
|
Improve this Doc
View Source
GetLootFlags(DaggerfallLoot)
Declaration
public PlayerGPS.NearbyObjectFlags GetLootFlags(DaggerfallLoot loot)
Parameters
Returns
|
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
|
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
Returns
|
Improve this Doc
View Source
GetPeopleOfCurrentRegion()
Gets the factionID for "people of region" in player's current region.
Declaration
public int GetPeopleOfCurrentRegion()
Returns
|
Improve this Doc
View Source
GetRaceOfCurrentRegion()
Gets the dominant race in player's current region.
Declaration
public Races GetRaceOfCurrentRegion()
Returns
|
Improve this Doc
View Source
GetTempleOfCurrentRegion()
Gets the dominant temple in player's current region.
Declaration
public int GetTempleOfCurrentRegion()
Returns
|
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
|
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
|
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
Returns
|
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
|
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
|
Improve this Doc
View Source
OnEnterLocationRect
Declaration
public static event PlayerGPS.OnEnterLocationRectEventHandler OnEnterLocationRect
Event Type
|
Improve this Doc
View Source
OnExitLocationRect
Declaration
public static event PlayerGPS.OnExitLocationRectEventHandler OnExitLocationRect
Event Type
|
Improve this Doc
View Source
OnMapPixelChanged
Declaration
public static event PlayerGPS.OnMapPixelChangedEventHandler OnMapPixelChanged
Event Type
|
Improve this Doc
View Source
OnPoliticIndexChanged
Declaration
public static event PlayerGPS.OnPoliticIndexChangedEventHandler OnPoliticIndexChanged
Event Type
|
Improve this Doc
View Source
OnRegionIndexChanged
Declaration
public static event PlayerGPS.OnRegionIndexChangedEventHandler OnRegionIndexChanged
Event Type
Extension Methods
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)