Page 2 of 2

Re: Nested tables

Posted: Sun Aug 06, 2017 1:36 pm
by monstro44122
Worked!

Here's some things I saw. Note, this might be because I don't code generally, but here they are:
1. In the end, the macro had to call the table. If I double clicked on the table, it spit out the macro as text. So, I don't think this could have been solved entirely inside of a table (unless the top table evalmacro'd the evalmacro).
2. I had to move the calling macro off of a token because it didn't have permission to access evalmacro. I thought that was weird (given that it was the token calling it's own macro, but hey...what do I know). I moved the macro over to global and it worked. For my purposes, it really didn't matter.
3.... and this is more of a style point. Because I'm not a programmer, I use the wiki religiously. It's a bit weird when the Table wiki doesn't mention that you can put macros inside of table results, that the wiki takes you over to evalmacro, and that the evalmacro page doesn't have an example that uses the table. I can use the examples to code, but if I don't see any relevant examples, I have to jump on the forums. Probably not a big deal as there aren't a lot of forums on this problem. This might not be an overly common experience.
4. Point 3 withstanding, the forums are ridiculously helpful and I just want to say thanks a lot to Aliasmask. I couldn't have fixed it without help.

Re: Nested tables

Posted: Sun Aug 06, 2017 1:57 pm
by aliasmask
Yes, double clicking will not work because you want to evaluate the string.

You can put a macro on the token but it will need to call another macro from a lib token to give it permission. There are certain protected functions that need this. That is why it's good to put all your code on a lib token and then put calls to those macros other places like the campaign window or a player token.

The "code" is just a string like any other string. It's the evalMacro that interprets it as something else.