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

5e token action / target question

    So....  I've been using Shaped 5e for some years, but with the changes Roll20 has been making, and Kryx throwing his hands up in the air - ...I'm beginning to have issues moving forward into new campaigns with it.  I've seen UCM , and scripts from keithcurtis to generate statblocks. These are useful,but all my players don't have Stylus, and the pink blocks are horrid; still, workable. Also the PC statblock is a bit funky.. i need to work through the code and sort out the results to understand what I"m looking at - but its generally workable.  I've also pasted in TokenAction so that !ta  gives me the macro buttons....  and its mostly workable.   But .... Has anyone found a script or macro combination that, in the token actions, includes the 'select target' function and then prints out the AC as well? !ta gives me 'click the weapon, here's the attack roll, and the damage, and the 'if crit' and includes disadvantage - but it doesn't require me to click on a target.  It's a small thing, but its a function I'd like to get back. I know how to select a target in a macro - but in these 'abilities' on the character sheet - I'm not at all sure how to make the modification. There are more features; I'd like to have a short rest button with the option to burn/track HD one at a time for HP recovery, and a simple LongRest button, but those are things I suspect I can work out on my own - the 'target' option is the one that's hurting my brain.
1583112575
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hmm. I usually just click on the target token to read the AC off the bubble. It's the same number of clicks. What about the UCM PC macro needs clarifying? Maybe I can help. AFAIK, there is no Short Rest macro for the OGL sheet. :( The Resources section is really clunky, which is one reason why reporting the values is so kludgy on the UCM macro I wrote. The Shaped Sheet really is superior in a lot of ways. But I gave it up pretty much for the reasons you cite. There is a Long Rest macro on the Companion script. What is lacking on it?
using a LVL1 warlock sheet with some cantrips, burning hands, and shield, and a dagger.. the NPC block actually gives me accurate buttons: but it doesn't grab all the info.. The PC block does better with ac/SPD/etc - but the spells/attacks are screwy: see below. The NPC statblock works just fine on the NPC , but the PC block.. meh....
1583203644
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hmm. I have made a few tweaks since posting my code, though the existing ones in the UCM thread seems to work for my 4th level test warlock. Try these: NPC PC
hm. those ones give me:  Could not determine result type of: [{"type":"M","expr":0},{"type":"C","text":"]"}] undefined in my sandbox, and it crashes.
So I went back to the one linked in your UCM script , created a new character sheet - same issue. Spells/melee/ranged aren't parsed properly in the PC statblock. They are in the NPC block, but it doesn't find several other PC attributes, as shown in the graphics I posted.  I didn't try the newer NPC one, as the NPC code from the UCM thread seems to work fine - its only the PC one. I can't see where its breaking. It doesn't look like its producing the results I expect from teh code I see.
1583289064
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Here is a possibility. Are you using v 0.3.5? That is the code from page 1 of the thread. The latest script is in this post , 0.3.7.
3.7.   Just doublechecked, repasted the API script and the macro. The one I was using from an earlier link you posted didn't give me that error, just strange results.  I'm good at finding the weird corner case. I have gone so far as to uninstall all my other scripts; behaviour persisted , so I've readded them ... For reference, the error message generated was:  Could not determine result type of: [{"type":"M","expr":0},{"type":"C","text":"]"}] undefined
1583290110
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You might want to post that in the UCM thread. GiGs might be able to make sense of it.
And after posting, a search of 'universal chat macros' shows a chap with the same problem six months ago - and the issue was .. spells not prepared. *doh*.  The character is a sorceror, so 'prepared' isn't really a thing - not buttons I ever use in that class. Never bothed to go click them on the warlock I tried. The crash is somehow caused by a [[  as opposed to a [ in the 'jump' section, but since the older version of code is working for me, i'll just stick with that. I'd still like to find a way to get TokenActions to add an @target in the action....  but - this is still HUGELY improved. thanks keith.    
1583299115
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm not sure. I just unprepared all spells on a rogue/arcane trickster, and on a warlock. No errors, no crashes, and no garbage output. The macro code I posted in the gist was directly taken from this game, too. Are the characters you are testing on created from scratch in your OGL game, or were they imported from your Shaped game?
THese are from scratch.  When I unprepare all spells, they disappear from the list in the statblock - when I prepare them they come back.  The crashes are documented in a post you were part of - with the same error; Gigs did a replacement on [[ vs [ and the crashes stopped.  (tested in my game. worked)..
1583333157
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Sorry, it's getting a bit jumbled with multiple issues being talked about at once. We jumped from the API crash in the previous post to the macro issue in the next. I understand now what you meant by "spells/attacks are screwy": The PC macro is designed to show only prepared spells, since that's the intended use case. The NPC macro is designed to show all spells, since Roll20 defaults to NPC spells being unprepared in the Compendium. I do have a macro that mass prepares/unprepares all spells on a selected character, if you are interested. As for the @target issue, I don't think you can automatically modify the macros created by !ta. They are existing macros pulled directly from the sheet, and told to be token actions. That script is not generating much in the way of code. You might be able to use the Customizable Roll Listener script to listen for attacks being generated in chat, and automatically run a targeting macro.