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 .
×
Advertisement Create a free account

[API] [script] [discussion] Pathfinder Attack complete (AC, Crit, etc.) combination

1422182715

Edited 1422183423
There used to be many problems with making attacks against a selected token's AC. First was, it wasn't guaranteed to have an AC because for minions people often wouldn't bother writing it all in. Over here <a href="https://app.roll20.net/forum/post/1517881/pathfin" rel="nofollow">https://app.roll20.net/forum/post/1517881/pathfin</a>... an Import function is making this so easy that soon minions shall have AC too, cause it'll be so easy to do. --- Even if not (say you're attacking the token of a chest) we could add an eventuality to account for that: if {target|ac} != Undefined then do regular roll else do vs ac roll. I asked two GM friends about scripts for attack against AC and we agreed it would be bad to allow players to see the AC of the enemy they're attacking just by hovering over the roll result. Scripts would seem to be the answer to that, though I'm not sure how exactly. Separately seeing all those rolls for eventualities is weird (i.e. if it's a crit you'll roll this much to confirm and this much damage... wow that's a lot. Oh, you didn't even hit? Well that's pretty sad for that damage you would have gotten...). It doesn't match the in-person experience where you wouldn't roll more dice than necessary. But it would still be nice to only have to click once (i.e. instead of having to roll again only if one crits), as is achieved here: <a href="https://app.roll20.net/forum/post/373442/script-cr" rel="nofollow">https://app.roll20.net/forum/post/373442/script-cr</a>... [[Edit: Actually the link there doesn't seem to go anywhere anymore :( But I still found something here <a href="https://wiki.roll20.net/User:235259/Critical_Hit" rel="nofollow">https://wiki.roll20.net/User:235259/Critical_Hit</a> -- though with a note about it awaiting deletion? hm...]] Now if we could combine the two and do something about the AC of the target not being visible to the target, that would be amazing. I don't know if the Charactersheet has access to API as part of it's makros but over here <a href="https://app.roll20.net/forum/post/1498595/pathfind" rel="nofollow">https://app.roll20.net/forum/post/1498595/pathfind</a>... they're working on adding templates to make it all look prettier - maybe the script that combines the above could be integrated into the sheet or at least a custom sheet just like it except with the expectation of having the api set up too? Ideally we'd get a way to integrate externally hosted pngs (or a place to store pngs on roll20 in such a way that other campaigns can access them too) - for scripts like blood and honor - and then we could make one script that new mentors could just add alongside the pathfinder sheet without having to learn too much about coding and what not - and have a much improved gaming experience. How much work would all this be? Is it realistic? How can people (including myself) help this process? In gratitude to the community and all the contributors and in excitement at the potential and the future, Julix (If something like this has already been suggested or is already in progress, I'm still having a hard time navigating the forum (i.e. how do I do searches only within certain subforums?) - please give me a link and I'll take the discussion there... if it hasn't been locked for being too old that is).
1422184976
Gen Kitty
Forum Champion
Here's a script you might look at as a rough starting point for 'only show damage if I hit' type stuff: <a href="https://app.roll20.net/forum/post/576665/yet-anoth" rel="nofollow">https://app.roll20.net/forum/post/576665/yet-anoth</a>... -- Yes, it's 4e, which means no rerolling for crit-confirmations, but I did say it was a starting point to look at. The reroll-once mechanic, recently added, helps a lot in that endeavor, especially if you steal the critical-range highlighting from Powercards or something similar via roll-templates. But here's the thing: Once you start going beyond 'roll dice, show results' into 'did I beat the AC -&gt; no -&gt;don't show the damage then' stuff if what happens when players make errors and something shows up as a miss that was really a hit? They forgot the bless, they forgot the flanking bonus, the GM forgot AC was lowered because target is prone and didn't update the AC field for the monster -- you need to decide up front how to handle that. Recovering the data is impossible unless the API is set up to remember the last X rolls from each player, but is rerolling the whole attack entirely fair? That's a call you have to make. *chuckle* This is truly a case of personal preferences. ^_^ Every game I've been in or run iRL, we'd roll damage and to-hit at the same time (making themed dice sets for attacks was fun! excuses to buy more dice!) and even in games here on roll20, a lot of GMs just have people go ahead and roll attack & damage at the same time anyway when the sheet has separate macros for them. I apparently go against the trend by blunting exposing every monster's defenses; PC attack macros are 'hits XX against defense YY' (4e). It saves everyone time as I don't have to look up anything in the middle of an attack to determine if someone hit or not, we focus on 'are all the modifiers to hit & damage correct for this attack?' I figure eventually they're going to guess the defenses anyway, over the course of battle, so I don't see it as an issue to let them know the numbers outright. I do compensate by having a lot of hidden skill rolls.
1422184987
Brian
Sheet Author
API Scripter
Julix said: But it would still be nice to only have to click once (i.e. instead of having to roll again only if one crits), as is achieved here: <a href="https://app.roll20.net/forum/post/373442/script-cr" rel="nofollow">https://app.roll20.net/forum/post/373442/script-cr</a>... [[Edit: Actually the link there doesn't seem to go anywhere anymore :( But I still found something here <a href="https://wiki.roll20.net/User:235259/Critical_Hit" rel="nofollow">https://wiki.roll20.net/User:235259/Critical_Hit</a> -- though with a note about it awaiting deletion? hm...]] The two links are the same script. If you read closely, you'll also see that the deletion notice says that it's "a userpage or subpage requested to be deleted by its user." (The user being me.) With the advent of the API script repository, I brushed through all my scripts, cleaning up those worth keeping around (moving them from a subpage of my userpage on the wiki to the main namespace linked from the scripts index), and requested the remainder (those I do not feel are actually good enough to keep around) be deleted. My critical hit script, while in a sense the ancestor to several other scripts (part of its code exists in an evolved form in HB's power cards script, for example), is not itself very good.
1422185681

Edited 1422185915
Good point with considering all the strangest modifiers, GenKitty... that is hard to impossible to do. Hmpf. I guess I'm just unhappy with the chat window being spammed so fast by posts containing mostly useless info. Especially annoying in text only games, which I've just started a few of. - but I guess the solution is more complicated than I assumed it would be. Thanks for explaining that, Brian. Yours was system agnostic though - is there something like that around now? If not doesn't it make sense to wait with all the deletions until there is a better one in the repository to replace it? - That way it can continue to serve as a starting point.
1422186374

Edited 1422186440
Gen Kitty
Forum Champion
Powercards are system agnostic too, y'know :&gt; And the most current production version allows you to make the font smaller, cramming in even more text per square inch than before. But seriously, an automated system isn't impossible you just have to think hard about your design philosophies ahead of time. The idea of saving the last 3-5 few invocations per player is an interesting idea, and now I want The Aaron or someone to come tell us if that is even possible . If it is, you're much closer to being able to pull it off, because if someone realizes they flubbed something, the GM can peek at the log and see what the results would have been if the hit had connected -- assuming of course that you're doing all of the math and only displaying the relevant bits. It's a worthy project, just requires some thought. And a lot of coding :&gt;
I'm still very new to coding - and I'm so filled with ideas that I can't focus on anything - which is bad. I feel I got to learn to do one step at a time, just like the developers of roll20 are doing (only a babystep version of that). Right now my JavaScript skills are very very basic, and I'm still sick and having trouble concentrating, which doesn't help. But if I make the goals specific and ask for help I might be able to pull little things off... and maybe over time bigger things. So my long term goal is to get much of Pathfindercombat automated and many other tasks (like splitting xp, importing characters etc.) as well, allowing me the benefit of having specific rules without the game time "wasted" dealing with processing and applying those rules.
1422198509
The Aaron
Forum Champion
API Scripter
Julix: I feel your pain. I have 15-20 google docs with pages of designs of things that would be awesome. I've got 10 or more proto-ideas I've been developing on the commute to work. I just need the time to write them all. :/ GenKitty: totally possible. You're basically talking about the Memento Design Pattern, which is how most software handles the Undo action. In this case, your script would keep an array of objects for each player id. Each object would contain all the data about their execution of the comnand and some meta data. You then give the GM a special command to instruct the script to reconsider a previous comnand for a player. So, it might go like this: Player 1: "darn, a miss..." Player 2: "how did you miss, wasn't his shield discarded from heat metal?" GM: "oh, I didn't remove the AC bonus, just a sec..." GM fixes AC GM: !rerun "Player 1" 0 Player 1: "yes! A hit, and look at that damage!" Of course, it becomes more complicated when you need to add things like bless in, or if players have a way of influencing the dice (like 5e's Inspiration or Lucky Feat). Anyway, totally possible from a scripting standpoint.
1422204772
Gen Kitty
Forum Champion
Under such a scenario, my design philosophy is that the GM is responsible for maintaining any changes to the mob defenses during combat, the players are responsible for maintaining any changes to their tohit&damage. All the script should have to do is summon numbers, roll dice,and do math and then report the various bits. And let the GM peek under the hood so that 'lost' damage can be retrieved and displayed (as opposed to rerolled). Making this handle 5e's dice rolling would be fun, but on the bright side: OP is looking for a Pathfinder project,not a D20 one, so that narrows the scope considerably :&gt;
True, though ideall all parts of it should be as system agnostic as possible so that other systems could benefit from our work as much as possible by just replacing aspects of it with different code.
1422206617
The Aaron
Forum Champion
API Scripter
Yeah. I Always try to shoot for the general case. :) There are probably similar pathfinder examples. Flanking, Aid/Bless, etc. RaW, 5e scripts would tell you "you rolled a 23, use luck or inspiration?" Then continue with results.
Another reason to shoot for a more agnostic view is to allow customizability for house rules. Being able to set up crit success (as Pathfinder Rules As Written allow them) is one thing, but some might add tables of things that can happen for crits or even crit failures too including a range of what happens depending on how high you crit.
1422222372
Gen Kitty
Forum Champion
The thing is that 5e is unique among the D20s because of the 'roll twice' mechanic, so you'd have to write a special module just for them. Easier to start with just supporting pathfinder/3.5/4e which only differ whether crits are confirmed and how crit damage is calculated.
Definitively agreed. I forgot how different they are. I guess all I meant is documenting what parts of the functions do so people have an easy time knowing what to change if they want to mod it somehow... - Anyhow, made an important step towards being able to import stat blocks that I need today, but it's still far from done and it's just a tiny aspect of all the things I'd still love to do to integrate and automate most of the combatmanagement - and then ideally get all those features in you wouldn't ever bother with at a real table (like the callendar and weather and the crazy inventory with gui and ... maaan!) -- next thing would be mass combat effects that directly affect tokens involved such as casting a channel effect... guess it means needing a variable that checks for undead status... nevermind! I just checked, that's already in the character sheet and already gets imported from the stat block. the script would just have to recognize it, differentiate between positive and negative energy channeling... size... strength.... alright, I take back "just" but it's doable! - and it would be amazing to run a powerful necromancer raiding the city on his undead mount killing everything that isn't undead with his channels! " 30-foot radius centered on the cleric" - I know there's a script for drawing a line like that, so it's visually clear who's affected, but can I tell the script somehow to give a damn about who's in the circle and select them and do stuff to them? :-S Actually learning javascript now instead of hoping copying something from here or there would be enough. But it's a process... - and meanwhile I'll still try to get away with working with half to non-understood things. :D
1422241877
Gen Kitty
Forum Champion
If you look at The Aaron's TokenMod script, you'll see code more up to date for modifying tokens based on input from a macro. Don't forget resistances, vulnerabilities, and immunities. And 4e handles elemental damage differently from Pathfinder ^_- (Pathfinder you find characters doing split elemental damage, ie: 1d6 normal plus 1d6 fire. 4e, it'd be all fire. I've PCs who do fire AND thunder on all attacks, another who does thunder AND lightning damage. And the mobs need to block ALL incoming damage types to avoid taking damage) I will say, be wary of megalithic scripts that do everything. Calendars and weather and inventories should all be their own scripts, for example. I'd split to-hit and damage into different invocations, myself, because of that same 'did the players/gm add everything up correctly?' factor. That said, a 'do damage' API where you tell it what damages of what kinds and it checks the target for said vulnerabilities/resistances/immunities and does the final math for you and applies the damage... would be very nice. Oh, also take a long hard look at Stephen S's 'DungeonReady' script: <a href="https://app.roll20.net/forum/post/1408589/script-c" rel="nofollow">https://app.roll20.net/forum/post/1408589/script-c</a>... His 'setup' script is a thing of beauty and grace, as far as I'm concerned. It walks the GM through doing everything needed to set up that script, complete with warning messages when you don't do something right.
1422242009
Gen Kitty
Forum Champion
Learning through examples is how I learn, I see stuff that does something and I bang on it with rocks and see if I can make it do something else. If my birthday passes without my receiving the JS book The Aaron touts, I'll be packing it up for myself anyway so that I can start better understanding the scripts.
1422242983

Edited 1422243005
The Aaron
Forum Champion
API Scripter
*cough*, *cough* I highly recommend Javascript: The Good Parts by Douglas Crockford . It's a short book with great info. My scripts SUCKED before I read it. =D I've read it 3 or 4 times now.. I should read it again.. I used to HATE javascript, until I read it.
1422245848
Gen Kitty
Forum Champion
Thank you for saving me from having to go poke my amazon wishlist :&gt;
1422246116
The Aaron
Forum Champion
API Scripter
=D No problem. I've got a lot of practice recommending it: <a href="https://app.roll20.net/forum/search?q=Javascript%3" rel="nofollow">https://app.roll20.net/forum/search?q=Javascript%3</a>...