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

[Script] Alien RPG Dice Roller, release notification

1637734937

Edited 1644053130
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
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. Changelog: Version 1.01: resolved display issue of optional labels and messages.  Version 2.00: [Coming soon] Updates sheet stress when pushing rolls. 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
Compendium Curator
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
Compendium Curator
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.  
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
Compendium Curator
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
Compendium Curator
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. 
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
Compendium Curator
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.
Thanks Richard, but I can wait, don't worry.
1639494522

Edited 1639494627
Alex
Plus
Hello! Thank you for this. Quick question: Is it possible to get the push feature in the output while using the "buttons" from the character sheet, or is it only active through the command line? I can see it when I use the command line, but not when I use the buttons.
1639500737
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Hi Alex, I am working on an update to the sheet which will make this possible, basically by making the sheet send the right data to the API Script instead of you having to do it.  This work got a bit delayed, but am hoping to get it done and sent in this coming weekend. So, perhaps a little Christmas gift for all you Space marines out there... /Richard
Sounds like a good Christmas gift! Thank you!
1639541637
vÍnce
Pro
Sheet Author
I do this on the FBL sheet.  If you choose to use the API roller, the buttons swap out and send the current dice pool state to the API roller instead of using the roll template.
1639553409
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Hi Vince, that is indeed the plan!  I learned a lot from your FBL sheet, and even used it to base the next generation MY0 sheet on. So, this will be something similar, only way I have found to cover the push mechanics (but havent given up on a roll parsing and roll template driven option yet). 
Hi! There was an update to the character sheet, yesterday or recently? Anyway, we enjoyed it for our very first game, and it was awsome to see all the issues I had with the previous sheet addressed. Thank you!
1641639456
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Great to hear Alex!
Hey There! Love the script! One thing - When pushing rolls 1 stress point is supposed to be added but it doesn't seem like the push button is doing that? Thanks for any help!
1643192356
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Hi, Thanks for the reminder Michael V, updating the sheet was not part of the original release but I am currently finalizing a version of the script that will add the stress automatically to the sheet.  This will be using the parameter --runas which the sheet already uses to display the character name (rather than the player name). It will check for the name in the runas parameter and update that sheet accordingly. This means it can be used as a standalone script outside of the sheet and still update the stress, provided the --runas parameter has the correct name included.  Best Regards, Richard W
1644052971
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Hi Community, I am finalizing a version of the script that will add the following:&nbsp; Updating sheet Stress when pushing. When using the --runas parameter, and a character with corresponding name exists, updates the stress checkboxes by checking the first unchecked box and also the total stress value when pushing, in addition to also adding the additional stress die to the pushed roll.&nbsp; Show all dice. It displays previous Success and Trauma (facehugger) dice in a grayed out manner when pushing to give a better visual overview of the result. Label on push button is now "Push (Stress +1)". Displays "Push: [Roll name]" to clarify the roll was pushed, and if pushing further than the first time it will say "2nd Push: ", "3rd Push: ", and so on.&nbsp; If the Label and Message in a parameter is empty, it will not include the row in the output. This happens when using attacks and not having anything added to the weapon/armament notes. For anyone who wants to test this prior to release later in the week, you can add it if you are a Pro account. The script code is here:&nbsp; <a href="https://github.com/dwarfwing/AlienzRoller/blob/main/AlienRPGroller/AlienRPG.js" rel="nofollow">https://github.com/dwarfwing/AlienzRoller/blob/main/AlienRPGroller/AlienRPG.js</a>. &nbsp;