It's been over five years since I first set up these macros, so I've been going back through them.
I've traced through everything, and I cannot figure out where I should add a call to disambiguate the current token.
The campaign macro "Show Statblock" is pretty simple, and it calls on a couple of library macros to do the heavy lifting. I've double checked all of these and each macro below has "Apply to Selected Tokens" checked on the Details tab.
Code: Select all
[h: assert(isGM(),"This macro is for GM use only.",0)]
[h, macro("openStatblock@Lib:jctStatblock"):1]
openStatblock@Lib is as follows:
Code: Select all
[h: link = macroLinkText("openStatblock@Lib:jctStatblock", "none")]
[frame("Statblock"): {
<html>
<head>
<link rel="onChangeSelection" type="macro" href="[r:link]">
</head>
<body>
[r, macro("statblock@Lib:jctStatblock"): getSelected(id)]
</body>
</html>
}]
Finally, statblock@Lib is this:
Code: Select all
[h: id = macro.args]
[r, if(listCount(id)!=1), code: {};{
[h: switchToken(id)]
[h: statblock = getGMNotes()]
[r: statblock]
}]
For statblocks fully written in HTML in the GM notes, or for the simple HTML that calls on a locally stored image file, the contents of the Statblock frame that is created changes automatically whenever a new token is selected. It is just a problem when the HTML tries to reference the Handout using the getTokenHandout macro function.
If I can only get it to work by referencing locally stored images that is not the end of the world - it would just be way easier to keep the tokens self-contained and have a piece of HTML code that can always be inserted to the GM Notes when an image is being used.