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

[Script] Alien RPG Dice Roller, release notification

1637734937

Edited 1638541024
Richard W.
Pro
Sheet Author
API Scripter
Alien RPG Dice Roller, version 1.01 The Alien RPG Dice Roller adds an API option for rolling dice according to the Alien RPG Year Zero Engine including Base and Stress Dice as well as Push mechanics.  The script is based on The Aarons Mutant Year Zero script, described  here .  This is the first version of the script, and can be used on its own or together with the upcoming update to the Alien RPG Character sheet (version 2.02). The version 1.01 resolved an issue in the display of the optional labels and messages, and replaces version 1.00 as the latest. Commands:  !alienr [roll name] [[base dice]] [[stress dice]] --label|message --label|message Roll name : An optional name for the roll in single square brackets. The roll name can be omitted, which leads to the field not appearing in the chat output. Example [Ranged Combat] or [M41A Pulse Rifle] Base dice: An inline dice expression in double square brackets rolling the d6s. 6s are counted as a success (crosshair symbol). Example: [[4d6]] Stress dice: An inline dice expression in double square brackets rolling the d6s. 6s are counted as a success (crosshair symbol). 1s on stress dice are counted as Panic (Alien facehugger symbol). Example: [[2d6]] Label and Message: An optional set of input with a label and message, or key and value if you like, to be shown below the dice roll (see example of output below). Label may be omitted to just provide a text field, e.g. " --|This is my message". You can specify as many optional fields as you like, separated by space. Example: " --Talent|Hard Hitter" or "--Target|Alien 2".  The label "runas" is a special case, when used its value will replace the Character name at top of the chat output. This can be used by GMs to specify what NPC or Monster performs an action, and will be used in the upcoming character sheet to ensure the sheet character name is used.  !alienrw [roll name] [[base dice]] [[stress dice]] --label|message --label|message Whisper command works the same as above but uses the !alienrw command.  !alienr   Running the !alienr command without any additional arguments will output a help text, similar to the information in this post.  !alienr-config    The configuration options are the same as the Mutant Year Zero script, reachable through command "!alienr-config" without any arguments.  Output: Output from the script is made to look similar to the existing roll template. Push Button : Please note the additional Push button, which will reroll only the eligible dice and bring with it any successes or panic rolls from the previous roll. Only the latest roll can be pushed, trying to push an old roll will produce an error. There is no limit to the number of pushes.  Feedback: Looking forward to hearing about feedback or any potential issues with the script, either add your comments here or send me a personal message. 
1637756809
Andreas J.
Forum Champion
Sheet Author
Translator
Ooh, nice, it's already in the One-Click menu.
1637864564
Richard W.
Pro
Sheet Author
API Scripter
FYI, I have found an issue with the Optional inputs, working on resolving those and will publish an updated version once resolved.  Best Regards, Richard W
1637867936
Richard W.
Pro
Sheet Author
API Scripter
Update on fix: Identified the issue as a the output object from _.omit when checking if label is "runas", it need to be an array to work later in the script so replaced it with a reversed iteration and splice from array. The code is checked in and waiting for publication.  
1638198425
I have a stupid question (I'm a complete noob), but how do you use it? Do you always have to type the commands in the chat? Or is it possible to bind the commands to the skills : by example, I press the name of the skill, and instead of rolling the default dices, it will use your script.
1638202906
Richard W.
Pro
Sheet Author
API Scripter
Hi, great question that requires some clarification, it does sound cumbersome to use the commands all the times, right? So, my plan is to integrate this in the Character Sheet so that when enabled the buttons in the sheet will use the API Script (requires a Pro account). But, there needs to be a script before I can finish the work on the sheet, so I hope the new sheet version will be published in a week. When integrated in the sheet, you will be able to roll for a skill, and then push the roll in the chat (which is currently a very manual process).  Until then, you could build your own macros for the different skills and rolls so that you don't have to type the commands, or keep using the sheet as it has been up till now.  When the Sheet is released I will write a similar post on the new optional functionality in it. 
1638205263
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Richard, Just a general sheet design question as a fellow sheet author, but why not use custom roll parsing to negate the need for an API roller script?
1638205843

Edited 1638205887
Richard W.
Pro
Sheet Author
API Scripter
Hi Scott, I gave startRoll a go, but I found the Year Zero Engine mechanics of Pushing rolls difficult to implement since it requires adding either a button in the chat output (roll template) or building the mechanics into the sheet itself by holding the next push roll dice in attributes. The former turned out to be difficult with buttons in the roll template not being optimal, and the latter would work in the other YZE sheets with their Dice Pools but harder to do without major changes in the Alien RPG one. I think the Alien sheet get what is needed by re-using (or stealing with pride) the excellent Dice Roller API script that The Aaron already have created. So, sticking to what is known and how the other YZE sheets work to bring pushing rolls to the sheet faster, basically.   I haven't given up on adding the push roll mechanics without the need for an API script, but might give the other sheets a go first using their Dice Pools. 
1638212534
Richard W. said: I hope the new sheet version will be published in a week That's good to know. Thanks! My next game is on the 6th of November ;-)
1638214664

Edited 1638215087
vÍnce
Pro
Sheet Author
Scott C. said: Hi Richard, Just a general sheet design question as a fellow sheet author, but why not use custom roll parsing to negate the need for an API roller script? I would love to replace the Forbidden Lands dice pool. FBL uses up to 6 unique dice with 1-10 dice thrown for each. Pushing re-rolls all but 1's and 6's. Makes for a HUGE roll template. I haven't had time to jump into the new CRP feature to try and figure it out.  Still waiting for you trailblazers to show us the way. ;-P
1638248309
Richard W.
Pro
Sheet Author
API Scripter
Hi Vince, I managed to use StartRoll to make the roll template smaller for Alien, which is at least one good thing come out of it. By doing that I could use multi-dice roll instead of single 1-dice rolls, i.e. one [[5d6]] instead of 12x [[1d6]] and filter away the ones not used, and then output the dice in a similar fashion to now. Didn't implement this properly yet, might make this my next project for later version... I haven't had much luck with buttons in roll templates, this is the major one for allowing pushing rolls but might be able to keep that in the sheet instead, and push rolls from there by using previous results stored in attributes. Another annoyance is that the CSS for roll templates is filtered, so you cannot use things like flex display.  Doctor, I am guessing you meant 6th December? The way that Sheets are published on a weekly basis, I am afraid that the new sheet will not be available in time for your next session. If you would like to run this next version of the sheet in that session, then I can give you access to download my files before it gets published. You can send me a PM if you are interested, and we can sort that out.
1638249947
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hey Rich, Don't want to derail this thread further than I already have (sorry about that), but flex and CSS grid are usable in roll templates. Drop by the r/roll20 discord or open a new thread and we can hash out what's going wrong for you there along with your button issue.
1638277694
Thanks Richard, but I can wait, don't worry.