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

[Pathfinder] Drop-Down Query for Attacks/Skills

I'm wanting to eliminate the need to go into the character sheet as much as I can, and I know that skills are one of the biggest causes for this. I've already made custom macros for the saves and things like that by modifying one of the templates found in the settings section of the character sheet. Nice and neat. If possible, I'd also like to make a drop-down for attacks too. I know that the Token Action Bar can get pretty bogged up with stuff, so that's the reason for that. And for the queries, I've already tried doing the HTML replacement stuff, but it doesn't really want to work. So, I'm a little stumped on this. If it's possible without APIs, that'd be awesome. The secondary goal of this is to help other free users with making their games flow a little better and look nice as well, if they're also like me and want to do the best they can with what they have. If you read this, thanks for taking the time out to read this. If you supply some advice or we can collaborate on this, thanks a bunch. It can be a challenge being a free user, but that's all the more fun for me.
Which Character Sheet are you using? It also wouldn't hurt if you posted up your attempt, preferably taking some care to ensure the forum doesn't convert the HTML entities (e.g by breaking up the entities with a space; } → & #125;). I would tackle this by: Locating the template for the attack macro in the HTML source code on GitHub . Make HTML entities replacements to it. Duplicate it a few times within a Roll Query. Replace the Attributes as appropriate.
@& #123;selected& #124 ;PC-whisper& #125; && #123;template:pf_attack& #125; & #123;& #123;color=@& #123;selected& #124;rolltemplate_color& #125;& #125;& #125; & #123;& #123;header_image=@& #123;selected& #124;header_image-pf_attack-melee& #125; @& #123;selected& #124;header_image-pf_attack-ranged& #125; @& #123;selected& #124;header_image-pf_attack-cmb& #125;& #125;& #125; & #123;& #123;character_name=@& #123;selected& #124;character_name& #125;& #125;& #125; & #123;& #123;character_id=@& #123;selected& #124;character_id& #125;& #125;& #125; & #123;& #123;subtitle& #125;& #125; & #123;& #123;name=name of roll& #125;& #125; & #123;& #123;name_link=<a href="http://www.url.com&" rel="nofollow">www.url.com&</a> #125;& #125; & #123;& #123;subtitle= @& #123;selected& #124;repeating_weapon_$0_attack-type& #125;& #125;& #125; & #123;& #123;attack=[[1d20cs&gt;10]]& #125;& #125; & #123;& #123;crit_confirm=[[1d20]]& #125;& #125; & #123;& #123;damage=[[1d6]]& #125;& #125; & #123;& #123;crit_damage=[[1d6]]& #125;& #125; & #123;& #123;attack(2-8)& #125;& #125; & #123;& #123;crit_confirm(2-8)& #125;& #125; & #123;& #123;damage(2-8)& #125;& #125; & #123;& #123;crit_damage(2-8)& #125;& #125; & #123;& #123;melee_notes=melee notes& #125;& #125; & #123;& #123;ranged_notes=ranged notes& #125;& #125; & #123;& #123;CMB_notes=cmb notes& #125;& #125; & #123;& #123;attack_notes=attack notes& #125;& #125; & #123;& #123;=just some text& #125;& #125; & #123;& #123;description=descriptive text will span both columns and wrap as needed.& #125;& #125; & #123;& #123;weapon name = @& #123;selected& #124;repeating_weapon_$0_name& #125;& #125;& #125; So I discovered that one of the key issues is when you mess around with the "&{template:pf_attack}" it fails to utilize the template, even if you correctly replace everything that needs to be replaced.&nbsp; Above is result. Below is the input. The issue is coming from when I test the macro before even putting it into a Query. I know there's no point in going onto the query if the macro isn't even working.
qwerty4132 said: The issue is coming from when I test the macro before even putting it into a Query. Macros with HTML entities are very unlikely to work outside of a Roll Query, as the HTML entities "break" them. qwerty4132 said: @& #123;selected& #124 ;PC-whisper& #125; Calls, including Attribute calls, should not be subject to character replacements under most circumstances. For more on this, check out Advanced Usage for Roll Queries .
So I tried putting it into the query with the HTML changes, and I got the below result.
I notice that the Attribute calls still need to be fixed.
Okay. I'm starting to figure out how to go about this. I'll keep updating with results from time to time, and will make my macro public if/when it's complete so that others may use if, if they feel like it.
1463515008

Edited 1463557016
Alright, cool. For future reference, here's some followup to how I'd tackle this with the help of Advanced Usage for Roll Queries and Roll Query Troubleshooting : I found the macro text for the repeating weapons attacks on line 2430 of the PF sheet's v5x Beta html : &{template:pf_attack} @{toggle_accessible_flag} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}} {{attack=[[ 1d20cs&gt;[[ @{crit-target} ]] + [[ @{total-attack} ]] ]]}} {{damage=[[ @{damage-dice-num}d@{damage-die} + [[ @{total-damage} ]] ]]}} {{crit_confirm=[[ 1d20 + [[ @{total-attack} ]] ]]}} {{crit_damage=[[ [[ (@{damage-dice-num} * (@{crit-multiplier} - 1)) ]]d@{damage-die} + [[ (@{total-damage} * (@{crit-multiplier} - 1)) ]] ]]}} {{type=@{type}}} {{weapon_notes=@{notes}}} @{iterative_attacks} @{macro_options} I noticed that some of the called Attributes contain problematic characters, so I'll follow the Roll Query Troubleshooting instructions and make the following replacements: @{toggle_rounded_flag}&nbsp;→ {{rounded=rounded}} @{toggle_accessible_flag}&nbsp;→ {{accessible=true}} @{macro_options}&nbsp;→ {{melee_notes=@{melee-attack-notes}}} {{ranged_notes=@{ranged-attack-notes}}} {{CMB_notes=@{CMB-notes}}} {{attack_notes=@{attack-notes}}} {{ header_image =@{header_image-pf_attack-melee}}} {{ header_image =@{header_image-pf_attack-ranged}}} {{ header_image =@{header_image-pf_attack-cmb}}} ( Note : only the lattermost header_image property will be used.) For similicity's sake, I'm removing @{iterative_attacks}. We now have: &{template:pf_attack} {{accessible=}}&nbsp;{{rounded=}} ( Note : I toggled these flags off.) {{color=@{rolltemplate_color}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}} {{attack=[[ 1d20cs&gt;[[ @{crit-target} ]] + [[ @{total-attack} ]] ]]}} {{damage=[[ @{damage-dice-num}d@{damage-die} + [[ @{total-damage} ]] ]]}} {{crit_confirm=[[ 1d20 + [[ @{total-attack} ]] ]]}} {{crit_damage=[[ [[ (@{damage-dice-num} * (@{crit-multiplier} - 1)) ]]d@{damage-die} + [[ (@{total-damage} * (@{crit-multiplier} - 1)) ]] ]]}} {{type=@{type}}} {{weapon_notes=@{notes}}} {{melee_notes=@{melee-attack-notes}}} {{ranged_notes=@{ranged-attack-notes}}} {{CMB_notes=@{CMB-notes}}} {{attack_notes=@{attack-notes}}} {{ header_image =@{header_image-pf_attack-melee}}} {{ header_image =@{header_image-pf_attack-ranged}}} {{ header_image =@{header_image-pf_attack-cmb}}} All that's left to do is basically: Delete any unwanted/redundant parts of the macro. Prefix some of the Attribute names (within the Attibute calls) with "repeating_weapon_$0_". Note that not every Attribute call should receive this treatment. Replace all problematic characters with HTML entities. Note that the Attribute calls are not problematic (see: Advanced Usage for Roll Queries ), yet the values of Attributes can be. For example, commas within a "notes" section will break the parent Roll Query. For advice on how to deal with this, check out Roll Query Troubleshooting . Duplicate our macro a few times, incrementing the&nbsp; RowIndices as appropriate. Place the macros with a parent Roll Query. Add a keyword to the Attribute calls. This step is optional if this macro is only to be used from a tab of a Character Window (e.g. from an Ability).
It's coming along nicely. All I'll have to do is copy/paste and change the weapon numbers, and it should be fine. It's pretty complex, but it'll cut down on a lot &nbsp;of CS opening/closing etc. The key to testing is to change a few, test, change a few, test, etc.&nbsp;
So, I've been working on it and I leave the game for a little bit to take a break. I come back to it and try where I left off without changing anything, and this is the result... The code I have for the Weapons is: I left the attributes alone when changing the problematic characters into HTML. I'm wondering what to do now... I understand that calls are left alone, and such. I have a converted copy of the macro, and it works fine. So I'm not entirely sure where something went wrong... Could it be as simple as missing a problematic character?
1463541821

Edited 1463541854
The closing curly brace of &{template:pf_attack} requires replacing, if you plan to keep it within your Roll Query. However, since &{template:pf_attack} is likely going to be element common to all dropdown fields of your Roll Query, I suggest factoring it out. e.g. of Roll Query factoring: ?{Q|A, [[1d20 + 1]]|B, [[1d20 + 2]]|C, [[1d20 + 3]]} → [[ 1d20 + ?{Q|A, 0|B, 1|C, 2} + 1 ]]
1463544841

Edited 1463547685
Such a simple issue was holding it back. Now it's working perfectly. And the way I have the query set up, every character that uses the query will have different options show up because the option names are set to @{selected|repeating_selected_weapon_$X_name}. So they'll know what attack they'll be using and it'll automatically launch that attack. I'mma call this as a finished product. And to convert it into an ability probably won't be hard at all if I want to use it on my own characters in different games.&nbsp; I try to make the most out of what I have access to as a free user, which forces me to come up with some ways that some people might not think of or simply don't have access to an API that already does it. Working not just for myself, but also for other free users. If there's a thread where I could upload the code and update it if/when I refine it, that'd be awesome. Thanks again for your help Silvyre, and I hope that you have fun playing/GMing whatever games you're a part of. And stay awesome. Edit: I just saw the Suggestions & Ideas thread. I'm thinking that would be the best place to post the drop-down fighting system. Edit 2: Nevermind. I guess I'll have to go with the General On-Topic thread. Still... at least I might be able to help other make their games a little more interesting.
Awesome! General On-Topic is the most appropriate forum to share macros, but I'm sure the folks in the Pathfinder Sheet Thread 5 would appreciate it too!
1463554194
vÍnce
Pro
Sheet Author
Interested to see the end result. &nbsp;Very cool.
1463554492

Edited 1463554868
It was a pain in the butt to get working, and it blows up the macro section for GMs... but I think it'll be worth it in the long run. Here's a link to the post for it if you're interested in it. And I'm willing to invite people to give it a test run before they dive into using it.
1463592177

Edited 1463592374
So it's starting to get a little bulky on the query when it comes to the skills (I have the weapon one done and working 100%), due to there being 41 skills in the sheet (not doing misc. skills). I've tried implementing a multi-query system where it'll list what skills are in each secondary query (which loads up just fine). The issue I'm running into is when trying to launch a skill from the secondary query. When launched from it, it simply give a blank line in the chat box as if there was no info put into it (think a blank attack template and it spitting out just the title section without any words in it). Would I have to implement the & amp; into the skill rolls or just modify the secondary query with those? The general format I'd like is something like this: Master Query Secondary Query Skills
qwerty4132 said: When launched from it, it simply give a blank line in the chat box as if there was no info put into it (think a blank attack template and it spitting out just the title section without any words in it). Would I have to implement the & amp; into the skill rolls or just modify the secondary query with those? I'd probably need to see the Roll Query code to say for sure, but it sounds like an issue with HTML entity nesting . As you say, skills are on the "&amp;amp;#X" level of nesting.
Okay. I think I've got a enough of an understanding to get it to work how I'd like. The only question that I can think of right now is: for a second tier query, are the calls left alone as usual, or are those changed as well? The only complaint I'd have to say about all of this is that there's no way of organizing global macros into folders or something like that to keep it simple and clean.&nbsp;
1463613264

Edited 1463613278
qwerty4132 said: The only question that I can think of right now is: for a second tier query, are the calls left alone as usual, or are those changed as well? The only time a call should be subject to character replacement is to nest them within an API Command Button.e.g. [Test](!&amp;#13; &amp;#64;{target|token_name}) Outside of API Command Buttons, calls should not be tampered with; the order of operations unfortunately won't stand for it. qwerty4132 said: The only complaint I'd have to say about all of this is that there's no way of organizing global macros into folders or something like that to keep it simple and clean.&nbsp; I'm curious—why does it sound like you have a ton of global macros? One of the benefits of using Advanced Roll Queries is the ability to amalgamate global macros. I highly recommend replacing #Macro calls within your Roll Queries with the values of those macros themselves.
I do have a bunch of them. And I had wanted to have the rolls show the name of the roll as well as have the roll happen. I remedied the issue of the skills. So I think I am finished with it. If anyone would like to try my system out, feel free to pm me or leave a message here and I'll let you join and try them out.