Map Control API

Paths shown by _NPCScan.Overlay can be controlled by other mods, such as rare mob scanners, using a generic message API. Any mod can use this API to show or hide specific mobs' paths from all maps, and to announce that specific mobs have been found at the player's position. The API is left fairly generic to allow new Overlay-type mods and new rare scanner mods to implement it without needing to know of each others' existence.

AceEvent-3.0 Messages

"NpcOverlay_RegisterScanner", AddOn

Before another mod can control the visibility of the overlay's paths, it must register itself. Once registered, NpcOverlay_Add and NpcOverlay_Remove messages with the same AddOn identifier will be obeyed. Before any mods have registered, the overlay manages which paths are shown on its own—probably leaving all visible. The AddOn identifier can be any unique logically-true value.

In _NPCScan.Overlay's implementation, the first mod to register gains exclusive control of mob path visibility.


"NpcOverlay_Add", NpcID, AddOn

Shows a mob's path, if available. NpcID must be a numeric creature ID, and AddOn must be the same unique identifier used by the mod in its "NpcOverlay_RegisterScanner" message.


"NpcOverlay_Remove", NpcID, AddOn

Removes a mob's path if it has already been shown. NpcID must be a numeric creature ID, and AddOn must be the same unique identifier used by the mod in its "NpcOverlay_RegisterScanner" message.


"NpcOverlay_Found", NpcID[, MapID, X, Y ]

Lets the overlay mod know that NpcID was found at the specified position or at the player. The overlay mod may then indicate this found position on the map. NpcID must be a numeric creature ID, and creatures without path data available may be ignored. If numeric map ID MapID is passed along with numeric X and Y coordinates, the overlay may place its found marker there instead of at the player.

In _NPCScan.Overlay's implementation, found messages are accepted from all sources, whether registered or not.


Comments

Posts Quoted:
Reply
Clear All Quotes