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

Help with api macros for my homebrew game , will pay $

Hi my name is jeffreyjames and i have my own game system i run called firewinds of the suns ( spacewestern ),&nbsp; and&nbsp; firewinds of the seas (medieval fantasy) . i have been on roll 20 for 3 years with a pro account roll 20 is kinda built around 5e,&nbsp; so being a homebrew game creator i have to set up my own character sheets and write my own macros for buttons,&nbsp; i run my game with the default roll20 character sheet and NON API Macros that i have written for the weapon attacks, aimed weapon attacks,&nbsp; healing rolls, and magic spells My game uses a targeted ac system so&nbsp; if the attack roll (d20+skillbonus+weapon bonus) is&nbsp; Natural 1) player must roll dice of shame Natural 2) an attack of opportunity out of turn by GM 3-10) complete miss 11-12) left arm 13) left leg 14) right leg 15-16) right shooting arm&nbsp; 17-19) torso chest&nbsp; Natural 19) torso chest + an extra turn 20+) 2X damage to head Natural 20) is a special bonus and 2x damage to the head Here is an example of the attack roller i am using now and a photo of what it puts out &nbsp; &amp;{template:default} [[ [[1d20]] + [[@{Fighting}]] + [[1]] ]] {{name= +1 SWORD Fighting Attack Roll }} {{[ ](<a href="https://media.giphy.com/media/3on29QZskqV4ezNx9L/giphy.gif" rel="nofollow">https://media.giphy.com/media/3on29QZskqV4ezNx9L/giphy.gif</a>)}}&nbsp; &nbsp;{{ Rolls a D20 $[[0]]}} {{ + $[[1]] Skill Points}} {{ $[[2]] SPECIAL ITEM&nbsp; }} {{==$[[3]] **TOTAL HIT**}} {{ If $[[0]] is: 1 Roll Dice of Shame, 2 Attack of opportunity, 19 2nd Action, 20 Game Bonus }}{{ If $[[3]] is: 20+ Scores Double Damage to Head, 19-18-17 Damage to Torso, 16-15 Damage to Lead Weapon Arm-Hand, 14 Lead Leg, 13 Off Leg, 12-11 Off Arm-Hand, 10-3 Miss&nbsp; }}{{ Weapon +1 SWORD [[1D8+4+1]] TOTAL DAMAGE }} unfortunately i have to look every time to see if it was a natural 1 or 2 or 19 or 20 before the modifiers and then decode where the hit was at on the body this kinda slows down my game as i am playing it, what i would like to do is learn to use the API to show where the attack hit with a default image of that area and the total damage , adjusted 2x if it is a head it , or images for the Miss, Attack of opportunity, and dice of shame, extra turn or nat 20 , if the d20 is a 1, or 2, or 3-10 , or 19 or 20. my goal would be outputs that look like this &nbsp;or&nbsp; or&nbsp; i have tried to find videos on youtube on how to use the api but they all seem to use 5e sheets and not the default character sheet for roll20 so it makes it a little more complicated and i need someone to walk me through using the api for the first time i have discord and i can paypal you money if you have time to help , please let me know what you would charge
1700950753

Edited 1700951703
This sounds pretty doable with a few different mods. I'm more knowledgeable about scriptcards and could probably help you out tomorrow with a scriptcards based macro. The Metascript toolbox can also probably work with you. These should all be system agnostic for the most part. EDIT: Link to ScriptCards documentation Meta-Toolbox Wiki link
1700955235
timmaugh
Pro
API Scripter
Yep... I agree with Joshua: either ScriptCards or the MetaScriptToolbox can help with that. Or, heck, even a combination of the two. It looks like you have a "color" image (the animated gif), and then you have location images for the body part that was hit. Ideally, I'd put these into rollable tables so that you didn't have to use the URL in your command line (Muler can retrieve the image from the rollable table based on the body part that was hit). If you have a table of attack=&gt;color image (or character=&gt;color image, if that makes more sense), then the color image can be looked up at execution time so that the right image is returned. Same for the location image (or the miss), but I'd have these in their own table, just for clarity. To give a full example, though... I'd probably also want to incorporate the dice of shame. Is that something that we could roll automatically if the result of $[[0]] was a 1? Or at least we could put a button in the output to let the player roll the dice of shame by clicking (if you wanted them to still have the experience of making it happen). So, to incorporate that... what is the mechanic of the dice of shame?
this is the button i have for the dice of shame ,&nbsp; that would be cool if it put a button for them to roll in a failed attack roll&nbsp; <a href="https://s3.amazonaws.com/files.d20.io/images/321437309/AwIZd6WzbYNhAigNTWKZzg/max.png?1672985673" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/321437309/AwIZd6WzbYNhAigNTWKZzg/max.png?1672985673</a> &amp;{template:default} [[ [[1d6 ]]&nbsp; &nbsp;[[{{name= THE DICE OF SHAME}} [[{{ DICE OF SHAME TOTAL $[[0]] }} {{ IF $[[0]] is 1) Hits Self, 2) Hits Teammate,&nbsp; 3) Captured,&nbsp; 4) TKO, 5) Loses Item, 6) Mission Failure. }}
Ok FotS, Here is an early proof of concept using ScriptCards !scriptcard {{ --/|ScriptCard for Firewinds custom weapon attack --/|Requires a selected token --/|VARIABLES TO SET --&amp;SkillAttributeName|Skill --&amp;WeaponBonusAttribute|Weapon --&amp;WeaponResultTable|weapon-results --&amp;ShameResultTable|shame-results --&amp;WeaponDamageDie|d8 --#title|Fighting Attack Roll --#sourceToken|@{selected|token_id} --#reentrant|FotSWeapon[*S:character_id] --~|array;fromtable;weaponResultsArr;[&amp;WeaponResultTable];both --=AtkRoll|1d20 + [*S:[&amp;SkillAttributeName]] [SKILL] + [*S:[&amp;WeaponBonusAttribute]] [WEAPON] --?[$AtkRoll.Base] -eq 1|Shame --?[$AtkRoll.Base] -eq 2|GMRoll --?[$AtkRoll.Base] -eq 19|ExtraTurn --?[$AtkRoll.Base] -eq 20|Bonus --?[$AtkRoll] -lt 11|&gt;Result;miss --?[$AtkRoll] -lt 13|&gt;Result;left arm --?[$AtkRoll] -eq 13|&gt;Result;left leg --?[$AtkRoll] -eq 14|&gt;Result;right leg --?[$AtkRoll] -lt 17|&gt;Result;right arm --?[$AtkRoll] -lt 20|&gt;Result;torso --?[$AtkRoll] -ge 20|&gt;Result;head --:Done| --X| --:GetWeaponResultsImage|Result;StringVariableToSet --&amp;[%2%]|NotFound --%gwrItem|foreach;weaponResultsArr --~gwrItemSplit|string;split;|;[&amp;gwrItem] --?"[&amp;gwrItemSplit1]" -eq "[%1%]"|[ --&amp;[%2%]|[&amp;gwrItemSplit2] --%!| --]| --%| --&lt;| --:Shame| --&gt;GetWeaponResultsImage|shame;ShameImg --+|[b]Natural One[/b][img][&amp;ShameImg][/img][br]Roll the Dice of Shame[br][rbutton]Dice of Shame::ShameRoll;1[/rbutton] --&gt;Done| --:GMRoll| --+|[b]Natural Two[/b][br]Off-balance miss results in an attack of opportunity --*|[*S:character_name] got a 2! Attack of Opportunity. Possibly add a button here? --&gt;Done| --:ExtraTurn| --+|[b]Natural 19![/b]Gets another action! --&gt;Result|torso --&gt;Done| --:Bonus| --+|[b]Natural 20![/b]Roll bonus! Possibly add a button for that roll here? --&gt;Result|head --&gt;Done| --:Result|ResultLocation --&gt;GetWeaponResultsImage|[%1%];ResultImg --+Rolls a D20|[$AtkRoll][br][img][&amp;ResultImg][/img] --?"[%1%]" -eq "miss"|Done --+Hits|[%1%] --&amp;DmgMultiplier|1 --?"[%1%]" -eq "head"|&amp;DmgMultiplier;2 --=DmgRoll|1[&amp;WeaponDamageDie] + [*S:[&amp;SkillAttributeName]] [SKILL] + [*S:[&amp;WeaponBonusAttribute]] [WEAPON] * [&amp;DmgMultiplier] [MULTIPLIER] --+Weapon|[$DmgRoll] [b]TOTAL DAMAGE[/b] --&gt;Done| --:ShameRoll| --=DiceShameResult|[T#[&amp;ShameResultTable]] --+Dice of Shame Result|[$DiceShameResult.tableEntryText] --&gt;Done| }} This does assume a selected token linked to a character. The top of the ScriptCard has some variables you can set to match your game. This does assume the Skill and Weapon are attributes of the character, not sure how weapons work on your sheet so that will probably need to get updated. Currently the weapon damage is hardcoded in a variable there but can be pulled from the character sheet as well. This does require ScriptCards mod be installed and 2 rollable tables with the weapon results and the dice of shame results. The weapon result table I used for testing is based on your posts: That will lookup the attack roll result against that table and grab the images for the matching result. Note the API is limited to using Non-marketplace images so all the images I used are uploaded into my library and linked from there. For more information on ScriptCards, there is the Wiki . Here is a&nbsp; Nick Olivo video &nbsp;where Nick goes through building a macro with a ScriptCard.&nbsp; Currently open ScriptCards thread .&nbsp; Thread with a lot of working examples. &nbsp;Admittedly much are 5e based but still show examples of how to do things in ScriptCards. There is also a Discord from Kurt J with many folks very knowledgeable about ScriptCards and automation. Hopefully the above is a good enough example to get you started with how you want things. Happy to answer any questions you have.&nbsp;
i was watching a Nick Olivo video and he was using PowerCards , is scriptcards better for what i need? seems i can run powercards without have to select a target
PowerCards is older. Kurt J took over maintaining PowerCards but he also created ScriptCards to overcome some of the limitations of Powercards so ScriptCards is still actively developed while Powercards is mostly in maintenance mode, is my understanding. ScriptCards doesn't require you to have anything selected. It's just a common and often the easiest way to get the attacking character is to have a token selected so that character's attributes and abilities can be used in the macro. In fact, I have many ScriptCard based macros that don't require a selected token. Another common and easy way is to add a macro under Abilities on the character sheet as a way to having an easy way to find the specific character using the ability. I don't know PowerCards so I can't really help you if you want to go down the PowerCard route. It might be doable to accomplish everything you want in PowerCards, not sure, but ScriptCards is quite flexible and I'm much more certain of it being able to accomplish what you want. Not saying ScriptCards is the only way to accomplish it but it is the method that I personally use the most and the one I can best help with. There are other folks that use other mods and accomplish a great deal many things and have different setups with macro mule characters and other setups so it's all about finding what setup works best for you.
Thank you everyone for the help, Timmaugh came though and spent 4 hours helping me and we came up with a template i can use , and i cant wait to put it into my game this season&nbsp; He is the absolute best ! my game is going to be so much better now . i animated a few of my games if you want to see it being played&nbsp;<a href="https://youtu.be/14dlw06mt9w?si=eXy0ZwwCffQto-rz" rel="nofollow">https://youtu.be/14dlw06mt9w?si=eXy0ZwwCffQto-rz</a>