Ok... What I am trying to establish is how you would get from either 2d4 or 1d8 (either 7 or 8 potential outcomes) to which of the 92 individual tokens you would want to manipulate. It seems obvious that there has to be another "bit" of information ... which maybe you are currently handling intuitively (ie, "the closest cross formation to the token"). That's what I meant by the "mechanic" you're working with... what is it that tells you, from the 92 component pieces of the various crosses, you are working with these 8 (this cross) against which to evaluate your roll?
If your roll could be *ANY* of the crosses... ie, you roll and you could be altering ANY component of ANY cross... and if each cross were made up of 8 component parts... you could name each token. The eight component tokens of the first cross formation would be:
- Cross1_1
- Cross1_2
- Cross1_3
- Cross1_4
- Cross1_5
- Cross1_6
- Cross1_7
- Cross1_8
You'd have 23 groups like this, you say (Cross1, Cross2, etc.).
To arrive at *ANY* of these individual tokens, you can roll 1d23 and 1d8, and use ZeroFrame to extract the roll value INTO the name:
Cross[[1d23]].value_[[1d8]].value
That will give you the name of just ONE of your tokens. Then you use that inside a SelectManager formation to virtually select the token:
{&select Cross[[1d23]].value_[[1d8]].value }
Finally, you pop that into a TokenMod command line designed to move selected tokens to the GM layer:
!token-mod --set layer|gmlayer {&select Cross[[1d23]].value_[[1d8]].value }
Great. Except we also want to be able to toggle it back and forth between the gmlayer layer and the objects layer. Well, we can read the layer of the token using Fetch:
@(selected.layer)
And we can use that in an APILogic conditional to return the opposite layer:
{&if @(selected.layer) = objects}gmlayer{&else}objects{&end}
Final Version
Then we just put that in the same TokenMod command line, and we have a veritable toggle macro for any of your 92 parts:
!token-mod --set layer|{&if @(selected.layer) = objects}gmlayer{&else}objects{&end} {&select Cross[[1d23]].value_[[1d8]].value }
Again, this assumes that your roll could affect ANY of the 92 wall pieces on the board (and that they're tokens). If that isn't the case and there is a more finite set of walls which could activate on any 1d8 check... I have to ask again: what is the game mechanic that lets you narrow the set and to tie your 1d8 to particular walls in the set of 92?
REQUIRED SCRIPTS:
TokenMod, ZeroFrame, APILogic, Fetch, SelectManager