Scripting Overview

advanced scripting

World Map Strategy Kit · Scripting Support (C#)

Class: All members on this page belong to the WMSK component (namespace WorldMapStrategyKit). Access via WMSK.instance.
Tip: Check the demo scenes included with the asset for practical examples covering countries, provinces, cities, cells, pathfinding, units, and fog of war.

Getting Started

Add using WorldMapStrategyKit; at the top of your script. Access the map singleton with:

using WorldMapStrategyKit;

WMSK map = WMSK.instance;

Data Structures

Country

Country data. Key fields: name, continent, center (Vector2), regions (List<Region>), mainRegion (Region), provinces (Province[]), neighbours (List<Country>), hidden, customLabel, labelColor, labelFontOverride, labelOffset, attrib (JSONObject), uniqueId.

Province

Province / state data. Key fields: name, countryIndex, center, regions (List<Region>), mainRegion (Region), neighbours (List<Province>), hidden, attrib (JSONObject), uniqueId.

City

City data. Key fields: name, province, countryIndex, unity2DLocation (Vector2 on map), latitude and longitude (computed from unity2DLocation), population, cityClass (City / Region Capital / Country Capital), attrib (JSONObject), uniqueId.

Region

Polygonal boundary shared by Country and Province. Key fields: entity (parent Country or Province, IExtendableAttribute), regionIndex, points (Vector2[] in map coordinates), center, centroid, rect2D and rect2DArea (axis-aligned bounding box and its area), neighbours (HashSet<Region>), customSurface / customMaterial for per-region surface effects.

Cell

Hex / square grid cell. Key fields: index, row, column, center (Vector2), centroid, tag, canCross, visible, group, attrib (JSONObject), borderSegments (Vector2 pairs), region (parent Region when assigned via the territory editor).

MountPoint

Named anchor point on the map (capitals, ports, custom landmarks). Key fields: name, type, unity2DLocation, countryIndex, provinceIndex, attrib (JSONObject), uniqueId.

API Reference Sections

The WMSK API is organized into the following sections:

Was this page helpful?