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

Yet another 4e damage automation script

1392460701
Alex L.
Pro
Sheet Author
Jarrod . said: Alex, have you found out a way to implement vulnerabilities into the script? Vulnerabilities are just negative resists, and should work that way.
And this is why I'm bad with math .....
Have you considered any way to include an adjustment to attributes within a macro.. such as 'target gets a +2 to all defenses until the end of your next turn' being able to have say -z 2 (and have -z represent attributes for AC Fort Reflex and Will).. and then maybe have some customizable ones? or would that be too complicated?
1392877582
Alex L.
Pro
Sheet Author
Jarrod . said: Have you considered any way to include an adjustment to attributes within a macro.. such as 'target gets a +2 to all defenses until the end of your next turn' being able to have say -z 2 (and have -z represent attributes for AC Fort Reflex and Will).. and then maybe have some customizable ones? or would that be too complicated? That would be a status effect, and if I'm going to do them I will do them right or not at all. So for the time being that's not at all. There are too many different statues to add individually.
I figured that would be the case. There's a ton of possibilities so I can respect the need to do it right and the time it would take to do so.
1392908123

Edited 1392908177
Alex L.
Pro
Sheet Author
Quick update now in OP. NOW WITH POWER CARDS by HoneyBadger <a href="https://app.roll20.net/forum/post/609476/script-d-" rel="nofollow">https://app.roll20.net/forum/post/609476/script-d-</a>... If you like the new chat output please go thank him :) also the SHOW_ROLLS option now makes all rolls show up not just damage (you can thank HB for that aswell)
So, what exactly needs to change from the macros from before? Currently, using the macros I have set up, I'm getting a return of "error in apicmd". Are the new parts of the power cards (which... are awesome by the way, THANKS HB!) required for a macro to work?
1392931600
Alex L.
Pro
Sheet Author
Jarrod . said: So, what exactly needs to change from the macros from before? Currently, using the macros I have set up, I'm getting a return of "error in apicmd". Are the new parts of the power cards (which... are awesome by the way, THANKS HB!) required for a macro to work? No should just work.
all I did was copy in the new script and use the macros I had set up. they worked before the update and now I just get
1392932626
Alex L.
Pro
Sheet Author
Jarrod . said: all I did was copy in the new script and use the macros I had set up. they worked before the update and now I just get I will sit down and do some debugging a little later.
I will also try using the new formatting for the power cards to see if that makes a difference
1392966180
Alex L.
Pro
Sheet Author
Jarrod . said: I will also try using the new formatting for the power cards to see if that makes a difference Not sure what it could be, could you post you macro in a code block for me, also try my test macro's: /em Test Power !power @{selected|token_id} "Test Power" -a [[1d20+@{Int}+3+1]] -action "Minor Action" -C 19 -d [[1d6+@{Int}+1]] -D [[1d6]] -e "Effect" -E "purple,pink" -h "Hit" -H "green" -k "Weapon, Arcane" -l -m "Miss" -M "yellow" -r "Ranged 10" -R "Something Happens" -s "Can be used as a basic attack" -S "One person" -t @{target|token_id} -T Cold -u Encounter -v Will -y Fire /em Test Power Direct Damage !power @{selected|token_id} "Test Power Direct Damage" -d [[2d8]] -t @{target|token_id} /em Test Power tohit !power @{selected|token_id} "Test Power tohit" -a [[1d20]] -o 10 -h "Hit" /em Test Power Heal !power @{selected|token_id} "Test Power Heal" -t @{target|token_id} -c [[d6]] -b [[20]] These have all been tested and work on my official test dragon, with the update I am about to put out. Update in OP: Fixed a bug where Heal results wouldn't show.
Without new power card stuff: !power @{selected|token_id} "Recovery Strike" -t @{target|token_id} -a [[1d20+11+ ?{bonus to attack|0}]] -d [[1d10+1+ ?{damage bonus|0}]] -D [[2d6]] -v AC -h "next ally who hits the target before the end of Dracarys' next turn regains @{CHA_MOD} HP" -H chained-heart With new power card stuff: !power @{selected|token_id} "Gaze of Defiance" -t @{target|token_id} -a [[1d20+15+ ?{bonus to attack|0}]] -d [[1d8+8+ ?{damage bonus|0}]] -D [[2d8]] -v Will -T Psychic -h "your allies gain a +1 power bonus to attack rolls against the target until the end of your next turn. If the target attacks you before the end of your next turn, the bonus increases to +3" -u At-Will -A Standard Action -r "Ranged 5" -S "one creature" -k "Divine, Implement, Psychic" Results of test macros:
1393017656
Alex L.
Pro
Sheet Author
Jarrod . said: Without new power card stuff: !power @{selected|token_id} "Recovery Strike" -t @{target|token_id} -a [[1d20+11+ ?{bonus to attack|0}]] -d [[1d10+1+ ?{damage bonus|0}]] -D [[2d6]] -v AC -h "next ally who hits the target before the end of Dracarys' next turn regains @{CHA_MOD} HP" -H chained-heart With new power card stuff: !power @{selected|token_id} "Gaze of Defiance" -t @{target|token_id} -a [[1d20+15+ ?{bonus to attack|0}]] -d [[1d8+8+ ?{damage bonus|0}]] -D [[2d8]] -v Will -T Psychic -h "your allies gain a +1 power bonus to attack rolls against the target until the end of your next turn. If the target attacks you before the end of your next turn, the bonus increases to +3" -u At-Will -A Standard Action -r "Ranged 5" -S "one creature" -k "Divine, Implement, Psychic" Results of test macros: I have no idea why that's happening, would you mind inviting me so i can take a look at your setup?
1393074872
Alex L.
Pro
Sheet Author
Update in OP: Made error handling a little better. Added two new options: NO_DAMAGE - only shows the powers doesnt inflict damage, heals, or status. NO_TARGET_ATTACKS - Lets you have an attack roll without a target (this will normaly throw an error)
1393321054
Alex L.
Pro
Sheet Author
Update in OP: Updated to include HB's newist power cards.
Damn, you're fast at updating, lol.
1393343011
Alex L.
Pro
Sheet Author
HoneyBadger said: Damn, you're fast at updating, lol. Your code was very easy to adapt.
1393364134

Edited 1393364287
Does it also include HB's update for the usage for Item powers as well? Edit: How does the script interact with damage that has multiple types?
1393365608
Alex L.
Pro
Sheet Author
Jarrod . said: Does it also include HB's update for the usage for Item powers as well? You can set the usage as item yes. Edit: How does the script interact with damage that has multiple types? It only does this for crit damage, are there many powers that do multipule types of damage?
Alex L. said: Jarrod . said: Does it also include HB's update for the usage for Item powers as well? You can set the usage as item yes. Awesome, I'll play around with it. Alex L. said: Edit: How does the script interact with damage that has multiple types? It only does this for crit damage, are there many powers that do multipule types of damage? Not a lot on the player end.. but there are a decent number of monster powers that deal dual-typed damage. As far as 4e rules go, unless you resist all the types of damage, you take full damage. Example: power does 1d10+7 fire and radiant power (like, an angelic fire attack) and you have a player with resist 5 fire. They would still take full damage. If said player had resist 5 fire and resist 10 radiant, they would resist 5 of the damage. A lot of this can be done on the GM side, I was just unsure if it was incorporated already.
1393366559
Alex L.
Pro
Sheet Author
Jarrod . said: Alex L. said: Jarrod . said: Does it also include HB's update for the usage for Item powers as well? You can set the usage as item yes. Awesome, I'll play around with it. Alex L. said: Edit: How does the script interact with damage that has multiple types? It only does this for crit damage, are there many powers that do multipule types of damage? Not a lot on the player end.. but there are a decent number of monster powers that deal dual-typed damage. As far as 4e rules go, unless you resist all the types of damage, you take full damage. Example: power does 1d10+7 fire and radiant power (like, an angelic fire attack) and you have a player with resist 5 fire. They would still take full damage. If said player had resist 5 fire and resist 10 radiant, they would resist 5 of the damage. A lot of this can be done on the GM side, I was just unsure if it was incorporated already. Yes i forgot about that, i will look at how to work that out.
Something I just noticed while updating all my macros.. the idea we discussed for having a query based on striker damage dice (such as backstab for rogues, quarry for hunters, and so on) prompted me to add those in as well.. it seems that when using xdy*?{query} in the -d section.. it returns an error in apicmd. I'll try to adjust macros to test around to find out what the extent of the complication of numbers is before it returns an error.
1393397909
Alex L.
Pro
Sheet Author
Jarrod . said: Something I just noticed while updating all my macros.. the idea we discussed for having a query based on striker damage dice (such as backstab for rogues, quarry for hunters, and so on) prompted me to add those in as well.. it seems that when using xdy*?{query} in the -d section.. it returns an error in apicmd. I'll try to adjust macros to test around to find out what the extent of the complication of numbers is before it returns an error. Should be fixed in the OP, looks like a bug in HB's code (that i copied over :P)
1393413063

Edited 1393415663
Gday Alex, Love the script. Can we get 'HIT' and MISSED text in the cards? Also, I don't see the target or the source anymore. Never mind, I just read your example scripts. I would still like to hide miss conditions or hit conditions. just so its clear i HIT , or MISSED. How would you handle two targets?
usually when its an ability that hits multipl targets i make 2 macros. 1 for the initial attack and damage roll with the explanation and what not then i make a "Thunderwave-2ndry" macro that includes a new attack but queries the user for a damage value. -a [[d20+7+?{Bonus to Attack?|0}']] -d [[?{Damage dealt?|0}]] i don't think there has been a good method to automate multiple target hits yet.
1393423084
Alex L.
Pro
Sheet Author
Kenny T. said: usually when its an ability that hits multipl targets i make 2 macros. 1 for the initial attack and damage roll with the explanation and what not then i make a "Thunderwave-2ndry" macro that includes a new attack but queries the user for a damage value. -a [[d20+7+?{Bonus to Attack?|0}']] -d [[?{Damage dealt?|0}]] i don't think there has been a good method to automate multiple target hits yet. Matt G. said: Gday Alex, Love the script. Can we get 'HIT' and MISSED text in the cards? Also, I don't see the target or the source anymore. Never mind, I just read your example scripts. I would still like to hide miss conditions or hit conditions. just so its clear i HIT , or MISSED. How would you handle two targets? If you check the OP, AOE/Multi Target attacks is something i am working on. I use modded rules for AOE (one roll for all) and dont know how i would represent it for the proper rules.
1393436892

Edited 1393445226
Thanks for the fix Alex! (Edit: Does this currently handle the insubstantial property at all?) AOE/Multi-target attacks are likely going to be the most challenging thing to automate. I've tried two things so far: 1) treat a burst/AOE as a power that repeats for each target in the burst- making a macro like a single target attack and just using it once on each target. 2) make an attack macro and roll that, then make a damage macro and roll that.. Then apply a direct damage GM macro to apply the damage. I think I'm leaning toward the first option for the sole reason of it being less complicated.
1393449258

Edited 1393449302
Jarrod . said: Thanks for the fix Alex! (Edit: Does this currently handle the insubstantial property at all?) AOE/Multi-target attacks are likely going to be the most challenging thing to automate. I've tried two things so far: 1) treat a burst/AOE as a power that repeats for each target in the burst- making a macro like a single target attack and just using it once on each target. 2) make an attack macro and roll that, then make a damage macro and roll that.. Then apply a direct damage GM macro to apply the damage. I think I'm leaning toward the first option for the sole reason of it being less complicated. I use the 1st method myself when doing AoEs but I've just had an idea, since usually AoE gives different damage per target so I still adjust manually. Is there a way of adjusting the values of multiple targets at the same time. If so I had the idea of like making two macros. One for the attack that if hits, marks the target with a marker assigned to AoE, then a damage macro that would damage those with that marker specifically and removing the AoE marker at the same time. It's just an idea and I'm wondering if it's possible.because it'd make the AoE/burst macros easy to do, if that was the case.
@Calhanol- There's nothing that let's you adjust multiple targets at once yet as far as I know. Alex, I noticed that the resistances and vulnerabilities aren't working with the new implementation of the power cards. (I feel like I'm always breaking your stuff with how much I'm posting.. sorry man)
1393542105
Alex L.
Pro
Sheet Author
Jarrod . said: @Calhanol- There's nothing that let's you adjust multiple targets at once yet as far as I know. Alex, I noticed that the resistances and vulnerabilities aren't working with the new implementation of the power cards. (I feel like I'm always breaking your stuff with how much I'm posting.. sorry man) They work i just dont display it anymore, as players dont really need to know that.
After a little testing I've found that resistances work as normal, deducting damage before applying.. but using a negative number to represent a vulnerability doesn't apply the vulnerable damage. Sorry, I should have done that testing first. I was basing my assumption on seeing the vulnerability not working.
Matt G. said: Gday Alex, Love the script. Can we get 'HIT' and MISSED text in the cards? Also, I don't see the target or the source anymore. Never mind, I just read your example scripts. I would still like to hide miss conditions or hit conditions. just so its clear i HIT , or MISSED. How would you handle two targets? If possible id like that function back too. Just stating clearly it hit the target and miss the target. :3
1394324061
Alex L.
Pro
Sheet Author
It will be back once i am done with the recode.
Yeah... sorry... the PowerCard stuff I wrote has absolutely no support for automating anything. Too much work, imo, for too little gain. There are just way too many powers in D&D 4e that alters someone else's roll or defenses.
1394524040
Gen Kitty
Forum Champion
I followed the directions at the top about having apicmd as the first script and this as the second script, and then I did your test of the four lines in chat that you had Jarrod do, and I got similar results. Help?
1394530221
Alex L.
Pro
Sheet Author
GenKitty said: I followed the directions at the top about having apicmd as the first script and this as the second script, and then I did your test of the four lines in chat that you had Jarrod do, and I got similar results. Help? You don't type them in chat, they almost have to be abilities (preferably token actions), there are ways around this but i cant see any reason why you would want to as every single token must be linked to a char sheet anyway for this to work.
If it helps, there's a character sheet generation script too to assist with all the work needed to make sheets..
1394688561
Gen Kitty
Forum Champion
Trying this again :) I put together this test sheet: Selected the token, fired off the ability, selected Esme as the target (because previous tests complained when i selected a non-character token) and got this: Please help?
I really need to make those error messages more verbose, huh? If you look in the API log window you should see the full error message.
1394697407
Alex L.
Pro
Sheet Author
John M. said: I really need to make those error messages more verbose, huh? If you look in the API log window you should see the full error message. You don't the exception is almost always an empty object.
1394702477

Edited 1394702616
Genkitty: Last time I ran into this issue was when I forgot to link my target token to a character sheet. also, not sure if it matters but all of my stats are in the "current" column rather than the "max" column
1394703261
Alex L.
Pro
Sheet Author
This sort of thing will be fixed with the new version (mainly because i am not using apicmd) A quick preview: !ca-power @{selected|token_id} "Test Power" "testpower" !ca-check @{selected|token_id} "firstcheck" "testpower" --roll [[1d20+4+1d6]] --vs "ac" --target @{target|token_id} !ca-action @{selected|token_id} "dmgaction" "firstcheck" "testpower" --damage [[1d6+2]] --condition "hit" !ca-action @{selected|token_id} "txtaction" "firstcheck" "testpower" --text "[firstcheck.dmgaction.damage] damage" --textkey "Hit" --condition "hit" !ca-run @{selected|token_id} "testpower" gives this:
So, that's going to be the new form of macro then?
1394741032
Gen Kitty
Forum Champion
The token in question is linked to a character journal. I use the current column for mod values, the max column for stat values. When I tried the test heal again and checked the API Output Console line 1 was blank and line 2 only had empty an empty set of braces. And no, I'm not running this script at the same time as HoneyBadger's custom power cards. :&gt; I'm trying to evaluate scripts for my GM to see which is the better one for his pathfinder game. I guess I should just wait for the next update for this script before I resume testing and evaluation?
1394742647
Alex L.
Pro
Sheet Author
Jarrod . said: So, that's going to be the new form of macro then? That is the most basic example yes, i think with the exception of statuses you should be able to do every power in the game with the new setup.
Alex L. said: Jarrod . said: So, that's going to be the new form of macro then? That is the most basic example yes, i think with the exception of statuses you should be able to do every power in the game with the new setup. I feel like despite this being more to type out, it's actually going to be a lot easier to structure, look at, adjust, and deal with. You mentioned "with the exception of statuses".. did you mean things like bonuses/penalties to defenses.. or things involving status markers?
1394752965
Alex L.
Pro
Sheet Author
Jarrod . said: Alex L. said: Jarrod . said: So, that's going to be the new form of macro then? That is the most basic example yes, i think with the exception of statuses you should be able to do every power in the game with the new setup. I feel like despite this being more to type out, it's actually going to be a lot easier to structure, look at, adjust, and deal with. You mentioned "with the exception of statuses".. did you mean things like bonuses/penalties to defenses.. or things involving status markers? Statuses would be anything applied to something, be that debuffs, buffs, dots, etc Also I haven't put status icons in yet although that will take all of 5 seconds. Statuses will be in as will AOEs they will just take some time to get right.
The AOE inclusion is exciting. It streamlines a lot more (although I've had my players use the macro for each target). Do you mind if I ask how you're approaching it? Also, will we be able to add "@number" after the status to allow for something like "and the target takes ongoing 5 damage -H chemical-bolt@5"?
1394763346
Gen Kitty
Forum Champion
I look forward to seeing how the AoE macros work out as well. I currently have 7 macros for each ammo kind used by the Dragon Pistol in the Pathfinder game I play in, depending on how many targets are in the AOE of the blast, and it's a very ugly set of macros.