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

[Request] OSRIC/1e Attack script

Apologies if this has already been done, but I'd like to request an attack script for AD&D/OSRIC that would do several things: 1. Make an attack roll, 2. Add in all the character's appropriate attack bonuses (strength for melee, dex for missile, plus any magic bonuses - these would have to be added as attributes I guess, since there is no space on the 1e Character sheet as written for magic bonuses). 3. Pull the character's level and class from the character sheet 4. Pull the Target's Armor Class from its character sheet 5. Use this information to find the appropriate "to-hit" table and check for a hit. I'd like the player to see only the attack roll, and then whisper the GM (without the player's knowledge) whether it's a hit or not. For bonus points, I'd like to have the following: 1. The character chooses his/her weapon as part of the script, and damage is automatically rolled if there is a hit. (there would have to be a query for weapon and target size as well) 2. Incorporating a critical hit/fumble table as part of the output. Hope this is all clear. If you can't tell by the post, I have no clue about coding. I'm actually requesting this for another GM who has mentor status. If we can get this done and working, I'm considering upgrading myself for my own campaign. Thanks in advance!
So, it looks like no one is willing to take on this project. Oh well.
1425303308
Ziechael
Forum Champion
Sheet Author
API Scripter
Hi Gozer, from the look of it this is doable in the most part. I'm not familiar with 1e so wouldn't want to mislead with any specifics but i'm sure someone will take a look and blow your mind (Aaron may even suggest API... who knows!). I'm genuinely surprised no-one responded within a week though as this sort of query usually gets a lot of attention purely as a mental/macro writing exercise. If i get a spare moment... ever... i'll take a look at the 1e sheet and try to at least get you started :)
1425315982
The Aaron
Pro
API Scripter
Ah. I had intended to reply to this thread but got busy and forgot about it. Most of what you're interested in can be done with powercards (or specifically, two powercards, one whispered to the GM). 1-4 are very much macro details. 5 is the only one that would really require some API details. I don't know what needs to be done to figure out the to-hit (is this THAC0?), but if it's purely formulaic it could even be done in a macro. The Bonus bits are a bit more tedious. B1: how would they choose? You could pop a query and ask for the number of the weapon while giving them a list of them: ?{Choose: 1) Axe 2) Sword 3)Bow|1} B2: You can do this now with rollable tables, the part I think you're after is choosing to show it if it was a critical hit/miss. I love automation, and have a bunch of it I want to do. I know that HB has said he's going to add elements of automation to his Powercards script, and I think you'll get some of the things you want there, as well as with changes to the character sheets to take advantage of roll templates. In the Interim, I'd suggest using powercards to just give all the information as succinctly as possible, and let the player and GM pluck the info they want. I'd have 2 powercards generated for each attack, a player visible one and a gm whisper one. I'd put all the attack details in the player one To Hit : [[1d20+@{attribute}+@{attribute}]] Sword : [[1d8+@{attribute}]] | [[1d6+@{attribute}]] Large Axe : [[1d6+@{attribute}]] | [[2d6+@{attribute}]] Large Bow :[[1d8+@{attribute}]] | [[1d8]] Large And the vs. details in the GM one Minimum to hit : [[10-@{target|ac}-@{target|dex_mod}]] You could further add to that rolling on the Critical Hit and Critical Fail tables, but I think players find it more exciting to do that as a separate step so they either have the anticipation of what the Critical Hit will do, or the dread at the results of their Critical Fail.
1425316996
Ziechael
Forum Champion
Sheet Author
API Scripter
Ziechael said: ...but i'm sure someone will take a look and blow your mind (Aaron may even suggest API... who knows!). Told you so =D A double whammy from Aaron, blew my mind and suggested API solutions!
1425317611
The Aaron
Pro
API Scripter
=D
Wow, it never rains, but it pours! I guess my little post just needed a bump. :) Ok, to answer your question, the Aaron (is the The capitalized, by the way?), 1e does not exactly use THAC0, it uses to-hit tables. There is a mathematical progression to it, however. The character's class determines the to-hit table used, and the character's level gives the row on the table to use, while the target armor class gives the number needed to hit. Here's the to-hit tables: These are from an OSRIC referee screen, but the progression is basically the same. By the way, on the Monster to hit table, the 3rd row says "1-Jan", but that's a misprint, it's supposed to read "1-1." The Bonus bits are a bit more tedious. B1: how would they choose? You could pop a query and ask for the number of the weapon while giving them a list of them: ?{Choose: 1) Axe 2) Sword 3)Bow|1} Yes, I'd like something like that. There's a space on the 1e Character sheet for players to put in their weapons, along with damage, range, etc., but it looks like it doesn't put any of those values on the Attributes tab, so I don't know if you could pull from there or not, but ideally the player would see a list of the weapons they've already entered on their sheet, and choose which one they are attacking with. I also like the idea of the crit and fumble as a separate table. A rollable table is fine for that, and that part I can do myself. Perhaps just a notification that a crit or fumble was rolled. Thanks for getting things rolling on this!
1425324835
The Aaron
Pro
API Scripter
Hmm. Those charts could be done with a rollable table (well, actually with a whole bunch of them...) and the Real Rollable Tables script that Brian wrote and I modified. It would be a bunch of grunt work (though easier probably if you used my Table Export script, which also imports). Selection of weapons is a bit harder. You'd almost want to have the script rewrite all the calls to it whenever the user changes one of their weapons (doable, my Use Power script rewrites calls to it on some circumstances. =D ). This really falls largely into the roll of "Things I could do but would take a lot of my time." I could certainly get you a solution for figuring the to-hit based on that chart that is better than adding 100 lookup tables.
The problem with the mathematical "progression" is the repeating 20s. All of the automation is stalled at the "20 20 20 20 20 20" section of the charts. The Aaron is great phenomenal with code. Let's see of he is as good with pain-in-the-arse combat tables converted into a math formula. I just went with the 2E Thac0 method, but I have the combat formula roll the AC that the character hits (based on data from the sheets themselves as well as any additional modifiers like magical weapons). You can have a situational modifier query pop up for things like active bless/chant/prayer/protection spells, but I generally have us add it in after the chat roll, mentally. You could also have the old AC chart on the sheet like the old sheets used to and just have your rolls pop up in the chat and compare them for success/failure. Weapon Mag. Adj. Space/ Range Speed 10 9 8 7 6 5 4 3 2 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 Damage S-M / Large Long Sword - - 6 10 11 12 13 14 15 16 17 18 19 20 20 20 20 20 20 21 22 23 24 25 1d8 / 1d6 This could be referenced with the scripting of the sheet or just as a look up spot for the player on the sheet. As far as a critical hit/fumble roll - I see if one is needed and have separate buttons for them on my macro quickbar, roll is output to the chat window. You can use the sheet as a written copy and then create attributes for the various things you need, using them in your macros. You could also do a custom sheet using the AD&D 1E sheet as a template, if you are mentor level, for creating all of theses things. That's what I did with the 2E sheet. Took it, hacked it, made my own. My three different combat outputs, using macros that pull from the sheets (and allow custom data entered): Top (in orange) is a simple chat based, non-api output. Middle is a PowerCard API script based output Bottom is a new color text option they are developing on the dev server. Flashier version of the orange I simply have them roll to hit using one of the weapon/attack buttons I have created for them based on their character sheet, then I tell them if they hit. Each roll shows the best AC hit, and the two following numbers for damage are S-M / L
1425328181
The Aaron
Pro
API Scripter
OldSchoolChris said: The problem with the mathematical "progression" is the repeating 20s. All of the automation is stalled at the "20 20 20 20 20 20" section of the charts. The Aaron is great phenomenal with code. Let's see of he is as good with pain-in-the-arse combat tables converted into a math formula. Calculating that is trivial in the API, but getting it somewhere useful is probably more of a difficulty. Since the progression of numbers is really the same horizontally, it means you really just need one array of the possible values from [26 25 24 ... 20 20 20 ... 20 19 18... 2 1 0], then you adjust where you start looking based on the class & level, and offset based on the AC. Done. However, once I've got the number 12 as an answer in the API, where do I put it that's useful. The easiest thing to do is to add it as an option in my Powercard Preprocessor script, so you'd just put something in the command like [OSR[class,level,ac]OSR] and it would replace it in your calculations with the number: !pcpp --name|test --Min to Hit|[OSR[thief,3,5]OSR] would look to Powercards like: !power --name|test --Min to Hit|18 That's certainly the easiest for me. Thoughts?
A lot of that went over my head, but if I understand what you're saying, the output would show the GM the minimum number required to hit, that's what I want. I want the players to roll and see the actual number they roll (with the standard green for crit, or red for fumble notification), and then for the GM (and preferably ONLY the GM) to see the required number to hit, which looks like what you're referencing there. If need be, and it would help, I could do as much of the grunt work as I am able, such as setting up the rollable tables, etc. I might just need some direction as to how to set them up correctly to work with the script.
1425330083
The Aaron
Pro
API Scripter
I'm suggesting not having rollable tables for the to hit. =D Some background might help. I have a script that basically takes commands, manipulates them a bit to add functionality, then passes them of to the powercard script for rendering. The details are probably not super important (and it deals with the order of operations issues that frequently come up and are hard to explain anyway!), but the practical upshot is you'd call a script with arguments like the powercards script, that does some extra work for you, then calls powercards on your behalf with the results of that work.
What we're doing right now is, the player selects his token, then an ability macro comes up as a token action, one for missile attack, one for melee (there's also a macro for initiative, reaction rolls, and some other racial/special abilities, etc.). I'd like for the process to be basically the same for the players, i.e., push a button, roll an attack. Then, I'm doing another GM macro, in which I enter their attack number, click on the attacker and target, and it gives me the AC they hit, and the AC of the target. But it's several clicks, and there's this pause between the number being rolled, and the determination if it was a hit. There's less of a pause than if I was looking up a table, but I'd prefer to do away with the pause altogether.
1425332149
The Aaron
Pro
API Scripter
Right. I think we can optimize that quite effectively. =D
Not to rush you, but has there been any progress on this?
1426705006
The Aaron
Pro
API Scripter
Actually, I completely forgot about this... Good to keep it on my scope... If you want to PM me, I can leave your message unread as a marker to remember to do this... Sorry..