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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] Edge of the Empire Dice with Images in the Chat Window

1406175445
The Aaron
Roll20 Production Team
API Scripter
Hmm. I installed the script earlier and rolled 9 of every kind simultaneously about 20 times without error. You out mention the character sheet, you're rolling from a macro there? If you want to invite and GM me on a campaign, I can try and debug it tomorrow morning.
1406176367

Edited 1406177507
Andrew H.
API Scripter
Ok, I think I narrowed it down. If I click the roll button on the "-dicePool" character on the GM Dice tab, it will cause the error. All the other macro buttons seem to work fine. Edit: With this knowledge, I can at least use the sheet and script again. I just have to remember not to roll the GM dice pool directly. Which I don't need to do. Edit 2: I spoke too soon, the script will eventually error if I just let it sit there. :( But not the useual "Infinite Loop" problem
1406342382
The Aaron
Roll20 Production Team
API Scripter
Solved! It turns out that it was crashing after a minute of being started regardless of what was done in the game. The issue was revealed by the number of characters Andrew has in his campaign, 30. At startup, the script gets a list of all characters and passes them to the function setupCharacters(), which creates a characterID attribute, and then 15 numbered versions of 5 other attributes. However, it looks for the attribute first using findObjs(). Unfortunately, that meant it was doing 2280 findObjs() calls at startup. O.o The Author had tried to mitigate this problem by partitioning the characters and doing 2 of them every half a second. (152 findObjs() calls.) I rewrote that portion of the code to only do one findObjs() call per call to setupCharacters(). It will now do all characters as fast as it can print them to the log (and it's 109 lines shorter with 2 fewer functions!). Here's a GIST: <a href="https://gist.github.com/shdwjk/4064a6b2e12bcfc46f49" rel="nofollow">https://gist.github.com/shdwjk/4064a6b2e12bcfc46f49</a>
1406507238
Steve D.
Sheet Author
API Scripter
Nice!! and thanks. There was one small error I found with your script. If you create a character and then try to roll it would error out. This was something I ran into when writing the script the first time around. I've added the fix and also added your changes to my version and committed to the roll20 github account. They haven't done a pull in a few days but I would guess by the end of the week it should be added. Last week when you were fixing my poor code. I started work on a vehicle sheet tab for the character sheet. I hope to have a basic version done later this week. Thanks for your help!!
1406514580
The Aaron
Roll20 Production Team
API Scripter
My pleasure! Love your dice! I had not tried created characters after installing the script. What caused the error?
1406639663
The Aaron
Roll20 Production Team
API Scripter
Ah.. I see. Whoops! =D I probably would have just used c.id there, instead of setting createAttributeList[0].current and then using it 6 lines later. =D
1406697827

Edited 1407206780
Andrew H.
API Scripter
I am not sure if anyone else wants this, but I added the ability to roll for initiative slots in the Roll20 Turn Order window. It auto sorts based on the rules in the CRB and looks like this. It is in the from of &lt;Number of Success&gt;:&lt;Number of Advantage&gt; To use it, you just add "npcinit" or "pcinit" to the !eed command. For example: !eed pcinit 3g Will roll 3 green dice for a PC initiative roll. The code can be found here . I am open for any code review comments or suggestions.
I am getting 404 errors on the dice images from galacticcampaigns.com
1407174979
Alicia
Sheet Author
Tim M. said: I am getting 404 errors on the dice images from galacticcampaigns.com I've confirmed the images are loading on the website: <a href="http://galacticcampaigns.com/images/EotE/" rel="nofollow">http://galacticcampaigns.com/images/EotE/</a>
1407193758
Tom F.
Pro
API Scripter
I've added "difficulties" to the dice roller script we use for our EotE campaign. Effectively, these are just skills, but using difficulty and challenge dice for opposed rolls. this has allowed me to create automated macros for opposed checks like Negotiation vs. Negotiation. //add difficulty “command” var regexDifficulty = /difficulty\((.*?)\)/; //Create difficulty dice var difficultyDice = function(dice) { var diceArray = dice.split('|'); var num1 = expr(diceArray[0]); var num2 = expr(diceArray[1]); var totalDiff = Math.abs(num1-num2); var totalChall = (num1 &lt; num2 ? num1 : num2); Argv.Difficulty = Argv.Difficulty + totalDiff; Argv.Challenge = Argv.Challenge + totalChall; } // Create difficulties for (var i = 0; i &lt; commandArgv.length; i++) { var difficultyMatch = commandArgv[i].match(regexDifficulty); difficultyMatch = (difficultyMatch ? difficultyMatch[1] : false); if (difficultyMatch) { difficultyDice(difficultyMatch); } } This way using !eed difficulty({rankX}|{attribute}) I can generate a set of difficulty dice as opposed to skill dice. Using this macro as an example !eed label(Negotiation) @{selected|diceNegotiation} skill(@{selected|rankNegotiation}|@{selected|presence}) @{selected|dicePool} @{-dicepool|dicepoolgm} difficulty(@{target|rankNegotiation}|@{target|presence}) I generate an opposed negotiation check with a button, and I still control dice with GM dice (I have not added any other pools to the difficulty check, as I wanted to add them on the fly via -DicePool GM dice) This yields (I also use the Power cards API for explanations): I find it really handy.
1407251391
Steve D.
Sheet Author
API Scripter
Andrew H. said: I am not sure if anyone else wants this, but I added the ability to roll for initiative slots in the Roll20 Turn Order window. It auto sorts based on the rules in the CRB and looks like this. It is in the from of &lt;Number of Success&gt;:&lt;Number of Advantage&gt; To use it, you just add "npcinit" or "pcinit" to the !eed command. For example: !eed pcinit 3g Will roll 3 green dice for a PC initiative roll. The code can be found here . I am open for any code review comments or suggestions. Hey Andrew, I'm working your code into the core javascript file and adding a section in the character sheet for initiative rolls. Thanks for this great add. Steve
Steve D. said: Andrew H. said: I am not sure if anyone else wants this, but I added the ability to roll for initiative slots in the Roll20 Turn Order window. It auto sorts based on the rules in the CRB and looks like this. It is in the from of &lt;Number of Success&gt;:&lt;Number of Advantage&gt; To use it, you just add "npcinit" or "pcinit" to the !eed command. For example: !eed pcinit 3g Will roll 3 green dice for a PC initiative roll. The code can be found here . I am open for any code review comments or suggestions. Hey Andrew, I'm working your code into the core javascript file and adding a section in the character sheet for initiative rolls. Thanks for this great add. Steve How do I enable this, Steve? I have the character sheet and the dice script running, but I dont see the init rolls on the sheet anywhere. Thanks, great sheets!
1408663531
Steve D.
Sheet Author
API Scripter
The new scripts have not been merged into the roll20 character sheet github account. I'm not sure when they will be added. If you want to start using the new version click on the link below. <a href="https://github.com/dayst/StarWarsEdgeOfTheEmpire_Dice/tree/master/v2.5" rel="nofollow">https://github.com/dayst/StarWarsEdgeOfTheEmpire_Dice/tree/master/v2.5</a>
Thanks for the reply Steve. I currently have the character sheet enabled and the only API script I have running is: EotE-Dice.js If I replace that script with the updated EotE-Dice.js from your link, will that do the trick? Not sure what to do with the css and html ones. Guess I'm asking for a little more instruction on account of my being a total noob at anything related to code. Thanks
I am debating picking up mentor to run my first game using the EotE ruleset (not a Star Wars game, but is the most fun I've had with a ruleset in a long time) and I want to make sure that I have it down with exactly what the current state of things is, or at least want to ask if the features I'm hoping it has is in. * Add all the dice necessary for a check to the pool by clicking the character sheet. * The DM can add the difficulty die to the check that the player is about to roll, or there is an easy way for the player to do so in conjunction with the above. * Output the pictures of all the dice rolled as well as a "total" of what was rolled. (I do believe I saw this was totally a thing in the pictures, but I just want to ask to be sure.) I was just gonna use Hangouts, but if this does all these things I find it far nicer to use than the hangouts roller. Thanks for all your hard work even if it does not yet do all these things!
1408911630
Tom F.
Pro
API Scripter
Steve, now that the script has changed, I'm lost with my difficulty dice (glad I tested before implementing into live campaign). Would it be possible for you to add a difficulty "feature" that acts just like the skill, so I can call "!eed difficulty(4|2)", for example which would then roll 2 Purple Difficulty Dice and 2 red challenge dice? I use this for macros I've built to handle opposed checks. Originally, I had added this code: //add difficulty “command” var regexDifficulty = /difficulty\((.*?)\)/; //Create difficulty dice var difficultyDice = function(dice) { var diceArray = dice.split('|'); var num1 = expr(diceArray[0]); var num2 = expr(diceArray[1]); var totalDiff = Math.abs(num1-num2); var totalChall = (num1 &lt; num2 ? num1 : num2); Argv.Difficulty = Argv.Difficulty + totalDiff; Argv.Challenge = Argv.Challenge + totalChall; } // Create difficulties for (var i = 0; i &lt; commandArgv.length; i++) { var difficultyMatch = commandArgv[i].match(regexDifficulty); difficultyMatch = (difficultyMatch ? difficultyMatch[1] : false); if (difficultyMatch) { difficultyDice(difficultyMatch); } } into the previous EotE dice roller, and it worked wonderfully for me. I find it really useful to be able to call difficulties like this, and I think others would too... Cheers
1408982109
Tom F.
Pro
API Scripter
Well, I had a little time on my hands, so I added the following into the script, for my purposes, and it's worked out well: // insert after line 110 opposed : /opposed\((.*?)\)/g, // insert after line 358 var opposedMatch = cmd.match(eote.defaults.regex.opposed); if (opposedMatch) { diceObj = eote.process.opposed(opposedMatch, diceObj); } // insert after line 1499 eote.process.opposed = function(cmd, diceObj){ /Opposed * default: * Description: create the difficulty and challenge dice for an opposed skill check * Command: !eed opposed(char_value|skill_value) * ---------------------------------------------------------------- */ //log(cmd); _.each(cmd, function(opposed) { var diceArray = opposed.match(/\((.*?)\|(.*?)\)/); if (diceArray && diceArray[1] && diceArray[2]) { var num1 = eote.process.math(diceArray[1]); var num2 = eote.process.math(diceArray[2]); var totalOppDiff = Math.abs(num1-num2); var totalOppChal = (num1 &lt; num2 ? num1 : num2); var opposeddifficultyDice = diceObj.count.difficulty; var opposedchallengeDice = diceObj.count.challenge; diceObj.count.difficulty = opposeddifficultyDice + totalOppDiff; diceObj.count.challenge = opposedchallengeDice + totalOppChal; } }); return diceObj; } Now, using the command !eed opposed(x|y) I get the difficulty (purple and red) dice that I can use in macros for opposed tests. If anyone is interested. It's all just a re-tweaking of all your original code. I must say, if it wasn't for your script (and character sheet), I don't know how we could smoothly run this game. Kudos to you!!!
Just Posting about the awesome character sheet and is there anyway to add more than just two obligations cause i can only get 2 boxes and if not can you add the function in please. Thanks for reading this
I realize now that I never actually asked a question on my August 23rd post! No wonder nobody is answering it. S.H. Miller said: I am debating picking up mentor to run my first game using the EotE ruleset (not a Star Wars game, but is the most fun I've had with a ruleset in a long time) and I want to make sure that I have it down with exactly what the current state of things is, or at least want to ask if the features I'm hoping it has is in. * Add all the dice necessary for a check to the pool by clicking the character sheet. * The DM can add the difficulty die to the check that the player is about to roll, or there is an easy way for the player to do so in conjunction with the above. * Output the pictures of all the dice rolled as well as a "total" of what was rolled. (I do believe I saw this was totally a thing in the pictures, but I just want to ask to be sure.) I was just gonna use Hangouts, but if this does all these things I find it far nicer to use than the hangouts roller. Thanks for all your hard work even if it does not yet do all these things! I wanted to know if some or all of these things are correct. Are they? I'm pretty positive the 3rd one is.
1409179612
Steve D.
Sheet Author
API Scripter
Sorry for my delay in responses but I've been camping for the last week. @Tom: I'll add your code in on the next round of updates which will be tonight. I also forgot to include some style changes, the dice reset button uses the same roll icon. @S.H. Miller: Yes, the player can add the necessary dice for any check plus weapons and skills also have a roll button. You can also setup spical commands rolls for the skills like 1b for 1 boost or 3g for 3 ability. Yes, both are possible the player can add the difficulty or the GM can add the difficulty with the GM Dice character sheet that is auto created when the script is installed. Yes, there is a nice picture output of the dice rolled and the results are totaled.
1409182765
Steve D.
Sheet Author
API Scripter
Linnford B. said: Just Posting about the awesome character sheet and is there anyway to add more than just two obligations cause i can only get 2 boxes and if not can you add the function in please. Thanks for reading this I've added in a repeat section for obligation so you can add as many as your group requires. I'll be pushing these changes tonight so they should be live within a week or so. Cheers Steve
Steve D. said: Linnford B. said: Just Posting about the awesome character sheet and is there anyway to add more than just two obligations cause i can only get 2 boxes and if not can you add the function in please. Thanks for reading this I've added in a repeat section for obligation so you can add as many as your group requires. I'll be pushing these changes tonight so they should be live within a week or so. Cheers Steve Thanks Alot :) loving the work you guys are putting into this stuff
Thanks Steve! Initiative is working great. I like how you threw Cool and Vigilance up there at the top.
Tim M. said: Thanks Steve! Initiative is working great. I like how you threw Cool and Vigilance up there at the top. It makes me very happy to see others liking my initiative roller. I initiallly made it to make running my games easier and posted it on here to see if anyone else wanted it aswell. The way Steve incorperated it into the sheet made it even more useful!
I have been reading these post...wow love the efforts...I would love some assistance updating my mentor account to reflect these items. Does anyone have the time to help me implement and test these things out in the near future?
1409342744
Steve D.
Sheet Author
API Scripter
Create a new campaign Under "Campaign Settings" select "Star Wars Edge of the Empire (API-Compatible)" character sheet and click save Copy the Eote-Dice.js from <a href="https://github.com/Roll20/roll20-character-sheets/" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/</a>... Under API scripts paste the Eote-Dice.js Give the script a name and click save Launch your campaign and start creating! Hope this helps!
Many Thanks for the clear and consice assist
Hi Again My players keep get this error this error messaages every time they roll dice from the character sheet. "No attribute was found for -dicepool|dicepoolgm" is this from something i've done wrong
1410117955
The Aaron
Roll20 Production Team
API Scripter
Those attributes are added by the script to all of the characters in the journal. try restarting your API sandbox (by saving a script).
Anyone know how to remove all this before the dice roll? GM (GM) characterid(blackwood|characterid),label(dice,pool),,1g,2y,3p,0r,0b,0blk,0w,upgrade(ability|0),downgrade(proficiency|0),upgrade(difficulty|0),downgrade(challenge|0),-dicepool|dicepoolgm Every time I roll dice using the character sheet this pops up before the result below it. Its clutter and not needed any help would be appreciated.
1410320409
Steve D.
Sheet Author
API Scripter
Not sure what is going on but do you have the most recent version of the API script? <a href="https://github.com/Roll20/roll20-character-sheets/" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/</a>...
Is there a way to get this as 3d dice?
1410616396
Steve D.
Sheet Author
API Scripter
I wish but as far as I know there is no way to roll the 3D dice with the API and change the graphics out on the dice.
Hi, sorry for cross linking, but one of the other players started a thread in another forum explaining the issue and I wanted to make sure the people in this thread see it (looks like you're the api creators/maintainers?) to get your feedback: <a href="https://app.roll20.net/forum/post/1148107/star-wars-edge-of-the-empire-api-compatible-sheet-error/#post-1183269" rel="nofollow">https://app.roll20.net/forum/post/1148107/star-wars-edge-of-the-empire-api-compatible-sheet-error/#post-1183269</a>
Can anyone explain to a laymen just how to set up opposed rolls in macros or otherwise using this API? I see Tom F. references the ability to do so? specific examples would be helpful. Thanks
I'm having an issue where for some reason one of my characters is getting an additional 5 boost die added on to every one of his rolls and they cannot be removed. The dice pool at the top is even all set to 0 and it still adds 5, the place to text insert the dice into the roll on the right of the check is also blank. If I add -5 dice it actually rolls +10 dice. This is only happening to a single character though.
Do all players in the game need to be a mentor or only the GM to be able to use these features?
Brandon D. said: Do all players in the game need to be a mentor or only the GM to be able to use these features? Just the GM
1415851199
vÍnce
Pro
Sheet Author
Do all players in the game need to be a mentor or only the GM to be able to use these features? No. The GM has access to the added features and their players get to play in the campaign with those features.
Only the GM needs to be a mentor, players can then benefit from the features available to games created mentor GMs.
Anyone else having the problems @Dustin describes? We had identical problems in my game tonight, and - in addition to @Dustin - I have one other player reporting that the character sheet/dice roller is broken in a third game.
I am not having those problems yet. I will let you know if I come across them in my game on Tuesday. For the reported broken dice roller, make sure the script is running in the API Scripts section of the campaign. Sometimes it needs to be restarted (just hit the save button again)
I think I have identified the problem. The dice roller is not taking into account the LAST change that is made to the dice pool. Thus, if you add 2 difficulty dice to the check, and the cursor remains in the difficulty dice box after the roll, those dice will NOT be added. If, however, you move the focus away from that box (for example, by adding and then removing a setback die), then the correct pool is rolled. I am NOT much of a programmer, but my guess is that all of the fields relating to the dice pool need to be changed/updated so that the pool is changed when the widget is clicked, rather than when the widget loses focus. But that is just a wild guess. In the meantime, the workaround would seem to be this: set your dice pool the way you want it. Then pick any unused element of the dice pool and INCREASE it to 1, then DECREASE it to 0. You should then get the pool you are looking for.
You don't have to click on another object, you just have to make sure the cursor leaves the text box in question. I always knew of this problem and I guess I learned how to avoid it. I am pretty sure this is an issue on most if not all sheets since it also does it on the 5e sheet.
GM_Matt said: I think I have identified the problem. The dice roller is not taking into account the LAST change that is made to the dice pool. Thus, if you add 2 difficulty dice to the check, and the cursor remains in the difficulty dice box after the roll, those dice will NOT be added. If, however, you move the focus away from that box (for example, by adding and then removing a setback die), then the correct pool is rolled. Nice catch, mang. My own rudimentary testing bears this out. Stellar. Crisis averted!
I am working on some additions to the sheet + script, including: Adding Duty and Morality Force Rating Dial Force Power section with roller (the roller will roll force dice equal to the number available (Force Rating - Committed)) Ability to add auto success/advantage to an ability check I am still testing and tweaking some things but I hopping to get these into the repo some time next week. Comments and suggestions are welcome
Nice work!
1416271611

Edited 1416275852
Is there a way to reset the critical number on a character? Also is there a command that will roll a critical hit besides using the button on the char sheet?
@Andrew - FIRST - thank you so much for all of your work on this sheet. It is really awesome and my group and I really enjoy it. SECOND - in response to your 11/14, I am pretty sure that this hasn't always been a problem. Maybe I am out of my mind, but I don't ever remember running into this issue as late as, say, 3-4 weeks ago.