Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Need Help with a Macro calling Attributes

1490325170

Edited 1490325301
Mike W.
Pro
Sheet Author
I am not sure this can be done or not. Need help with a Macro I am creating a Report Macro for me as the GM. I click the report Macro (on my Macro bar), it brings up a menu of macro choices in chat, then I click the button to execute that macro. OK that part I can do. Each Macro has a specific function, report all Hit Points of the PCs or report the wealth of all PCs. The thing is I do not want to have to type all of the PCs name for each and every Macro as there would be about 20 of them and when players enter or leave the game I have spend a good deal of time adding or deleting their character name. I know you cannot assign a variable a value directly unless you use a query, I do not want that. I want to make a list of all the character names and have each Macro reference that. I thought of making a GM character sheet and assigning Abilities of Name=PC1 and Current=Character Name #1, Name=PC2 and Current=Character Name #2, ect. Then reference those Attributes for each Macro. Thus only having to keep the list current on the GM sheet. By the way I am doing this for Pathfinder but want to use it is other systems as well. As a test Macro, for the results, this is what I have for roll template: @{PC-whisper} &{template:pf_generic} @{toggle_rounded_flag} {{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{name=Report of all HP}} {{character_name=@{GM|character_name}}} {{character_id=@{GM|character_id}}} {{subtitle=subtitle}} {{Character=**Current \ Max**}} {{@{PC1}=**@{PC1|HP}  @{PC1|HP|max}**}} {{@{PC2}=**@{PC2|HP} @{PC2|HP|max}**}} {{@{PC3}=**@{PC3|HP} @{PC3|HP|max}**}} The problem is the @{PC1|... So the issue is I cannot get the values from each character sheet without actually replacing @{PC1|...}, @{PC2...}, and @{PC3...} with the actual character's names. I hope i am making myself clear. Sometimes it is difficult to explain in writing what I see in my head (besides the whole or two that I have). Any help here would be appreciated.
1490332266
Andrew C
Marketplace Creator
Quote marks around them. @{"@{PC1}"|hp} etc
1490342928

Edited 1490343047
Mike W.
Pro
Sheet Author
I am afraid that did not do it. Now I am getting these errors: No attribute was found for @{GM|"@{}C1}...etc BTW: GM is the name of the Character Sheet I am running the Macro from. And the results of;
You need to reference the character GM and then look for the attributes so @{GM|@{PC}1|HP} and @{GM|@{PC}1|HP|max} I am not %100 sure nesting attributes will work, but give it a try.
1490364252
Ziechael
Forum Champion
Sheet Author
API Scripter
You can  do this with a bit of cheeky attribute management, set up the attributes in your GM sheet with the values of @{<character name>| and then you can run macros that reference [[@{GM Sheet|PC1}HP}]] to get your info (sorry for the muddled picture but hopefully helps plot the macro):
1490365577
Tetsuo
Forum Champion
Ziechael said: You can  do this with a bit of cheeky attribute management, set up the attributes in your GM sheet with the values of @{<character name>| and then you can run macros that reference [[@{GM Sheet|PC1}HP}]] to get your info (sorry for the muddled picture but hopefully helps plot the macro): Thats a clever trick. I spent about 30 minutes trying to figure something out and couldn't
1490366501
Ziechael
Forum Champion
Sheet Author
API Scripter
100% sure I stole  borrowed it from a previous Silvyre post but couldn't find his expert explanation to quote lol.
1490366548

Edited 1490367181
Mike W.
Pro
Sheet Author
Ed, sorry your idea did not work. Ziechael , yours worked. Time to do some testing . Thank you so much both of you!!!!!!!!!!!!!! Mike
1490366729
Ziechael
Forum Champion
Sheet Author
API Scripter
Please provide screen shots of the attributes as used in the GM sheet as well as the character names as seen in the journal tab plus the macro you are using to call the attributes (even if it is the same as the one in the OP just to keep it all in one place for the next phase of problem solving).
1490367243

Edited 1490367331
Ziechael
Forum Champion
Sheet Author
API Scripter
It works for me... odd [edit] just seen you've got it working :) Happy rolling!
1490367762
Mike W.
Pro
Sheet Author
Here are the results with it working; With your fix, the issue was the change from PC1 to @{PC1| in the Current field on the GM sheet. I needed to add just the plane name in the Max field and use that as well. The Macro: /w GM &{template:pf_generic} @{GM|toggle_rounded_flag} {{color=@{GM|rolltemplate_color}}} {{header_image=@{GM|header_image-pf_block}}} {{name=Report of all Hit Points}} {{character_name=@{GM|character_name}}} {{character_id=@{GM|character_id}}} {{subtitle=For all characters}} {{Character=**Current \ Max**}} {{@{ GM|PC1|max }=**@{ GM|PC1}HP }   @{ GM|PC1}HP|max }**}} {{@{GM|PC2|max}=**@{GM|PC2}HP}   @{GM|PC2}HP|max}**}} {{@{GM|PC3|max}=**@{GM|PC3}HP}   @{GM|PC3}HP|max}**}} Wow this was certainly a hard one for me - thank you guys again for all of your help! Mike
1490368296
Ziechael
Forum Champion
Sheet Author
API Scripter
I struggled with the name and came to the same solution... then realised that you could just do @{ GM|PC1}character_name } so that you only have the one attribute field to keep up to date ;)
Ziechael said: I struggled with the name and came to the same solution... then realised that you could just do @{ GM|PC1}character_name } so that you only have the one attribute field to keep up to date ;) In addition to this, you could create an attribute called prefix with the value "@{" and then call the prefix in the value of the PCX attribute. For example PC1 in this case would have the current value set to "@{prefix}@{GM|PC1|max}|" and the max value of "Mel". Then when you call @{GM|PC1} it will print out "@{Me|" as expected and you only have to maintain the character's name in the maximum value. Attribute name Current Max (optional) prefix @{ PC1 @{prefix}@{GM|PC1|max} Mel PC2 @{prefix}@{GM|PC2|max} Mel's Horse PC3 @{prefix}@{GM|PC3|max} Taka