Mount Points API

advanced scripting

World Map Strategy Kit · Scripting Support (C#)

Class: WMSK (namespace WorldMapStrategyKit)

Mount Points API

Methods for working with mount points (locations where units and objects can be attached to countries/provinces).

Properties

List<MountPoint> mountPoints

Complete list of mount points. Each MountPoint exposes name, type, countryIndex, provinceIndex, unity2DLocation, uniqueId and attrib.

Main Methods

List<MountPoint> GetMountPoints(int countryIndex)

Returns mount points belonging to a provided country. Public as of version 20.0.5.

List<MountPoint> GetMountPoints(int countryIndex, int provinceIndex)

Returns mount points belonging to a provided country and province. Public as of version 20.0.5.

void MountPointAdd(Vector2 location, string name, int countryIndex, int provinceIndex, int type)

Adds a new mount point at a specific map location.

To remove individual mount points, modify the mountPoints list directly (e.g. mountPoints.RemoveAt(index)). To delete all mount points of a continent, use MountPointsDeleteFromSameContinent below.

Additional Methods

Vector2 GetMountPointPosition(int mountPointIndex)

Returns the position of a mount point

void HideMountPointHighlights()

Clears any mount point highlighted (color changed) and resets them to default city color (used from Editor)

void ToggleMountPointHighlight(int mountPointIndex, Color color, bool highlighted)

Toggles the mount point highlight. Moint point index in the mount points collection. Color. If set to true the color of the mount point will be changed. If set to false the color of the mount point will be reseted to default color

string[] GetMountPointNames()

Returns an array with the mount points names.

string[] GetMountPointNames(int countryIndex)

Returns an array with the mount points names.

string[] GetMountPointNames(int countryIndex, int provinceIndex)

Returns an array with the mount points names.

int GetMountPointIndex(int uniqueId)

Gets the mount point index with that unique Id.

int GetMountPointIndex(int countryIndex, int provinceIndex, string mountPointName)

Returns the index of a mount point in the global mount points collection. Note that country (and optionally province) index can be supplied due to repeated mount point names. Pass -1 to countryIndex or provinceIndex to ignore filters.

bool GetMountPointIndex(Ray ray, out int mountPointIndex)

Returns the mount point index by screen position.

void MountPointsDeleteFromSameContinent(string continentName)

Deletes all mount points of current selected country's continent

List GetMountPoints(AttribPredicate predicate)

Returns a list of mount points whose attributes matches predicate

List GetMountPoints(Region region)

Returns a list of mount points contained in a given region

int GetMountPointNearPoint(Vector2 localPoint)

Returns any mousnep point near the point specified in local coordinates.

int GetMountPointNearPoint(Vector2 localPoint, float separation)

Returns any mount point near the point specified in local coordinates. Distance threshold (minimum should be MOUNT_POINT_HIT_PRECISION constant).

string GetMountPointsGeoData()

Exports the geographic data of mount points in packed string format.

void SetMountPointsGeoData(string s)

Reads the mount points geo data from a packed string.

string GetMountPointsAttributes(bool prettyPrint)

Get attributes of all mount points in jSON format.

string GetMountPointsAttributes(List mountPoints, bool prettyPrint)

Gets attributes of provided mount points in jSON format.

void SetMountPointsAttributes(string jSON)

Sets mount points attributes from a jSON formatted string.

string GetMountPointsDataJSON(bool prettyPrint)

Exports all mount points data (geo and attributes) in jSON format.

void SetMountPointsDataJSON(string s)

Loads mount points data (geo and attributes) from a jSON string

Was this page helpful?