Fox.
New Member
Shocking, isn't it?
Posts: 124
inherit
175033
0
Oct 4, 2019 5:57:53 GMT -8
Fox.
Shocking, isn't it?
124
December 2011
isagracien
|
Post by Fox. on Jun 6, 2013 21:19:13 GMT -8
Peter's Dice Roll CodeThe Hunger Games Forum I code for previously used the code above for our damage. I've came up with a new system for our Games so it will have myself (or another Staff member who knows how to code it) input the Data for each Tribute needed and then output the damage. However, not only will I need it to do the random generator of how much damage, I'd also like to add in another 'dice' so it will also calculate the 'hit' or 'miss' in the same button. The space where it says the number of sides, I'll be changing that area to give an output of the attack the person did based on the number of damage points it did. So, the questions/discussion: - Easiest way to actually make it calculate the damage based on simple mathematics from stated variables. (Ex. The tribute can hit a max of 240 damage, but it needs to be randomized between 0 and 240)
- Easiest way to make it calculate 'hit' and 'miss' based on variables that will be previously stated. (Ex. The tribute took extra time practicing with a bow so gets + 3 to their likeliness of hitting their target)
- How do I add it to the line of UBBC/BBC Buttons?
- Is it actually possible for it to output two 'dice'?
- Setting the text is just an easy .write() or .append() right?
Yes, I am still attempting to get a rough code together. I will post it when I have some form of it working. Thanks in advance.
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jun 7, 2013 1:00:36 GMT -8
damage=Math.floor((Math.random()*240)) the other stuff dont really have an easy math formula for.. they seem like they would be a result of nested if statements the tray buttons are a bit more complex and Chris or Peter might have to explain that prcoess
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jun 7, 2013 5:50:04 GMT -8
I wrote a pretty detailed overview of adding your plugin button to WYSIWYG here
|
|
Fox.
New Member
Shocking, isn't it?
Posts: 124
inherit
175033
0
Oct 4, 2019 5:57:53 GMT -8
Fox.
Shocking, isn't it?
124
December 2011
isagracien
|
Post by Fox. on Jun 7, 2013 9:21:25 GMT -8
Sweet, thanks Worm and Eton. I'll get something roughed up for the actual working of it and post it here before I try and add it into the tray itself. That in itself I'll have to read while I'm doing it, but that is a very detailed way and I will follow it as I do it when I get there. Thanks.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jun 7, 2013 9:45:58 GMT -8
Before you get too deep into it, are you aware that a dice roll plugin already exists in the database. I'm not trying to discourage you since the best way to wrap your head around something is to actually do it rather than read it but if your time is better spent on something with more priority then no sense recreating the wheel and that project could instead be put off at your leisure.
|
|
Fox.
New Member
Shocking, isn't it?
Posts: 124
inherit
175033
0
Oct 4, 2019 5:57:53 GMT -8
Fox.
Shocking, isn't it?
124
December 2011
isagracien
|
Post by Fox. on Jun 7, 2013 10:24:29 GMT -8
Yes, I've seen it. Though, I've come down to they're not exactly what I need. For example, instead of just the random number projecting based on a "range"/"# of sides" I also need it to project the number based on a formula like this:
//D1 variables
D1bonus = 10;
*Insert roll here*
Roll + 10
If roll = #
*Have it display damage + the attack done*
------
That's a very rough idea, I'm just away from my laptop to type out the lengthy idea I've been working with to do it.
However, if its possible to modify that plug in to do what I need (if given permission of course) that will probably be easiest. It'll be a good replacement if I don't get the code worked out in time for the next Games too.
|
|