News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Dice roll mod ... again.

Started by Adin, February 02, 2005, 08:49:07 AM

Previous topic - Next topic

TechnoDragon

8: Undefined variable: context
File: /home/www/technodragon.net/forum/Sources/RPG.php
Line: 28

and

8: Undefined variable: settings
File: /home/www/technodragon.net/forum/Sources/RPG.php
Line: 30

i am getting those two errors everytime i reply or start new topic.
Don't tell me to get into shape...I have a shape...It is round!


Nomina

#81
technodragon73,

I was encountering the same errors.

In RPG.php, changing...


function openroller()
{
global $scripturl;


...to...


global $scripturl, $settings, $context;


...seemed to fix the problem on my end.  I had to add another global call to another file (I'm still not certain these were, but can't recall which at the moment (I'll check my logs to see if I can find the change.)

The problem I'm having now is that the "onclick" attribute isn't opening a popup as it should.  If I remove the onclick," it does redirect to a window with the working roll generator.

All of this is in 1.1 RC2, if that helps/matters.




I found the other change I made.  I needed to add $scripturl to the list of globals that appears just after...

// This function displays all the stuff you'd expect to see with a message box, the box, BBC buttons and of course smileys.


Like I said, I'm still not certain that these are the "right" changes to have made, but they cleared up the forum errors.   :-\




Correct that, the popup is working just fine, but for some reason was popping under my open windows so I had no idea it was there.  :o

TechnoDragon

#82
Thank you for the fixes...now about the other post?

Is there a way to do that?

That if you choose to reroll on a number...say 6 when using six sides...that it will add the total of the reroll to the previous six and if the reroll is also six add to the previous one and so on until no more sixes are rolled and then add the modifier and then compare to the target you set?
Don't tell me to get into shape...I have a shape...It is round!


TechnoDragon

ok...fixed the other erros completely...now for some new ones:

8: Undefined variable: str
File: /home/www/technodragon.net/forum/Sources/RPG.php
Line: 168

and

8: Undefined variable: successes
File: /home/www/technodragon.net/forum/Sources/RPG.php
Line: 214
Don't tell me to get into shape...I have a shape...It is round!


shanks

#84
Wow, yikes. I completely forgot to check the error log. I'll fix all of those after work.

Edit: Scratch that. I've editted my above post and changed the attachment. I no longer get any errors using the generator. Very simple mistakes, I am ashamed...  :-\

shanks

Quote from: technodragon73 on February 19, 2006, 08:28:23 PM
That if you choose to reroll on a number...say 6 when using six sides...that it will add the total of the reroll to the previous six and if the reroll is also six add to the previous one and so on until no more sixes are rolled and then add the modifier and then compare to the target you set?

Which system uses this?

URPG

Shadowrun uses this System (you roll a number of 6 sided, exploding dice depending on your Skill)... So you could score with 4d6: 1, 4, 5, 11

By the way, my RPG uses 1d100+something and Xd10+/-something both against a target number, especialy the later roll I'll have to force you to make it work in my forum   :'(  ;D

How is your syntax going to look like?

TechnoDragon

It is Shadowrun...and your fixes for the other stuff were successful...no more errors...YAY!

It is a system that uses six-sided exclusively...so the only way to track successes is by rerolling and adding the next result if you roll a six.

rolling 4d6:

you get 2, 5, 3, 6

you reroll the 6 and get 5...so the total is 11 for that roll, if you roll another six then the total would be 12, plus you reroll that six as well...say you get 4...then the total for that roll is 16

It is theoretically possible to get infinite rolls of six...but nigh on impossible.
Don't tell me to get into shape...I have a shape...It is round!


shanks

I'll work on the SR roller over the next few days.

Quote from: URPG on February 20, 2006, 04:08:14 AM
By the way, my RPG uses 1d100+something and Xd10+/-something both against a target number, especialy the later roll I'll have to force you to make it work in my forum   :'(  ;D

Unless I am missing something, aren't both of those possible with the current roll generator? If there is something I am not understanding perhaps you could flesh these out with some examples?

And I imagine the syntax will be along the same lines as the current roll generator. It'll make no sense just looking at it, but the roller will know what it means!

TechnoDragon

Ok...i thought of this today...the easiest way I can think of to accomplish this would be to mayb e add a check box next to the reroll boxes that allows the rerolls over a certain value to be added to the previous roll...and then have it reroll the reroll if it is => the reroll value.

example1a:

a) you choose the value to reroll and the value to beat...when the reroll value is reached, it just rerolls the die until the value that comes up is lower than that value.

the change would be to make it so that when it rerolls anything that meets or exceeds that value that it would add the value of the reroll to the first roll, and that if the reroll also is => the selected value that it too would be added to the previous two or more rolls.


so in the example I chose 7d6 with a reroll if the die comes up a six or more.  the value to beat is eleven.

Currently, if the die hits six it rerolls until the value of the die is below six in this case, so 11 can never be reached.

However the change that I would like is that when the reroll value is reached, the die is rerolled, and that value is added to the previous die roll.  so lets say that the reroll comes up a 5...then it would add that to the previous six and get 11 (then add any modifiers that may have been put) so now 11 is an attainable goal.  now if the reroll comes up a 6 again, then it would add that to the first roll (which was a 6, making the total 12) then reroll again...and so on.

I hope this is descriptive enough...
Don't tell me to get into shape...I have a shape...It is round!


shanks

And this rerolling and addition is called "exploding"? And it only ever happens on the max possible roll on any given die?

TechnoDragon

well, i don't know about "exploding" but yes...only on the max possible roll, which in shadowruns case would be a d6.

I figure the best way to implement it (if possible) would just be a check box next to the reroll values (i.e. <= or >= seelections) to instead of actually rerolling the die until it comes up lower, that it adds the reroll value to the first roll and so on...

so you would check the box, the script rolls a six (if that is the number you choose to reroll on), rerolls the six, adds the new roll to the previous six.  if the new roll is also a six, then it would add that to the previous rolls of six...and keep doing that until it doesn't roll a six any more, then adds it all up and then mathces the total to the success value you choose.

Your roller is nearly perfect for shadowrun but for this tiny bit, but this is how that system (as well as Battletech, and Mechawarrior) roll successes using six-sided dice.
Don't tell me to get into shape...I have a shape...It is round!


TechnoDragon

ok...found a site that has a function like I have been talking about...only problem is it is done with cgi scripting

http://www.irony.com/shadowroll.html

can this be done as php?
Don't tell me to get into shape...I have a shape...It is round!


TechnoDragon

Any ideas yet? or has this died?
Don't tell me to get into shape...I have a shape...It is round!


shanks

It hasn't died. I am a working man with other obligations, ya know. Fear not! It shall be done before long. In the meantime, how about letting me know how you added the colour. Is it simply a graphic, or some other kind of wizardy with which I am not familiar?

TechnoDragon

You mean the background of the popup window?

I think it has something to do with edits i did to get rid of some errors...

or...

Rather than have a simple white background like most websites, but with graphichs i have a colored background...if you look, that is the background image of the forum....


and sorry...i am just excited to finally have a dice roller that could potentially sky-rocket rpg boards everywhere.
Don't tell me to get into shape...I have a shape...It is round!


Dresdan

I agree, I just finished putting this up on my gaming forum.  It's the best thing Ive ever seen for a role playing site.  Much appreciation to the creator and those that gave ideas and helped out.  Best mod yet in my book.  This will make my job so much easier. ;D

One question though, how do I change the highlight on the roll outcome?

TechnoDragon

in RPG.php under each function it has a <div> tag...there is the hex code for the background color...you just change that to whatever color you need
Don't tell me to get into shape...I have a shape...It is round!


URPG

Yes, shaodwrun uses this System for d6, so does Earthdawn for practically every dice even invented (as you raise in power you get more and bigger dice for skill rolls) and it's called "exploding roll" if you re-roll the highest number and add it. There is no game i know off that rerolls other things then a max or min result, but there are a lot of games that do, so a dice roller should be able to do it.

Quote from: shanks on February 20, 2006, 01:43:04 PM
Quote from: URPG on February 20, 2006, 04:08:14 AM
By the way, my RPG uses 1d100+something and Xd10+/-something both against a target number, especialy the later roll I'll have to force you to make it work in my forum   :'(  ;D

Unless I am missing something, aren't both of those possible with the current roll generator? If there is something I am not understanding perhaps you could flesh these out with some examples?

The two rolls in detail:
1d100 + Skill against a target number. Tells you if you succeed or not in rolling more then the target and by how many points. 01 automatically succeeds, 100 automatically fails.

(several)d10 each +/- Modifier against a target number. Tells you how many dice scored over the target number. 1 automaticaly fails, 10 automatically succeeds.

Do you have criticals? like 20 on d20 for D&D or 1 and 100 on d100 in my system? can you specifi them for your roll?

Please, summarize the complete syntax it does understand, then i will give it a test-drive in my forum :)

TechnoDragon

Quote from: URPG on February 24, 2006, 07:49:58 AM
Yes, shaodwrun uses this System for d6, so does Earthdawn for practically every dice even invented (as you raise in power you get more and bigger dice for skill rolls) and it's called "exploding roll" if you re-roll the highest number and add it. There is no game i know off that rerolls other things then a max or min result, but there are a lot of games that do, so a dice roller should be able to do it.

Quote from: shanks on February 20, 2006, 01:43:04 PM
Quote from: URPG on February 20, 2006, 04:08:14 AM
By the way, my RPG uses 1d100+something and Xd10+/-something both against a target number, especialy the later roll I'll have to force you to make it work in my forum   :'(  ;D

Unless I am missing something, aren't both of those possible with the current roll generator? If there is something I am not understanding perhaps you could flesh these out with some examples?

The two rolls in detail:
1d100 + Skill against a target number. Tells you if you succeed or not in rolling more then the target and by how many points. 01 automatically succeeds, 100 automatically fails.

(several)d10 each +/- Modifier against a target number. Tells you how many dice scored over the target number. 1 automaticaly fails, 10 automatically succeeds.

Do you have criticals? like 20 on d20 for D&D or 1 and 100 on d100 in my system? can you specifi them for your roll?

Please, summarize the complete syntax it does understand, then i will give it a test-drive in my forum :)

Currently it only does the reroll but not add...hence myvery wordy posts trying to explain what i will now call exploding rolls needed....
Don't tell me to get into shape...I have a shape...It is round!


Advertisement: