SetMapPinEnabled

From NWN Lexicon
Jump to navigationJump to search



SetMapPinEnabled(object, int)

Enable a map pin.

void SetMapPinEnabled(
    object oMapPin,
    int nEnabled
);

Parameters

oMapPin

Map pin on the displayable map.

nEnabled

TRUE or FALSE.


Description

Enables or disables a map pin on the displayed map.



Remarks

A VERY useful function if you want to add some realism to your modules. Personally, I dislike knowing that "oh, so that's where the bad guy is because that's where the map pin is", even if I don't look at the map pin's caption.

Thus, this can for instance be used OnEnter of a trigger to make a PC get the panel button.


Note that whilst this function enables or disables an existing map pin, for all player characters, you can actually add and remove map pins for individual PCs, by manipulating the variables which NWN uses to set up the pins which players can add to their minimap themselves: NW_TOTAL_MAP_PINS - Int of number of map pins player has placed NW_MAP_PIN_NTRY_# - String of map pin text NW_MAP_PIN_XPOS_# - Float of X coordinate NW_MAP_PIN_YPOS_# - Float of Y coordinate NW_MAP_PIN_AREA_# - Object of area

The minimap however is only updated upon the player entering or re-entering the area in question. See https://nwn.fandom.com/wiki/Map_pin for more information and code examples.


Known Bugs

None. There is no "oPC" parameter to only enable the map pin for a single player instead of all players in a multiplayer environment, but see above (Remarks) about how to add/remove individual map pins for single PCs.


Version

1.61

See Also



 author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Drake Coker