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

Unusual Roll Mechanics (SLA Industries)

I'm brand new to Roll20 (though not to basic HTML and CSS), and I'm looking for a way to achieve Skill check dice roles for SLA Industries, 2nd Edition. I'm building a very basic Character Sheet, and trying to automate dice rolls. In SLA Industries a Skill check works as follows. Roll 1 Success die (d10) plus a number of Skill die based on your Rank in that Skill + 1. You add both your basic related-stat (e.g. Dexterity) and your Rank in the specific skill, to every dice to determine if those dice succeed. The Success die determines basic success (pass/fail), while the Skill die successes determine the level of success (or bonus damage in combat). I'm not looking for anything more complex than rolling a variable number of dice, depending on a Skill Rank. At the moment, I've got as far as: <button type='roll' name='roll_acrobatics' value='@{name} rolls an ACROBATICS test. Success Dice: [[{1d10 + @{DEX} + @{acrobatics}}]] Skill Dice: [[{1d10 + @{DEX} + @{acrobatics}}]]'></button><br /> Basically, I'm looking to repeat the final dice roll a specific number of times - e.g. acrobatics +1. Can anyone help?
1616376493

Edited 1616376636
GiGs
Pro
Sheet Author
API Scripter
There's no way to automatically do this part in a macro: Basically, I'm looking to repeat the final dice roll a specific number of times For these, you either need to build the macro using a query, where you build in a row for every possible number of dice, or use a custom API script. Also you dont need to use a custom script, if a script someone else has created will do the job. I think you should be able to do this with the ScriptCards script.
May or May not help but can't wait to see a working 2e sheet so thanks for the effort you've put in. On the SLA discord someone has managed to solve it for the 2e sheet they have put together and have submitted it to Roll20 "i have the sheet working, it has the s5s dice rolls working, for all the skills.. i've submitted it.. just waiting on roll20s crew to ok it... -- it is my second attempt the first was rejected as i'd used table tags - so i recoded it all using DIV tags - that only took my about 10 hours.." Maybe jump on the discord and ping them a message or wait for it to pass review and then see the code in Github if you need a link to the discord let me know and I can splat one your way
1616504232

Edited 1616504732
David M.
Pro
API Scripter
I'm not familiar with the mechanics, but something like this might get you on the right track using scriptcards as GiGs mentioned. I only included two skills (using two different attributes), so you could expand as necessary. I also wasn't sure of the success level mechanics, so am just outputting the number of rolls at or above the target difficulty. !scriptcards {{ --:INITIALIZE VARIABLES| --:(ADD MORE ATTRIBUTES VARIABLES HERE)| --=DEX|@{selected|DEX} --=STR|@{selected|STR} --&skill|?{What skill?|acrobatics,acrobatics|athletics,athletics} --=ranks|[*@{selected|token_id}:[&skill]] --=DC|?{Select target difficulty|6} --=successLevel|0 --:HEADER INFO| --#title|Skill check: [&skill] --#leftsub|Ranks: [$ranks] --#rightsub|Target DC: [$DC] --:CREATE LOOP BASED ON SELECTED SKILL| --=i|0 --=numIterations|[$ranks] + 1 --:RollLoop| --=i|[$i] + 1 --:ADD MORE CONDITIONALS/SKILLS HERE AND CREATE MORE PROCEDURES BELOW| --?[&skill] -inc acrobatics|>AcrobaticsRoll --?[&skill] -inc athletics|>AthleticsRoll --?[$i.Total] -eq 1|>PassFailCheck|>SuccessLevelCheck --?[$i.Total] -lt [$numIterations.Total]|RollLoop --+Success rolls:|[&SuccessLevelDice] --+Level of Success:|[$successLevel] --X|End macro --:PROCEDURES| --:(COPY THIS NEXT PROCEDURE AND SUBSTITUTE ATTRIBUTE FOR ALL SKILLS)| --:AcrobaticsRoll| --=roll|1d10 + [$DEX][DEX] + [$ranks][Ranks] --<| --:AthleticsRoll| --=roll|1d10 + [$STR][STR] + [$ranks][Ranks] --<| --:PassFailCheck| --+Main Check:|[$roll] --+...vs DC:|[$DC] --?[$roll] -ge [$DC]|>SuccessOutput|>FailOutput --<| --:SuccessLevelCheck| --&SuccessLevelDice|+[$roll] --?[$roll] -ge [$DC]|>AddSuccess --<| --:SuccessOutput| --+Result:|[b][#009900]~~~SUCCESS~~~[/#][/b] --<| --:FailOutput| --+Result:|[b][#ff0000]~~~FAILURE~~~[/#][/b] --X|End macro --<| --:AddSuccess| --=successLevel|[$successLevel] + 1 --<| }} Sample output:
This is fantastic! Thank you so much! I've added in all the additional skills as well - thanks for all the comments. It makes complete sense not to role the Level of Success dice if there is a Main Check failure. However, in SLA Industries you roll the whole dice pool, and if all dice fail, then that is a major failure... so I've stripped out the End Macro line, allowing the Success Dice to roll in order. This is more of a API / Character Sheet follow-up question... is there a way of including script cards in Character sheets so they are 'portable', rather than having to C&P them into Macros for every game? Or is that not the done thing?
1616605189

Edited 1616606181
David M.
Pro
API Scripter
Sure, if you make the scriptcards "macro" into a character ability instead of a collections macro, you can port it into another game through the character vault or transmorgifier. Obviously the destination game would have to have Scriptcards installed, though. EDIT - you could add another conditional for a major failure. I would probably pass a text string parameter to the FailOutput procedure so you could re-use that code. So, add something like this after the "--+Level of Success..." line  --?[$successLevel.Total] -eq 0|>FailOutput;~~~Major Failure~~~ Your FailOutput procedure would be modified to this. Note that [%1%] is a variable that represents the first parameter passed to the procedure. --:FailOutput| --+Result:|[b][#ff0000][%1%][/#][/b] --<| And in your PassFailCheck procedure, modifiy this line to pass the general failure text  --?[$roll] -ge [$DC]|>SuccessOutput|>FailOutput;~~~Failure~~~ You can test by setting a skill check to a super-high DC.
This has been so helpful in helping me get going with this. Thank you so much. I've attached the complete script below in case anyone would like to use in the future - is there a official repository for Scriptcard scripts? The last question - adding one more condition. For a Major Failure to occur ALL the Skill dice have to fail (as in the current functionality), AND the Success dice. A major failure only occurs when all dice fail (and suitably catastrophic punishment is meted out by the GM). Apologies for getting you to do the brain work for me! Here's ther Skill Check code for SLA Industries 2nd Edition: !scriptcards {{ --:INITIALIZE VARIABLES| --:(ADD MORE ATTRIBUTES VARIABLES HERE)| --=strength|@{selected|strength} --=dexterity|@{selected|dexterity} --=knowledge|@{selected|knowledge} --=concentration|@{selected|concentration} --=charisma|@{selected|charisma} --=cool|@{selected|cool} --&character_name|@{selected|character_name} --&skill|?{What skill?|Acrobatics,acrobatics|Admin & Finance,admin|Appraisal,appraisal|Bribery,bribery|Climbing,climbing|Computer,computer|Demolitions,demolitions|Detect,detect|Diplomacy,diplomacy|Drive: Civilian,driveciv|Drive: Military,drivemil|Drive: Pilot,drivepilot|Drive: Motorcycle,drivemot|Education: Academic,eduacad|Education: Natural,edunat|Forensics,forensics|Forgery,forgery|Gambling,gambling|Haggle,haggle|Interrogate,interrogate|Intimidate,intimidate|Language: Biya,langbiya|Language: Gristle,langgristle|Language: Neophon,langneo|Language: Shaktar,langshak|Language: Sign,langsign|Language: Wraithen,langwraith|Leadership,leadership|Lockpick: Manual,lockpickman|Lockpick: Electrical,lockpickelec|Lore: Cult,lorecult|Lore: Dream,loredream|Lore: Sector,loresector|Medical,medical|Melee Weapons,meleewpn|Optimise,optimise|Oratory,oratory|Persuasion,persuasion|Pistol,pistol|Polearm,polearm|Read Lips,readlips|Rifle,rifle|Seduction,seduction|Shield Craft,shieldcraft|Sleight,sleight|Stealth,stealth|Streetwise,streetwise|Support Weapons,supportwpn|Survival,survival|Swimming,swimming|Tactics,tactics|Technical: Electrical,techelec|Technical: Manual,techman|Technical: Weapons,techwpn|Throw,throw|Torture,torture|Tracking,tracking|Unarmed Combar,unarmed|Awareness,awareness|Blast,blast|Communicate,communicate|Enhance,enhance|Heal,heal|Protect,protect|Reality Fold,realityfold|Telekinesis,telekinesis|Thermal,thermal} --=ranks|[*@{selected|token_id}:[&skill]] --=DC|?{Select target difficulty|10} --=successLevel|0 --:HEADER INFO| --#title|[&character_name] skill check: [&skill] --#leftsub|Ranks: [$ranks] --#rightsub|Target DC: [$DC] --:CREATE LOOP BASED ON SELECTED SKILL| --=i|0 --=numIterations|[$ranks] + 2 --:RollLoop| --=i|[$i] + 1 --:CONDITIONALS/SKILLS HERE| --?[&skill] -inc acrobatics|>AcrobaticsRoll --?[&skill] -inc admin|>AdminRoll --?[&skill] -inc appraisal|>AppraisalRoll --?[&skill] -inc athletics|>AthleticsRoll --?[&skill] -inc bribery|>BriberyRoll --?[&skill] -inc climbing|>ClimbingRoll --?[&skill] -inc computer|>ComputerRoll --?[&skill] -inc demolitions|>DemolitionsRoll --?[&skill] -inc detect|>DetectRoll --?[&skill] -inc diplomacy|>DiplomacyRoll --?[&skill] -inc driveciv|>DrivecivRoll --?[&skill] -inc drivemil|>DrivemilRoll --?[&skill] -inc drivepilot|>DrivepilotRoll --?[&skill] -inc drivemot|>DrivemotRoll --?[&skill] -inc eduacad|>EduacadRoll --?[&skill] -inc edunat|>EdunatRoll --?[&skill] -inc forensics|>ForensicsRoll --?[&skill] -inc forgery|>ForgeryRoll --?[&skill] -inc gambiling|>GamblingRoll --?[&skill] -inc haggle|>HaggleRoll --?[&skill] -inc interrogate|>InterrogateRoll --?[&skill] -inc intimidate|>IntimidateRoll --?[&skill] -inc langbiya|>LangbiyaRoll --?[&skill] -inc langgristle|>LanggristleRoll --?[&skill] -inc langneo|>LangneoRoll --?[&skill] -inc langshak|>LangshakRoll --?[&skill] -inc langsign|>LangsignRoll --?[&skill] -inc langwraith|>LangwraithRoll --?[&skill] -inc leadership|>LeadershipRoll --?[&skill] -inc lockpickman|>LockpickmanRoll --?[&skill] -inc lockpickelec|>LockpickelecRoll --?[&skill] -inc lorecult|>LorecultRoll --?[&skill] -inc loredream|>LoredreamRoll --?[&skill] -inc loresector|>LoresectorRoll --?[&skill] -inc medical|>MedicalRoll --?[&skill] -inc meleewpn|>MeleewpnRoll --?[&skill] -inc optimise|>OptimiseRoll --?[&skill] -inc oratory|>OratoryRoll --?[&skill] -inc persuasion|>PersuasionRoll --?[&skill] -inc pistol|>PistolRoll --?[&skill] -inc polearm|>PolearmRoll --?[&skill] -inc readlips|>ReadlipsRoll --?[&skill] -inc rifle|>RifleRoll --?[&skill] -inc seduction|>SeductionRoll --?[&skill] -inc shieldcraft|>ShieldcraftRoll --?[&skill] -inc sleight|>SleightRoll --?[&skill] -inc stealth|>StealthRoll --?[&skill] -inc streetwise|>StreetwiseRoll --?[&skill] -inc supportwpn|>SupportwpnRoll --?[&skill] -inc survival|>SurvivalRoll --?[&skill] -inc swimming|>SwimmingRoll --?[&skill] -inc tactics|>TacticsRoll --?[&skill] -inc techelec|>TechelecRoll --?[&skill] -inc techman|>TechmanRoll --?[&skill] -inc techwpn|>TechwpnRoll --?[&skill] -inc throw|>ThrowRoll --?[&skill] -inc torture|>TortureRoll --?[&skill] -inc tracking|>TrackingRoll --?[&skill] -inc unarmed|>UnarmedRoll --?[&skill] -inc awareness|>AwarenessRoll --?[&skill] -inc blast|>BlastRoll --?[&skill] -inc communicate|>CommunicateRoll --?[&skill] -inc enhance|>EnhanceRoll --?[&skill] -inc heal|>HealRoll --?[&skill] -inc protect|>ProtectRoll --?[&skill] -inc realityfold|>RealityfoldRoll --?[&skill] -inc telekinesis|>TelekinesisRoll --?[&skill] -inc thermal|>ThermalRoll --?[$i.Total] -eq 1|>PassFailCheck|>SuccessLevelCheck --?[$i.Total] -lt [$numIterations.Total]|RollLoop --+Success rolls:|[&SuccessLevelDice] --+Level of Success:|[$successLevel] --?[$successLevel.Total] -eq 0|>FailOutput;~~~Major Failure~~~ --X|End macro --:PROCEDURES| --:(ALL SKILLS)| --:AcrobaticsRoll| --=roll|1d10 + [$dexterity][dexterity] + [$ranks][Ranks] --<| --:AdminRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:AppraisalRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:AthleticsRoll| --=roll|1d10 + [$dexterity][dexterity] + [$ranks][Ranks] --<| --:BriberyRoll| --=roll|1d10 + [$cool][cool] + [$ranks][Ranks] --<| --:ClimbingRoll| --=roll|1d10 + [$strength][strength] + [$ranks][Ranks] --<| --:ComputerRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:DemolitionsRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:DetectRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:DiplomacyRoll| --=roll|1d10 + [$charisma][charisma] + [$ranks][Ranks] --<| --:DrivecivRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:DrivemilRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:DrivepilotRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:DrivemotRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:EduacadRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:EdunatRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:ForensicsRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:ForgeryRoll| --=roll|1d10 + [$dexterity][dexterity] + [$ranks][Ranks] --<| --:GamblingRoll| --=roll|1d10 + [$cool][cool] + [$ranks][Ranks] --<| --:HaggleRoll| --=roll|1d10 + [$charisma][charisma] + [$ranks][Ranks] --<| --:InterrogateRoll| --=roll|1d10 + [$cool][cool] + [$ranks][Ranks] --<| --:IntimidateRoll| --=roll|1d10 + [$cool][cool] + [$ranks][Ranks] --<| --:LangbiyaRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:LanggristleRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:LangneoRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:LangshakRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:LangsignRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:LangwraithRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:LeadershipRoll| --=roll|1d10 + [$charisma][charisma] + [$ranks][Ranks] --<| --:LockpickmanRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:LockpickelecRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:LorecultRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:LoredreamRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:LoresectorRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:MedicalRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:MeleewpnRoll| --=roll|1d10 + [$strength][strength] + [$ranks][Ranks] --<| --:OptimiseRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:OratoryRoll| --=roll|1d10 + [$charisma][charisma] + [$ranks][Ranks] --<| --:PersuasionRoll| --=roll|1d10 + [$charisma][charisma] + [$ranks][Ranks] --<| --:PistolRoll| --=roll|1d10 + [$dexterity][dexterity] + [$ranks][Ranks] --<| --:PolearmRoll| --=roll|1d10 + [$strength][strength] + [$ranks][Ranks] --<| --:ReadlipsRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:RifleRoll| --=roll|1d10 + [$dexterity][dexterity] + [$ranks][Ranks] --<| --:SeductionRoll| --=roll|1d10 + [$charisma][charisma] + [$ranks][Ranks] --<| --:ShieldcraftRoll| --=roll|1d10 + [$strength][strength] + [$ranks][Ranks] --<| --:SleightRoll| --=roll|1d10 + [$dexterity][dexterity] + [$ranks][Ranks] --<| --:StealthRoll| --=roll|1d10 + [$dexterity][dexterity] + [$ranks][Ranks] --<| --:StreetwiseRoll| --=roll|1d10 + [$knowledge][knowledge] + [$ranks][Ranks] --<| --:SupportwpnRoll| --=roll|1d10 + [$strength][strength] + [$ranks][Ranks] --<| --:SurvivalRoll| --=roll|1d10 + [$cool][cool] + [$ranks][Ranks] --<| --:SwimmingRoll| --=roll|1d10 + [$strength][strength] + [$ranks][Ranks] --<| --:TacticsRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:TechelecRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:TechmanRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:TechwpnRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:ThrowRoll| --=roll|1d10 + [$strength][strength] + [$ranks][Ranks] --<| --:TortureRoll| --=roll|1d10 + [$cool][cool] + [$ranks][Ranks] --<| --:TrackingRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:UnarmedRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:(FLUX SKILLS)| --:AwarenessRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:BlastRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:CommunicateRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:EnhanceRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:HealRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:ProtectRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:RealityfoldRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:TelekinesisRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:ThermalRoll| --=roll|1d10 + [$concentration][concentration] + [$ranks][Ranks] --<| --:(END OF SKILLS)| --:PassFailCheck| --+Main Check:|[$roll] --?[$roll] -ge [$DC]|>SuccessOutput|>FailOutput;~~~Failure~~~ --<| --:SuccessLevelCheck| --&SuccessLevelDice|+[$roll] --?[$roll] -ge [$DC]|>AddSuccess --<| --:SuccessOutput| --+Result:|[b][#009900]~~~SUCCESS~~~[/#][/b] --<| --:FailOutput| --+Result:|[b][#ff0000][%1%][/#][/b] --<| --:AddSuccess| --=successLevel|[$successLevel] + 1 --<| }}
1616763284

Edited 1616763395
David M.
Pro
API Scripter
Wow, that is a lot of skills! Looking at this again, I think the best thing would be to create a single roller procedure to replace the 68(!) individual skill procedures. To do this, you can pass multiple parameters to a Roller procedure separated by semicolons. Then, within the procedure you can reference these passed parameters with the notation [%1%], [%2%], etc. Example will follow later. As far as the major failure, you will have to have a way to store the initial roll to check against it later. You can pass the parameter [$i.Total] to the roller function and apply a conditional that copies the roll to a MainRoll variable if i=1, otherwise it skips over that step with a goto.  So, your generic roller function would become something like this: --:Roller| accepts (1)attribute variable, (2)attribute text for tooltip, and (3)i as parameters. If i=1, copies roll to MainRoll, otherwise skip over to RollDone line --=roll|1d10 + [%1%][%2%] + [$ranks][Ranks] --?[%3%] -gt 1|RollDone --=MainRoll|[$roll] --:RollDone| --<| You will have to modify your conditionals to pass the proper parameters. I have altered the first two below. Note we pass the attribute variable first (note the dollar sign), then some text containing "[AttributeName]" that will become the tooltip text, and finally the iteration number. All separated by semicolons. Kind of a pain, but it will save a couple hundred lines of redundant roller code :) --?[&skill] -inc acrobatics|>Roller;[$dexterity];[dexterity];[$i.Total] --?[&skill] -inc admin|>Roller;[$knowledge];[knowledge];[$i.Total] Since we now have the initial roll stored in the MainRoll variable, we can add an additional constraint to the Major failure conditional line using the "-and" syntax. The new conditional line will be as follows: --?[$successLevel.Total] -eq 0 -and [$MainRoll.Total] -lt [$DC] |>FailOutput;~~~Major Failure~~~ I think that will do it! Let me know how it turns out or if you have any other questions.