Skip to content

Class: CMapLocation

A single PDA/minimap spot attached to an object or user position.

Source

C++ class CMapLocation

Custom Constructor

CMapLocation

Remarks

Map locations are created by the engine or map manager. The native binding does not expose a script constructor. A location can also expire or be removed by object lifetime, TTL, or task cleanup.

Constructors

Constructor

ts
protected new CMapLocation(): CMapLocation;

Engine-created map location.

Returns

CMapLocation

Methods

Collidable()

ts
Collidable(): boolean;

Returns

boolean

Whether the map spot participates in UI collision.


DisablePointer()

ts
DisablePointer(): void;

Hide the off-screen pointer arrow.

Returns

void


DisableSpot()

ts
DisableSpot(): void;

Hide the map spot.

Returns

void


EnablePointer()

ts
EnablePointer(): void;

Show the off-screen pointer arrow.

Returns

void


EnableSpot()

ts
EnableSpot(): void;

Show the map spot.

Returns

void


GetHint()

ts
GetHint(): Nullable<string>;

Returns

Nullable<string>

Hint text shown for the spot.

Remarks

Returns null when hints are disabled for this spot.


GetLastPosition()

ts
GetLastPosition(): vector2;

Returns

vector2

Last calculated spot position.

Remarks

This is a cached value updated by the map manager.


GetLevelName()

ts
GetLevelName(): string;

Returns

string

Level name where the spot is located.

Remarks

This is a cached value updated by the map manager.


GetPosition()

ts
GetPosition(): vector2;

Returns

vector2

Current spot position on the map.

Remarks

This is a cached value updated by the map manager.


HighlightSpot()

ts
HighlightSpot(state: boolean, color: fcolor): void;

Highlight or clear the spot highlight.

Parameters

ParameterTypeDescription
statebooleanWhether highlighting is enabled.
colorfcolorHighlight color.

Returns

void

Remarks

Requires a location type with a level-map spot. Types that only define minimap or complex-map visuals are not good candidates for this helper.


HintEnabled()

ts
HintEnabled(): boolean;

Returns

boolean

Whether a hint can be shown for the spot.


IsUserDefined()

ts
IsUserDefined(): boolean;

Returns

boolean

Whether this is a user-created spot.


ObjectID()

ts
ObjectID(): number;

Returns

number

Object id this spot tracks.


PointerEnabled()

ts
PointerEnabled(): boolean;

Returns

boolean

Whether the off-screen pointer arrow is enabled.

Remarks

Pointer state also depends on SpotEnabled(). A disabled spot reports its pointer as disabled.


SetHint()

ts
SetHint(hint: string): void;

Set hint text shown for the spot.

Parameters

ParameterTypeDescription
hintstringHint text or string table id.

Returns

void

Remarks

Passing disable_hint disables hints and clears the stored hint.


SetUserDefinedFlag()

ts
SetUserDefinedFlag(state: boolean): void;

Mark the spot as user-created or engine-owned.

Parameters

ParameterTypeDescription
statebooleanUser-defined flag.

Returns

void


SpotEnabled()

ts
SpotEnabled(): boolean;

Returns

boolean

Whether the map spot is enabled.

Remarks

Disabling a spot also makes PointerEnabled() return false.


SpotSize()

ts
SpotSize(): vector2;

Returns

vector2

Spot size on the map.

Remarks

Reads the level-map spot size. Use only for location types that define a level-map spot in map_spots.xml.