Online-Roleplaying.community

Go Back   Online-Roleplaying.community > Public Commonness > Proclamations

Reply
Thread Tools
  #126  
Unread 28th of February, 2007, 15:14
zachol's Avatar
zachol
Flesh Colossus [Epic GM]

User is offline
 
Join Date: Jan 2005
Member: #1103
Location: Glorious Nippon
Posts: 8,153 (1.74 per day)
[roll]-d6[/roll]

[roll]d4+d6[/roll]
[roll]d4-d6[/roll]

Would just "-" work then?


Edit: It appears you cannot have more than 1 dice in any roll?
Or does it need to be "1d4-1d6" or something?
__________________
Sleepy cat is sleepy.
Reply With Quote
  #127  
Unread 28th of February, 2007, 15:27
itches's Avatar
itches
Vampire Lord [Epic Admin]

User is offline
 
Join Date: Jan 2002
Member: #10
Location: Castle Greyskull
Posts: 13,740 (2.38 per day)
Only one type of die in each roll.
__________________
@}-`-- Coffee + Hate = itches
Reply With Quote
  #128  
Unread 28th of February, 2007, 15:31
zachol's Avatar
zachol
Flesh Colossus [Epic GM]

User is offline
 
Join Date: Jan 2005
Member: #1103
Location: Glorious Nippon
Posts: 8,153 (1.74 per day)
[roll]1-1d6[/roll]
[roll]1+1d6[/roll]
3
[roll]1d6-1d6[/roll]
[roll]1d6+1d6[/roll]

So what about damage rolls?

Like... a flaming longsword or something?
__________________
Sleepy cat is sleepy.
Reply With Quote
  #129  
Unread 28th of February, 2007, 15:35
itches's Avatar
itches
Vampire Lord [Epic Admin]

User is offline
 
Join Date: Jan 2002
Member: #10
Location: Castle Greyskull
Posts: 13,740 (2.38 per day)
How would you do it in real life? You'd make a couple of rolls.
__________________
@}-`-- Coffee + Hate = itches
Reply With Quote
  #130  
Unread 28th of February, 2007, 15:40
zachol's Avatar
zachol
Flesh Colossus [Epic GM]

User is offline
 
Join Date: Jan 2005
Member: #1103
Location: Glorious Nippon
Posts: 8,153 (1.74 per day)
Yes, but they all get mooshed into one "damage" roll.

So is it...
Attack: 13
Damage: 10 +4
Or something?

Perhaps my lack of any experience with coding this makes me ignorant of any difficulties involved.
And clearly I'm not being appreciative enough for something that obviously took some amount of effort to do.


Still, would be pretty spiffy if that could be done.
I'm sure some sort of good would come of it.


Also... [roll]4/2[/roll]?

Edit: No, it appears the roll function is not a calculator.
__________________
Sleepy cat is sleepy.
Reply With Quote
  #131  
Unread 28th of February, 2007, 15:46
The Hive Custodian's Avatar
The Hive Custodian
extends Undead, implements EECS [Epic GM]

User is offline
 
Join Date: Jun 2004
Member: #767
Location: In your courses, raising your curves
Posts: 2,032 (0.41 per day)
If I had more free time, I would write a die roller. Sadly I do not.
__________________
Proud owner of one Link Boomerang and one [WanderingMagelok] Cretin of Darkness!
Some of my works.
Reply With Quote
  #132  
Unread 28th of February, 2007, 15:49
itches's Avatar
itches
Vampire Lord [Epic Admin]

User is offline
 
Join Date: Jan 2002
Member: #10
Location: Castle Greyskull
Posts: 13,740 (2.38 per day)
So is it...
Something like that, in my experience you also toss in extra rolls incase you get a critical hit.
No, it appears the roll function is not a calculator.
Shocking.
__________________
@}-`-- Coffee + Hate = itches
Reply With Quote
  #133  
Unread 28th of February, 2007, 17:51
LeeCHeSSS's Avatar
LeeCHeSSS
Psionic Lich [Epic Admin]

User is offline
 
Join Date: Dec 2001
Member: #1
Location: The Netherlands
Posts: 2,047 (0.35 per day)
Originally Posted by elmer_jok # Not entirely true. I had a d20 that got chipped and had three of its sides that were effectively partial faces. I actually used this dice for quite awhile before I discovered that it was broken.
I'm sorry, but the chipped dice simply had one extra face, and since they weren't all evenly sized, the dice became weighted. You cannot have a half face, just as you cannot have a half hole (even a half hole is a hole).
__________________
Danny Bessems - founder of online-roleplaying.commodities

"Coolest Avatar Award™ 2005"-winner
Reply With Quote
  #134  
Unread 28th of February, 2007, 18:03
LeeCHeSSS's Avatar
LeeCHeSSS
Psionic Lich [Epic Admin]

User is offline
 
Join Date: Dec 2001
Member: #1
Location: The Netherlands
Posts: 2,047 (0.35 per day)
The diceroller can only roll one type of dice per roll, because the regular expression against which your input is matched, is not recursive. It can be made recursive (which would be a pain for me to figure out; and on the bottom of my todo list), but it doesn't strike me as necessary: you can also use 2 roll tags...

EDIT: Just so you know, this is the pattern which makes the diceroller tick: "((\d+)?[dD](\d+|%))(?:([-+xX*\/bB])(\d+))?"
It's just an indication of the level of difficulty...
__________________
Danny Bessems - founder of online-roleplaying.commodities

"Coolest Avatar Award™ 2005"-winner
Reply With Quote
  #135  
Unread 28th of February, 2007, 23:34
zachol's Avatar
zachol
Flesh Colossus [Epic GM]

User is offline
 
Join Date: Jan 2005
Member: #1103
Location: Glorious Nippon
Posts: 8,153 (1.74 per day)
Ooo... fun!


And I will stop pestering you for new features... now.
__________________
Sleepy cat is sleepy.
Reply With Quote
  #136  
Unread 1st of March, 2007, 06:13
Black Plauge's Avatar
Black Plauge
PhD in Physics [Epic GM]

User is offline
 
Join Date: Sep 2002
Member: #192
Location: Old Town, ME
Posts: 6,801 (1.23 per day)
I have written a dice roller which is capable of handling multiple dice. It does still have some difficulty with negative numbers (which have to be written as '1d6+-2' instead of '1d6-2') and is written in python but if you want Danny, I can pass you the code.
__________________
Physics is like sex. Sometimes it yields practical results, but that's not why we do it.
-Richard Feynman
Reply With Quote
  #137  
Unread 3rd of March, 2007, 05:26
Black Plauge's Avatar
Black Plauge
PhD in Physics [Epic GM]

User is offline
 
Join Date: Sep 2002
Member: #192
Location: Old Town, ME
Posts: 6,801 (1.23 per day)
Update. A small modification to my code as allowed it to handle negative numbers just fine. If you want it, let me know.
__________________
Physics is like sex. Sometimes it yields practical results, but that's not why we do it.
-Richard Feynman
Reply With Quote
  #138  
Unread 4th of March, 2007, 02:06
LeeCHeSSS's Avatar
LeeCHeSSS
Psionic Lich [Epic Admin]

User is offline
 
Join Date: Dec 2001
Member: #1
Location: The Netherlands
Posts: 2,047 (0.35 per day)
I don't think python is in any way compatible with php, is it?
__________________
Danny Bessems - founder of online-roleplaying.commodities

"Coolest Avatar Award™ 2005"-winner
Reply With Quote
  #139  
Unread 5th of March, 2007, 02:12
Black Plauge's Avatar
Black Plauge
PhD in Physics [Epic GM]

User is offline
 
Join Date: Sep 2002
Member: #192
Location: Old Town, ME
Posts: 6,801 (1.23 per day)
http://www.csh.rit.edu/~jon/projects/pip/
__________________
Physics is like sex. Sometimes it yields practical results, but that's not why we do it.
-Richard Feynman
Reply With Quote
  #140  
Unread 5th of March, 2007, 04:10
LeeCHeSSS's Avatar
LeeCHeSSS
Psionic Lich [Epic Admin]

User is offline
 
Join Date: Dec 2001
Member: #1
Location: The Netherlands
Posts: 2,047 (0.35 per day)
I'm definatly not going to use anything like that...
__________________
Danny Bessems - founder of online-roleplaying.commodities

"Coolest Avatar Award™ 2005"-winner
Reply With Quote
  #141  
Unread 5th of March, 2007, 11:15
Black Plauge's Avatar
Black Plauge
PhD in Physics [Epic GM]

User is offline
 
Join Date: Sep 2002
Member: #192
Location: Old Town, ME
Posts: 6,801 (1.23 per day)
Okay. Then I guess the answer is "no, python is not compatible with php."
__________________
Physics is like sex. Sometimes it yields practical results, but that's not why we do it.
-Richard Feynman
Reply With Quote
  #142  
Unread 5th of March, 2007, 11:40
nightinverse's Avatar
nightinverse
Vampiric Dwarven Psychologist [Epic GM]

User is offline
 
Join Date: Jan 2005
Member: #1101
Location: Beneath & Above
Posts: 6,596 (1.41 per day)
I would suppose so.
__________________
Winner of Jimmboe's Seal of Approval
Reply With Quote
  #143  
Unread 6th of March, 2007, 08:43
LeeCHeSSS's Avatar
LeeCHeSSS
Psionic Lich [Epic Admin]

User is offline
 
Join Date: Dec 2001
Member: #1
Location: The Netherlands
Posts: 2,047 (0.35 per day)
Black Plauge, can you send the code to me regardless? I might very well be able to rewrite it to php
__________________
Danny Bessems - founder of online-roleplaying.commodities

"Coolest Avatar Award™ 2005"-winner
Reply With Quote
  #144  
Unread 7th of March, 2007, 04:09
Black Plauge's Avatar
Black Plauge
PhD in Physics [Epic GM]

User is offline
 
Join Date: Sep 2002
Member: #192
Location: Old Town, ME
Posts: 6,801 (1.23 per day)
Code:
#Dice roller.  Input is string of the form 'xdy+z' where x, y, & z are integers.
#Can handle more than one kind of dice with strings like 'xdy+zda+b'.  Can
#access droplow by using the notation 'xdy-L'.
def roll(dice):
    dice = dice.replace('-','+-')
    dice = dice.replace('++-','+-')
    dice = dice.replace('+-L','-L')
    dice = dice.split('+')
    r = 0
    for i in range(len(dice)):
        if '-L' in dice[i]:
            r += droplow(dice[i].split('-L')[0])
        elif 'd' in dice[i]:
            dice[i] = dice[i].split('d')
            if dice[i][1] == '%':
                dice[i][1] = 100
            if int(dice[i][0]) < 0:
                r += sum(random_integers(-int(dice[i][1]),-1,size=abs(int(dice[i][0]))))
            else:
                r += sum(random_integers(int(dice[i][1]),size=int(dice[i][0])))
        else:
            r += int(dice[i])
    return r

#Handles dice rolls where you want to drop the lowest dice.  Seperated from the
#normal dice roller so that it can be called directly.  Cannot handle multiple
#kinds of dice in the same roll.
def droplow(dice):
    dice = dice.split('d')
    if int(dice[0]) < 0:
        r = random_integers(-int(dice[1]),-1,size=abs(int(dice[0])))
    else:
        r = random_integers(int(dice[1]),size=int(dice[0]))
    return sum(r)-min(r)
__________________
Physics is like sex. Sometimes it yields practical results, but that's not why we do it.
-Richard Feynman

Last edited by Black Plauge; 7th of March, 2007 at 04:11.
Reply With Quote
  #145  
Unread 7th of March, 2007, 04:18
Black Plauge's Avatar
Black Plauge
PhD in Physics [Epic GM]

User is offline
 
Join Date: Sep 2002
Member: #192
Location: Old Town, ME
Posts: 6,801 (1.23 per day)
If you need help understanding python syntax, let me know.

Note that specialty dice (like d%) can be added via an appropriate if statement in the same area where the % get's converted to a 100. In fact, I think I'm going to modify my die roller to add some more specialty dice.
__________________
Physics is like sex. Sometimes it yields practical results, but that's not why we do it.
-Richard Feynman
Reply With Quote
  #146  
Unread 7th of March, 2007, 06:15
LeeCHeSSS's Avatar
LeeCHeSSS
Psionic Lich [Epic Admin]

User is offline
 
Join Date: Dec 2001
Member: #1
Location: The Netherlands
Posts: 2,047 (0.35 per day)
Your code does not use regexp, which makes it "slow" (at least if I would use your method in php).

I'll work on multiple dicerolls (and drop-lowest feature I already promised earlier) after I finish the most anticipated feature since PBP was invented... (which actually is progressing very fast)
__________________
Danny Bessems - founder of online-roleplaying.commodities

"Coolest Avatar Award™ 2005"-winner
Reply With Quote
  #147  
Unread 7th of March, 2007, 14:22
Gnarsh's Avatar
Gnarsh
Banned Fool

User is offline
 
Join Date: Jan 2002
Member: #26
Location: Maryland
Posts: 1,293 (0.22 per day)
Pixellated characters?

EDIT: Thousandth post!
Reply With Quote
  #148  
Unread 7th of March, 2007, 18:47
LeeCHeSSS's Avatar
LeeCHeSSS
Psionic Lich [Epic Admin]

User is offline
 
Join Date: Dec 2001
Member: #1
Location: The Netherlands
Posts: 2,047 (0.35 per day)
Pfft, let me delete a post from you in my hidden forum (you played in City of the Spider Queen) and you'll be back to 999...
__________________
Danny Bessems - founder of online-roleplaying.commodities

"Coolest Avatar Award™ 2005"-winner
Reply With Quote
  #149  
Unread 8th of March, 2007, 02:31
LuneMoonshadow's Avatar
LuneMoonshadow
Zombie Housecat [Epic GM]

User is offline
 
Join Date: Jul 2003
Member: #388
Location: 3,437 (2.92 per day)
Posts: 4,156 (0.79 per day)
So is it just me or is there suddenly one of those small little icons associated with the page that shows up for bookmarks now?
__________________
Warning: Plot twists may cause long term side effects such as mistrust, amazement, and addiction.
Reply With Quote
  #150  
Unread 8th of March, 2007, 03:39
LeeCHeSSS's Avatar
LeeCHeSSS
Psionic Lich [Epic Admin]

User is offline
 
Join Date: Dec 2001
Member: #1
Location: The Netherlands
Posts: 2,047 (0.35 per day)
I should punish you for the off-topic-ness of your question, but I won't.

It didn't take you long noticing the icon at all, I just re-added it (it's called a favicon.ico)
__________________
Danny Bessems - founder of online-roleplaying.commodities

"Coolest Avatar Award™ 2005"-winner
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 13:39.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Graphics by Koert van Kleef (T0N!C) and Lyle Warren