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 .
×
D&D 2024 has arrived! Pre-Order the new core rulebooks now.
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

1370231815

Edited 1397032826
Konrad J.
Pro
API Scripter
Here is a new working link. <a href="https://github.com/morval/EotEDice2/blob/master/Ed" rel="nofollow">https://github.com/morval/EotEDice2/blob/master/Ed</a>... --------------------------- I just finished a script to roll the dice for the new game Edge of the Empire. It sends images of the dice to the chat window now, looks great. <a href="https://github.com/morval/EotEDice2/blob/master/Edge%20of%20the%20Empire%20RPG%20Dice%20Mechanics.txt" rel="nofollow">https://github.com/morval/EotEDice2/blob/master/Edge%20of%20the%20Empire%20RPG%20Dice%20Mechanics.txt</a> Here is a sample output, as if you rolled every possible dice side in the game. :) I'm very happy with how it turned out. I had some help with the dice specs from Blake the Lake and Alicia G. Alicia also offered to host the image files on her website galacticcampaigns.com. Please feel free to offer up any suggestions to improve the look or fix any bugs. I don't actually play the game, but found it good practice to write the script. If anyone has another custom dice mechanic they want done I'd be happy to work on it. The instructions are in the beginning comments, but here they are again. // Edge of the Empire RPG Dice Mechanics // // copyright pug games 2013 // Script created by Roll20 user Konrad J. // help with Dice specs by Roll20 users Alicia G. and Blake the Lake // dice graphics hosted by Roll20 user Alicia G. at galacticcampaigns.com // dice graphics borrowed from the awesome google+ hangouts EotE Dice App // // !eed log on|off // outputs dice rolled to the chat window if "on", nothing if "off" // !eed graphics on|off|s|m|l //shows dice rolled as graphic, small, medium, or large if "on" or as text if "off" // !eed #b #g #y #blk #p #r #w // !eed test // this will output every side of every die to the chat window // // you only need to specify the dice to roll, in any order // b is blue, g is green, y is yellow, blk is black, p is purple, r is red, w is white // currently no error checking so you can break it if you type in unsupported arguments
hi! I want to test out the game system and this is GREAT! Could you explain me how to implement it in my Roll20 campaign? Does it need to be a mentor, using API? Thanks!
1372347967
Alex L.
Pro
Sheet Author
The Vastator said: hi! I want to test out the game system and this is GREAT! Could you explain me how to implement it in my Roll20 campaign? Does it need to be a mentor, using API? Thanks! You have to be a Mentor to use the API
1372353991
Konrad J.
Pro
API Scripter
Ya, mentor unfortunately. &nbsp;There is also an excellent Google+ hangout app that you can use for free ithout being a mentor, but you of course need to use goggle hangouts. Let me know if you need any further help.
thanks for the info! Would you please link me the G Hangout link?
<a href="http://game2.com/eote/" rel="nofollow">http://game2.com/eote/</a> <a href="https://plus.google.com/hangouts/_?gid=471035561500" rel="nofollow">https://plus.google.com/hangouts/_?gid=471035561500</a>
I would strongly recommend you replace Math.random() with&nbsp;randomInteger(MAX). Using Math.random() like: "Math.floor((Math.random()*12)+1)" results in Modulo Bias &nbsp;unless the values generated by Math.random() are evenly divisible by your MAX value. The provided&nbsp;randomInteger(MAX) internally compensates for modulo bias making sure you will have evenly distributed numbers between 1 and your MAX value no matter what that MAX value is.
1372523804
Konrad J.
Pro
API Scripter
makes sense. &nbsp;I see that in the API docs now, didn't notice it before. &nbsp;Will do.
Well I snuck it in there on you after reading your script. I realized that the API docs needed some clarification on Math.random() vs&nbsp;randomInteger(MAX).
im sorry, new to all this but do I replace every occurance of Math.random() with randomInteger(MAX)? &nbsp;That exactly? &nbsp;Because that's not working for me, although the unedited script works (but you're saying the probability is off somehow). &nbsp;Any help would be appreciated.
1375438143
Alex L.
Pro
Sheet Author
Tim M. said: im sorry, new to all this but do I replace every occurance of Math.random() with randomInteger(MAX)? &nbsp;That exactly? &nbsp;Because that's not working for me, although the unedited script works (but you're saying the probability is off somehow). &nbsp;Any help would be appreciated. you need to replace MAX with an integer. or a variable containing integer
I thought that might be the case. &nbsp;So what integers do I need to use?
Tim M. said: I thought that might be the case. &nbsp;So what integers do I need to use? Needs to be the die type you are trying to replicate. So a 1d6 would be randomInteger(6) and 1d12 would be randomInteger(12) and so on.
1375447507
Alex L.
Pro
Sheet Author
Joshuha O. said: Tim M. said: I thought that might be the case. &nbsp;So what integers do I need to use? Needs to be the die type you are trying to replicate. So a 1d6 would be randomInteger(6) and 1d12 would be randomInteger(12) and so on. To be more precise its the maximum value of the random number. The minimum is always 1.
I'm sorry to be a pain, but I have no programming experience. do I replace this: roll = Math.floor((Math.random()*12)+1) with this: roll = randomInteger(12); Thanks for your help guys, I'm really enjoying GM'in EotE with Roll20, but I have zero programming experience.
I got it working :D
Sorry, noob to roll 20. I've signed up as a mentor and really want to use this script. I put it into the scripts for my campaign but now I'm unsure how to invoke it??
Nevermind.... figured it out... you have to do !eed &lt;dice pool&gt; for anybody else following this thread with the same question.
Just got it all put in. Thank you so much!
This script is a godsend. &nbsp;I've been extending it some... for instance, I have "cards" that look like the dice that players can put on the table to build a dice pool, then "!eed screen" detects dice on the page and rolls them via the existing commands. &nbsp;I'm going to playtest that this week, but if anyone is interested (and Konrad is okay with it), I'd be happy to share what I've been working on. Has anyone else extended this script in any way?
This is very nice, thank you!&nbsp;
Rand said: This script is a godsend. I've been extending it some... for instance, I have "cards" that look like the dice that players can put on the table to build a dice pool, then "!eed screen" detects dice on the page and rolls them via the existing commands. I'm going to playtest that this week, but if anyone is interested (and Konrad is okay with it), I'd be happy to share what I've been working on. Has anyone else extended this script in any way? I would love to give this a shot if you are up for sharing.
1380406793
Konrad J.
Pro
API Scripter
Rand said: This script is a godsend. I've been extending it some... for instance, I have "cards" that look like the dice that players can put on the table to build a dice pool, then "!eed screen" detects dice on the page and rolls them via the existing commands. I'm going to playtest that this week, but if anyone is interested (and Konrad is okay with it), I'd be happy to share what I've been working on. Has anyone else extended this script in any way? I've been staying away from Roll20 for a few months during the summer. It was starting to take up too much of my time and I had lots of RL stuff to do. Should be getting back her more often soon. Yes you can of course change this script in anyway you want. Take credit for it, have fun! :) Konrad
Sorry I'm lagging so much on this - I'll try to put everything together this week.
1382370715

Edited 1382371082
Alicia
Sheet Author
Have you tested to see if Rolling Queries work? I was contemplating building a sheet for the game where the Difficulty and Challenge die could then be dynamic within the sheet macros. Edit.. Well hey. it works. Answered my own question.
Those definitely work. I just wish I could get them all in the same box, rather than several different input boxes one after another.
Now I'm getting this. Can't use eed anymore :( Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info... For reference, the error message generated was: Infinite loop or long running process detected.
IM TOATS GAY
1384967982
Alicia
Sheet Author
Christian O. said: Now I'm getting this. Can't use eed anymore :( Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info... For reference, the error message generated was: Infinite loop or long running process detected. I left mine on over a few days and came back with this error. I've deleted and readded the script with no issues. Going to see if it happens again if it's off when not in play.
This script is great. I want to run Warhammer Fantasy Roleplay 3rd Edition which uses similar custom dice, unsurprisingly as both games are made by Fantasy Flight. Would it be possible to update this script to handle WFRP custom dice? If so could anyone give me a steer as to how to do it. I have images for all custom die faces. Thanks
1385217067
Alicia
Sheet Author
well.. I'm not sure how the dice work but if it's the same other than the images, you can just change the links to the images.
Thanks. I'll give it a try and see.
1385231681
Konrad J.
Pro
API Scripter
Isembard said: This script is great. I want to run Warhammer Fantasy Roleplay 3rd Edition which uses similar custom dice, unsurprisingly as both games are made by Fantasy Flight. Would it be possible to update this script to handle WFRP custom dice? If so could anyone give me a steer as to how to do it. I have images for all custom die faces. Thanks I haven't been around for months on Roll20. :) Unless the dice work exactly the same way as EED I don't think just replacing the images will work? I'll have a quick look at the mechanics in a day or two and see how they work. It should be easy to make them work though. There probably is even better ways to do the script now with all the changes on Roll20, I haven't looked into them at all yet though.
1385232839
Konrad J.
Pro
API Scripter
Isembard said: This script is great. I want to run Warhammer Fantasy Roleplay 3rd Edition which uses similar custom dice, unsurprisingly as both games are made by Fantasy Flight. Would it be possible to update this script to handle WFRP custom dice? If so could anyone give me a steer as to how to do it. I have images for all custom die faces. Thanks I just had a look at the mechanics. Its a bit different. <a href="http://www.fantasyflightgames.com/ffg_content/wfrp/warhammer-fantasy-role-play-dice-preview/WFRP_DiceSymbols.pdf" rel="nofollow">http://www.fantasyflightgames.com/ffg_content/wfrp/warhammer-fantasy-role-play-dice-preview/WFRP_DiceSymbols.pdf</a> A few questions on the mechanics. Righteous Success, you roll another of the appropriate die. If you get another Righteous Success do you roll another appropriate die, and so on....? Also in one paragraph it says if there are no success left after canceling from challenges then the task fails. In another it says if there are more challenge symbols than success symbols then the task fails. So what happens when they exactly cancel each other out? Zero success or challenges left. Still just a simple fail I guess? Under Exertion it states that if at least one exertion is rolled then the character suffers one fatigue or stress. What if more than one is rolled do you suffer 1 fatigue or stress per exertion rolled or just one no matter how many exertions are rolled?
I'm quite new to the game (still working through the rules actually) but my understanding is that you only get the benefit for the first Righteous Success rolled, i don't think it keeps exploding. If there are no Success left the action fails, it only takes one Success to succeed. Exertion result is binary and does not escalate, the character suffers one fatigue or stress even if multiple Exertion results are rolled. I had a look at the script but i'm not a coder so didn't get very far. I've set the dice up as rollable tokens but find it a bit cumbersome, the feeling is even worse now i've had a play with your eed dice.
This is how i'm currently set up with rollable tables.
1387835550

Edited 1387835586
Just wanted to thank you for creating this amazing script. I just added it to my campaign a couple minutes ago, and I can already tell this will greatly speed up and simply our game play. Love that I can just type in "!eed 3g 2y 3p" and it spits out beautiful clean results. Armed with your awesome script, I'm going to go macro-building-crazy now! Thank you!
Im a little late to the party, are you able to "gm roll" with this tool?
1391762496
Konrad J.
Pro
API Scripter
Hi Dan, I've been here off and on for months and haven't been doing scripts. But I'm back to wasting all my nights on scripts it seems. :) by gm roll what do you need it to do? As in only let the gm see the roll I guess? I should be able to add that as an option easily. I'll have a look.
1391908762
Konrad J.
Pro
API Scripter
New version alert! I changed the dice to use randomInteger() and I added a whisper command. Due to how the API works currently I couldn't figure a way to whisper the graphics dice, so when you use the whisper command you will only get the text version even if you have graphics on. !eed w 1b 2r This command would send the results to your chat window as well as the GM. The GM can't whisper a die roll to a player at the moment. The first CONSTANT in the macro is eedCONSTANTS.EEDCOMMAND and is set to "!eed". If you want to invoke the dice with a different set of keys they change it here. You must have the first exclamation mark and then one other character. You could use "!!" <a href="https://github.com/morval/EotEDice2/blob/master/Ed" rel="nofollow">https://github.com/morval/EotEDice2/blob/master/Ed</a>... Please let me know if you find any bugs, better ways to do the script, or new ideas on how to change it and make it better!!! Thanks, Konrad
Getting "Unexpected Error Illegal Token"
1392666618
Konrad J.
Pro
API Scripter
let me have a look later tonight! Do you have any other scripts running? If so then it might take a little work to make them all work together. but more likely I did some little mistake with the update, although I am sure I tested the final update I posted. :) Thanks,
1392667316
Alicia
Sheet Author
Konrad J. said: let me have a look later tonight! Do you have any other scripts running? If so then it might take a little work to make them all work together. but more likely I did some little mistake with the update, although I am sure I tested the final update I posted. :) Thanks, I've been using the updated version last couple weeks with no errors.
Never mind, new to this and copied/pasted everything (including comments). All fixed and working now.
Please forgive a complete noob. I input this API, the console says it's "spinning up a new sandbox", now what do I do next to actually have the script operate within that campaign? You may want to speak slowly and use small words...
1392752618
Konrad J.
Pro
API Scripter
No problem, fairly easy to get working. If its the only script you have and you don't get any errors in the API console then you should be good to go. The simple instructions are in the comments of the script. here they are again. // !eed log on|off // outputs dice rolled to the chat window if "on", nothing if "off" // !eed graphics on|off|s|m|l //shows dice rolled as graphic, small, medium, or large if "on" or as text if "off" // !eed #b #g #y #blk #p #r #w // !eed test // this will output every side of every die to the chat window // // you only need to specify the dice to roll, in any order // b is blue, g is green, y is yellow, blk is black, p is purple, r is red, w is white // currently no error checking so you can break it if you type in unsupported arguments So all you do is type in the chat window !eed 1b 3r 2p that should roll 1 blue, 3 red and 2 purple. It will show the results plus everything all added up. You can turn the graphics off or back on with !eed graphics off You can make the dice small, medium, or large with the command !eed graphics s And you can even simulate the roll of every possible die result with !eed test Let me know if you need any more help, its no problem!!!
Excellent! That works perfectly now, thanks.
1392761377
Konrad J.
Pro
API Scripter
Andrew J. said: Excellent! That works perfectly now, thanks. Great. Hey post a screen capture here of the macro actually being used in play if you get a chance. Seems to be a lot of users playing Edge of Empire. Any ideas on a way to improve the script let me know and I'll add it in. I've got plans to reformat the the output of the dice so any input would be useful.
I am learning Python now but intend to learn Javascript this summer, so hopefully I can contribute a bit. Mostly what I would like is a way to roll Initiative and store it in the initiative tracker :)
1392855672
Konrad J.
Pro
API Scripter
There are a few of those scripts available. Have a look at the sticky in the API forum.
1394392025

Edited 1394392063
Hi all, I love this script, but something has always annoyed me: when opting to show the dice log (the raw dice that are rolled), the dice are displayed on several lines. Say, you throw 2g 2y 2p 2blk, you will have 2 dice of each color 4 different lines, like this: I added an option to have all the dice displayed on the same line, like this: I forked Konrad's script on github : <a href="https://github.com/FkinGuy/EotEDice2/blob/master/E" rel="nofollow">https://github.com/FkinGuy/EotEDice2/blob/master/E</a>... So far it seems to work as planned. I didn't make much tests with the text-based whisper log as I don't understand well how it works in the first place.