I've just installed version .b91, and it's changed how my attack macro works with respect to selecting a target. Specifically, in version .b89, it only included tokens that were located on the Token layer, but not those in the Hidden, Object, or Background layer. Now, in .b91, it includes all the tokens from all the layers. So every token I've added for furniture is now on the list.. worse, so are the maps in the background. It makes the list unwieldy. I'd like to have it as it was before, so I'm requesting assistance in improving my coding for this.
Please note, I have very limited coding knowledge. Everything I have, I've copied/pasted from elsewhere until something worked... so please have patience if I come back with more questions.
Here's what I have now (the relevant parts, as far as I can tell):
[h: lsVisibleTarget = json.sort(getExposedTokenNames("json"),"a") ]
[h: assert(json.length(lsVisibleTarget), "No visible target", 0)]
and
[h: ok = input(
"junk | <html><b><u>Attacking with "+Attack.Description+"</u></b><br></html> | Attacking with | LABEL | SPAN=true",
"junk | <html><br><u>Target Information and Situation</u><br></html> | Target Information | LABEL | SPAN=true",
"Target.Name |"+json.toList(lsVisibleTarget)+"| Target | LIST",
...<snipped rest as I don't think it's relevant>
) ]
[h: abort (ok) ]};
{}]
Also, another strange issue. Typically (from my use in v .b89) a token doesn't appear on the list until the players have spotted it. So anything behind a vision blocking wall is off the list until the player moves around the corner. Once spotted, it remains on the list even if it later goes behind such a wall. I'm fine with that. Since I put in version .91, for some reason, some tokens that haven't been spotted that are behind walls appear on the list, but others do not. It appears to be limited by range (only the close ones appear), but even then there's a mix of what is spotted or not. Is this a bug?
Thanks in advance
Kallatari
Making a list of visible Tokens - change for new version
Moderators: dorpond, trevor, Azhrei
Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
Re: Making a list of visible Tokens - change for new version
here you go:
as for the other issue. You do realise that there are two similar but distinct functions? :
Wiki: getExposedTokenNames()
Wiki: getVisibleTokenNames()
Code: Select all
<!-- get all tokens from the token layer and store in json array -->
[h:allToks = getTokenNames("json",'{layer:["TOKEN"]}')]
<!-- get all exposed tokens from map -->
[h:allExp = getExposedTokenNames("json")]
<!-- get the intersection of all token layer tokens and all the exposed tokens -->
[h:tokExp = json.intersection(allToks, allExp)]
Wiki: getExposedTokenNames()
Wiki: getVisibleTokenNames()
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Making a list of visible Tokens - change for new version
That seems to have worked. Thank you.