Show / Hide Table of Contents

Class MapsFile

Connects to MAPS.BSA to enumerate locations within a specific region and extract their layouts.

Inheritance
Object
MapsFile
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class MapsFile

Constructors

| Improve this Doc View Source

MapsFile()

Default constructor.

Declaration
public MapsFile()
| Improve this Doc View Source

MapsFile(String, FileUsage, Boolean)

Load constructor.

Declaration
public MapsFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to MAPS.BSA.

FileUsage usage

Determines if the BSA file will read from disk or memory.

Boolean readOnly

File will be read-only if true, read-write if false.

Fields

| Improve this Doc View Source

MaxMapPixelX

Declaration
public const int MaxMapPixelX = 1000
Field Value
Type Description
Int32
| Improve this Doc View Source

MaxMapPixelY

Declaration
public const int MaxMapPixelY = 500
Field Value
Type Description
Int32
| Improve this Doc View Source

MaxWorldCoordX

Declaration
public const int MaxWorldCoordX = 32768000
Field Value
Type Description
Int32
| Improve this Doc View Source

MaxWorldCoordZ

Declaration
public const int MaxWorldCoordZ = 16384000
Field Value
Type Description
Int32
| Improve this Doc View Source

MaxWorldTileCoordX

Declaration
public const int MaxWorldTileCoordX = 128000
Field Value
Type Description
Int32
| Improve this Doc View Source

MaxWorldTileCoordZ

Declaration
public const int MaxWorldTileCoordZ = 64000
Field Value
Type Description
Int32
| Improve this Doc View Source

MinMapPixelX

Declaration
public const int MinMapPixelX = 0
Field Value
Type Description
Int32
| Improve this Doc View Source

MinMapPixelY

Declaration
public const int MinMapPixelY = 0
Field Value
Type Description
Int32
| Improve this Doc View Source

MinWorldCoordX

Declaration
public const int MinWorldCoordX = 0
Field Value
Type Description
Int32
| Improve this Doc View Source

MinWorldCoordZ

Declaration
public const int MinWorldCoordZ = 0
Field Value
Type Description
Int32
| Improve this Doc View Source

MinWorldTileCoordX

Declaration
public const int MinWorldTileCoordX = 0
Field Value
Type Description
Int32
| Improve this Doc View Source

MinWorldTileCoordZ

Declaration
public const int MinWorldTileCoordZ = 0
Field Value
Type Description
Int32
| Improve this Doc View Source

WorldMapRMBDim

Declaration
public const int WorldMapRMBDim = 4096
Field Value
Type Description
Int32
| Improve this Doc View Source

WorldMapTerrainDim

Declaration
public const int WorldMapTerrainDim = 32768
Field Value
Type Description
Int32
| Improve this Doc View Source

WorldMapTileDim

Declaration
public const int WorldMapTileDim = 128
Field Value
Type Description
Int32

Properties

| Improve this Doc View Source

AutoDiscard

If true then decomposed regions will be destroyed every time a different region is fetched. If false then decomposed regions will be maintained until DiscardRegion() or DiscardAllRegions() is called. Turning off auto-discard will speed up region retrieval times at the expense of RAM. For best results, disable auto-discard and impose your own caching scheme using LoadRecord() and DiscardRecord() based on your application needs.

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

BsaFile

Gets raw MAPS.BSA file.

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

ClimateFile

Gets internal climate data.

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

DefaultClimate

Gets default climate index.

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

DefaultClimateSettings

Gets default climate settings.

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

Filename

Gets default MAPS.BSA filename.

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

Ready

True when ready to load regions and locations, otherwise false.

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

RegionCount

Number of regions in MAPS.BSA.

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

RegionNames

Gets all region names as string array.

Declaration
public static string[] RegionNames { get; }
Property Value
Type Description
String[]
| Improve this Doc View Source

RegionRaces

Gets all region races as byte array.

Declaration
public static byte[] RegionRaces { get; }
Property Value
Type Description
Byte[]
| Improve this Doc View Source

RegionTemples

Gets region temple faction IDs.

Declaration
public static int[] RegionTemples { get; }
Property Value
Type Description
Int32[]

Methods

| Improve this Doc View Source

DiscardAllRegions()

Discard all regions.

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

DiscardRegion(Int32)

Discard a region from memory.

Declaration
public void DiscardRegion(int region)
Parameters
Type Name Description
Int32 region

Index of region to discard.

| Improve this Doc View Source

GetClimateIndex(Int32, Int32)

Reads climate index from CLIMATE.PAK based on world pixel.

Declaration
public int GetClimateIndex(int mapPixelX, int mapPixelY)
Parameters
Type Name Description
Int32 mapPixelX

Map pixel X position.

Int32 mapPixelY

Map pixel Y position.

Returns
Type Description
Int32
| Improve this Doc View Source

GetLocation(Int32, Int32)

Gets a DFLocation representation of a location.

Declaration
public DFLocation GetLocation(int region, int location)
Parameters
Type Name Description
Int32 region

Index of region.

Int32 location

Index of location.

Returns
Type Description
DFLocation

DFLocation.

| Improve this Doc View Source

GetLocation(String, String)

Gets DFLocation representation of a location.

Declaration
public DFLocation GetLocation(string regionName, string locationName)
Parameters
Type Name Description
String regionName

Name of region.

String locationName

Name of location.

Returns
Type Description
DFLocation

DFLocation.

| Improve this Doc View Source

GetMapPixelID(Int32, Int32)

Gets ID of map pixel. This can be mapped to location IDs and quest IDs. MapTableData.MapId & 0x000fffff = WorldPixelID.

Declaration
public static int GetMapPixelID(int mapPixelX, int mapPixelY)
Parameters
Type Name Description
Int32 mapPixelX

Map pixel X.

Int32 mapPixelY

Map pixel Y.

Returns
Type Description
Int32

Map pixel ID.

| Improve this Doc View Source

GetMapPixelIDFromLongitudeLatitude(Int32, Int32)

Gets ID of map pixel using latitude and longitude. This can be mapped to location IDs and quest IDs. MapTableData.MapId & 0x000fffff = WorldPixelID.

Declaration
public static int GetMapPixelIDFromLongitudeLatitude(int longitude, int latitude)
Parameters
Type Name Description
Int32 longitude

Longitude position.

Int32 latitude

Latitude position.

Returns
Type Description
Int32

Map pixel ID.

| Improve this Doc View Source

GetPixelFromPixelID(Int32)

Declaration
public static DFPosition GetPixelFromPixelID(int pixelID)
Parameters
Type Name Description
Int32 pixelID
Returns
Type Description
DFPosition
| Improve this Doc View Source

GetPoliticIndex(Int32, Int32)

Reads politic index from POLITIC.PAK based on world pixel.

Declaration
public int GetPoliticIndex(int mapPixelX, int mapPixelY)
Parameters
Type Name Description
Int32 mapPixelX

Map pixel X position.

Int32 mapPixelY

Map pixel Y position.

Returns
Type Description
Int32
| Improve this Doc View Source

GetRegion(Int32)

Gets a DFRegion by index.

Declaration
public DFRegion GetRegion(int region)
Parameters
Type Name Description
Int32 region

Index of region.

Returns
Type Description
DFRegion

DFRegion.

| Improve this Doc View Source

GetRegion(String)

Gets a DFRegion by name.

Declaration
public DFRegion GetRegion(string name)
Parameters
Type Name Description
String name

Name of region.

Returns
Type Description
DFRegion

DFRegion.

| Improve this Doc View Source

GetRegionIndex(String)

Gets index of region with specified name. Does not change the currently loaded region.

Declaration
public int GetRegionIndex(string name)
Parameters
Type Name Description
String name

Name of region.

Returns
Type Description
Int32

Index of found region, or -1 if not found.

| Improve this Doc View Source

GetRegionName(Int32)

Gets the name of specified region. Does not change the currently loaded region.

Declaration
public string GetRegionName(int region)
Parameters
Type Name Description
Int32 region

Index of region.

Returns
Type Description
String

Name of the region.

| Improve this Doc View Source

GetRmbBlockName(in DFLocation, Int32, Int32)

Lookup block name for exterior block from location data provided.

Declaration
public string GetRmbBlockName(in DFLocation dfLocation, int x, int y)
Parameters
Type Name Description
DFLocation dfLocation

DFLocation to read block name.

Int32 x

Block X coordinate.

Int32 y

Block Y coordinate.

Returns
Type Description
String

Block name.

| Improve this Doc View Source

GetWorldClimateSettings(Int32)

Gets settings for specified map climate.

Declaration
public static DFLocation.ClimateSettings GetWorldClimateSettings(int worldClimate)
Parameters
Type Name Description
Int32 worldClimate

Climate value from CLIMATE.PAK. Valid range is 223-232.

Returns
Type Description
DFLocation.ClimateSettings

Climate settings for specified world climate value.

| Improve this Doc View Source

Load(String, FileUsage, Boolean)

Load MAPS.BSA file.

Declaration
public bool Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to MAPS.BSA file.

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

Boolean readOnly

File will be read-only if true, read-write if false.

Returns
Type Description
Boolean

True if successful, otherwise false.

| Improve this Doc View Source

LoadRegion(Int32)

Load a region into memory by index and decompose it for use.

Declaration
public bool LoadRegion(int region)
Parameters
Type Name Description
Int32 region

Index of region to load.

Returns
Type Description
Boolean

True if successful, otherwise false.

| Improve this Doc View Source

LoadRegion(String)

Load a region into memory by name and decompose it for use.

Declaration
public bool LoadRegion(string name)
Parameters
Type Name Description
String name

Name of region.

Returns
Type Description
Boolean

True if successful, otherwise false.

| Improve this Doc View Source

LongitudeLatitudeToMapPixel(Int32, Int32)

Converts longitude and latitude to map pixel coordinates. The world is 1000x500 map pixels.

Declaration
public static DFPosition LongitudeLatitudeToMapPixel(int longitude, int latitude)
Parameters
Type Name Description
Int32 longitude

Longitude position.

Int32 latitude

Latitude position.

Returns
Type Description
DFPosition

Map pixel position.

| Improve this Doc View Source

MapPixelToLongitudeLatitude(Int32, Int32)

Converts map pixel coord to longitude and latitude.

Declaration
public static DFPosition MapPixelToLongitudeLatitude(int mapPixelX, int mapPixelY)
Parameters
Type Name Description
Int32 mapPixelX

Map pixel X.

Int32 mapPixelY

Map pixel Y.

Returns
Type Description
DFPosition
| Improve this Doc View Source

MapPixelToWorldCoord(Int32, Int32)

Converts map pixel to world coord.

Declaration
public static DFPosition MapPixelToWorldCoord(int mapPixelX, int mapPixelY)
Parameters
Type Name Description
Int32 mapPixelX

Map pixel X.

Int32 mapPixelY

Map pixel Y.

Returns
Type Description
DFPosition

World position.

| Improve this Doc View Source

ReadLocationIdFast(Int32, Int32)

Quickly reads the LocationId with minimal overhead. Region must be loaded before calling this method.

Declaration
public int ReadLocationIdFast(int region, int location)
Parameters
Type Name Description
Int32 region

Region index.

Int32 location

Location index.

Returns
Type Description
Int32

LocationId.

| Improve this Doc View Source

ResolveRmbBlockName(in DFLocation, Byte, Byte, Byte)

Resolve block name from raw components.

Declaration
public string ResolveRmbBlockName(in DFLocation dfLocation, byte blockIndex, byte blockNumber, byte blockCharacter)
Parameters
Type Name Description
DFLocation dfLocation

DFLocation to resolve block name.

Byte blockIndex

Block index.

Byte blockNumber

Block number.

Byte blockCharacter

Block character.

Returns
Type Description
String

Block name.

| Improve this Doc View Source

ResolveRmbBlockName(in DFLocation, Int32, Int32)

Resolve block name for exterior block from X, Y coordinates.

Declaration
public string ResolveRmbBlockName(in DFLocation dfLocation, int x, int y)
Parameters
Type Name Description
DFLocation dfLocation

DFLocation to resolve block name.

Int32 x

Block X coordinate.

Int32 y

Block Y coordinate.

Returns
Type Description
String

Block name.

| Improve this Doc View Source

SetClimateIndex(Int32, Int32, MapsFile.Climates)

Sets climate index from CLIMATE.PAK based on world pixel. Allows loaded climate data from Pak file to be modified by mods.

Declaration
public bool SetClimateIndex(int mapPixelX, int mapPixelY, MapsFile.Climates value)
Parameters
Type Name Description
Int32 mapPixelX

Map pixel X position.

Int32 mapPixelY

Map pixel Y position.

MapsFile.Climates value

The climate to set for the specified map pixel.

Returns
Type Description
Boolean

True if climate index was set, false otherwise.

| Improve this Doc View Source

SetPoliticIndex(Int32, Int32, Byte)

Reads politic index from POLITIC.PAK based on world pixel. Allows loaded region data from Pak file to be modified by mods.

Declaration
public bool SetPoliticIndex(int mapPixelX, int mapPixelY, byte value)
Parameters
Type Name Description
Int32 mapPixelX

Map pixel X position.

Int32 mapPixelY

Map pixel Y position.

Byte value

The politic index to set for the specified map pixel.

Returns
Type Description
Boolean

True if politic index was set, false otherwise.

| Improve this Doc View Source

WorldCoordToLongitudeLatitude(Int32, Int32)

Converts world coord back to longitude and latitude.

Declaration
public static DFPosition WorldCoordToLongitudeLatitude(int worldX, int worldZ)
Parameters
Type Name Description
Int32 worldX

World X position in native Daggerfall units.

Int32 worldZ

World Z position in native Daggerfall units.

Returns
Type Description
DFPosition

Longitude and latitude.

| Improve this Doc View Source

WorldCoordToMapPixel(Int32, Int32)

Converts world coord to nearest map pixel.

Declaration
public static DFPosition WorldCoordToMapPixel(int worldX, int worldZ)
Parameters
Type Name Description
Int32 worldX

World X position in native Daggerfall units.

Int32 worldZ

World Z position in native Daggerfall units.

Returns
Type Description
DFPosition

Map pixel position.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX