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).

List<Vector2> GetCountryMountPoints(int countryIndex)

Returns all mount points within a country's territory.

List<Vector2> GetProvinceMountPoints(int provinceIndex)

Returns all mount points within a province's territory.

void AddMountPoint(Vector2 position, int countryIndex, int provinceIndex = -1)

Adds a new mount point at a specific location.

void RemoveMountPoint(Vector2 position)

Removes a mount point at the specified location.

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

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

MountPointAdd method.

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?