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

Is there an upper limit on how many operations can process in a single ability?

I'm building a mind-bendingly extensive set of abilities for the FFG 40kRPGs, that will process virtually everything with as much automation as possible, but I think I'm running into a system limitation. The framework is thus: After to hit and dodge/parry, I have a set of abilities written for damage. The abilities show as a self-whisper under the template when your to-hit ability posts, giving a bunch of different hit locations, so that you can click one of them, and it will prompt for number of hits, degrees of success, range to target, and a couple other minor factors, then automatically test everything in a big batch. This single ability is doing all of the following: > Damage dice with a roll and keep for proven/primitive value (proven sets a lower limit on individual dice faces, primitive sets an upper limit), as well as highlighting natural 10s for critical hits (or above 10 if weapons have exploding 10s from a certain quality) > Adds static mods > Calculates crushing blow/mighty shot based on a 0/1 flag and applies that extra damage > Calculates if the target has an active ionic flare shield that subtracts a small amount of damage from certain weapon types (again based on a set of 0/1 flags to multiply particular bits to zero them out if needed) > Calculates and subtracts target toughness, including unnatural toughness vs Felling, daemonic toughness vs sanctified weapons (even more 0/1 flags) > Armour of the target location, minus penetration > Calculates added penetration for degrees of success (razor sharp, melta expertise, etc) > Added penetration for talents (tank hunter) > Added/adjusted armour or pen based on weapon damage type (ceramite plating, lathe-pattern alloy, etc) > Added armour based on ablative plating (characters have a series of flags to turn the extra armour on/off on each location as the ablative layers are blasted away) > Calculates if a field save is active and would apply, automatically rolling it with an overload shown as a critical failure and multipliers to zero out the damage if the field save is successful > Queries for a number of hits with a slightly different modifier attached to the query on each hit, divisor, round up, so that if the ability supports 8 hits but you only land 3 of them, the remaining 5 will zero out, while also using that same query to turn off field saves (so they don't give the chance of overloads) and each individual damage dice (so they don't give the chance of criticals) Clever layout and putting them out of order sorts and batches these into grouped locations. As such, in theory, rolling the ability gives a template that looks like the following: Table header: TestPCKnight scores [X] hits with his Avenger Gatling Cannon against target Dummy, with the first hit landing on the Torso. Head = X Right Arm = X Left Arm = X Torso = X, X, X, X, X, X, X with damage values for each. The problem I'm running into, is that only the first damage value procs. The rest come out as half-parsed garbage. But if I copy only the broken chunk and past it alone, it procs fine. If I cut out the first damage value, then the second one procs and the remainder come out as garble. For reference, the damage ability macros, having so many nested elements, are clocking in at over 51,000 characters for the highest rate of fire weapons, so it's entirely possible that I'm running into a character limit here, or a maximum number of operations that can proc in a single post. I'm using Excel to compile code chunks together, since there are a lot of common elements that get combined together based on vlookup tables for slight differences in permutation. BTW, there are no nested abilities (thus no HTML replacements needed) - each chunk procs completely fine alone, but when I paste several of them together, sometimes it hangs, sometimes it seems to time out (which is tough to tell if it's timing out or if there's an error that's just causing the code to stop processing altogether). I would post the code, but it resembles a short novel at this point, so just unpacking it is crazy.
1541365854

Edited 1541365887
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yes, it's something like 999 discreet inline rolls. In addition you can only drill down through attributes/abilities/roll queries 99 levels. There is also an upper limit on how long a chat message can be. I don't know what that limit is but it's something on the order of 10 4  - 10 5  characters. I'm also not sure if inline rolls count towards this character limit in their pre resolved state, their tooltip text state, or just their raw number.
I figured it out. It's an automatic timeout. The longer a macro gets, the more time it takes to process, but it looks like if a single operation set runs for longer than about 10 seconds, Roll20 kills the thread entirely, probably to avoid having the page lock up when broken scripts happen. That means when I'm trying to run a massive macro, it gives all of the prompts, then never finishes before being killed. For reference, a single damage roll is giving anywhere from 3 to 18 copies of the same query (needed to turn off critical chances on each individual die), and something like 40 different attribute calls to include all of the various talents, weapon qualities, and stats that can alter a damage roll, and I'm trying to have it run 24 copies of that whole thing to give multiple hits across different locations sorted in order. After getting a basic framework running that has only placeholder values instead of attribute calls, it runs and processes all 24 hits properly, but as soon as I stick a large volume of dice in there, it fails. If I set the damage to 1 or 2 dice per hit, it runs, but takes about 7 seconds to process. At 3 dice, it exceeds what I assume is a 10-second threshold and fails, but I can still run the blocks for individual hits and they process properly. It's also possible that I'm hitting a character count limit and not realizing it, because the functional version clocks in at just under 9,000 characters for the whole block, while bumping it up one step puts it to just over 10,000, and that's without having the full syntax for all of the attribute calls, just the basic framework and the dice logic itself. And yes, it would be nice if I could simplify the dice logic, but it's simply doing too many things. Example: {[[(ceil((?{Total number of hits?|1}-0)/100))]]d10cf0cs>10, 0d0+[[(ceil(((floor(@{Selected|BallisticSkill}/10))+@{Selected|UnBS})/2))]], [[(ceil((?{Total number of hits?|1}-0)/100))]]d10cf0cs>10, 0d0+[[(ceil(((floor(@{Selected|BallisticSkill}/10))+@{Selected|UnBS})/2))]], [[(ceil((?{Total number of hits?|1}-0)/100))]]d10cf0cs>10, 0d0+[[(ceil(((floor(@{Selected|BallisticSkill}/10))+@{Selected|UnBS})/2))]]}kh3 (hopefully the forum won't eat any of the syntax in that) That's rolling 3d10, where no individual d10 can have a result lower than half the character's Ballistic Skill bonus (which is the 10s digit of their stat, plus any unnatural bonus), and I need to be able to turn off individual dice with the ?{Total number of hits?|1} query - it uses the same query all the way through dozens of times but with small adjustments, so that, for example, the 7th hit is ?{Total number of hits?|1}-6 and results in hits above the total being zeroed out. In this fashion, the damage formula can be run 24 times in the same macro, but if you answer 6 to the number of hits, only the first 6 will give results and the remainder will be zero. Inefficient, yes, but I can't get my head around the API, so I don't have any way to do this any cleaner. Well, back to the drawing board. Much as I want it to be automate everything, there's limits how much math the Roll20 engine can crunch in a single post.
1542069420
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Although it would require upgrading to a Pro membership, perhaps an API script could shoulder the bulk of the load?
I would gladly drop the money to switch from Plus to Pro, except that I've looked through the scripting for the API and it might as well be written in Greek. It's taken me months to get proficient enough with just the Roll20 dice language, and learning Javascript, HTML, and CSS just isn't something I have the time to do, not when I have combat encounters being delayed to get these finished. If I had several months to learn it, that might be useful, but I've got about 7 days to get this working. I'm going to look at how I can trim the code down as much as possible to reduce the operations load, see if I can squeeze maybe 8 damage rolls into a single macro instead of 24 and make some minor house rule adjustments to accommodate that.