melek / lib_elevation

A flexible elevation library for creating vertical encounter maps in MapTool.
4 stars 0 forks source link

User Guide: Map Data Token: Describe what exactly causes this token to be added to the map. #2

Closed adventuremagic123 closed 3 years ago

adventuremagic123 commented 3 years ago

The "User Guide" macro says "a 'Map Elevation Data' token will be automatically created ...".

For clarity, I suggest being more specific. I've found that (and I think your video said) it is created the first time we use "Add Elev".

adventuremagic123 commented 3 years ago

This might have been part of the problem with my test campaign. I manually added my own "Map Data Token".

adventuremagic123 commented 3 years ago

Ah, actually, it appears something event driven is going on where lib:elevation detects the token is not yet on the map and creates it without any user interaction. How did I discover that? I deleted "Map Data Token". :)

melek commented 3 years ago

That is correct; you never have to view or create the Map Elevation Data token. When you load a map:

  1. The first time onChangeSelection is triggered, the overlay reloads. If the overlay isn't active, the first time you use an Elevation GM macro (or any macro that requires elevation data) is also sufficient.
  2. When the overlay reloads/map elevation data is needed, it tries to access the Map Elevation Data token.
  3. If the Map Elevation Data token does not exist, it is automatically created waaaaaay out of the visible map area with initial (blank) properties.
  4. Map Elevation Data tokens store the version of Lib:Elevation that initially created it.

Without detailing this process exactly, I've updated the guide to be more explicit that the user never has to create this token, and it is created as soon as it is needed automatically.

Additionally, it appears this token is created on the 'Background' layer in 1.0a6. I've updated it to be created on the 'Hidden' layer. :)