PDA

View Full Version : Dice Roller Bug? 1st Post in thread fails?



Ardemus
2008-03-30, 11:11 AM
I'm a little baffled, and frankly I've made a bit of a mess.

I didn't find any resources explaining dice rolling, so I used the "How do you roll dice...?" thread to figure out how the system worked. Then I came up with a help doc explaining how it worked.

Well, I made a new thread and threw my (already tested on another thread) text in there and the dice rolls didn't work.

I assumed a mistake on my part, tested again, and tried again. Same problem, however pasting the same code into a reply worked just fine.

I figured that the root post couldn't have dice in it for some reason. So I created a third post breaking the instructions out into the root, and the 1st reply. That didn't work either. However, the same code pasted into the 2nd reply worked just fine.

I'm writing this for two reasons:

1) Can someone clean up the junk threads that I made?
2) Can someone explain what is happening? It seems like a bug to me.

Thanks and Appologies

Ardemus
2008-03-30, 11:15 AM
Here are the three threads, newest to oldest:

76343
76341
76337

Shhalahr Windrider
2008-03-30, 11:50 AM
Not being involved in the coding in anyway, I can't give you the wherefores of it, but no rolling in the first post isn't really a bug as it is a limitation. I don't think there's a whole lot that can be done for that without really drastic changes to the whole rolling system.

Winterwind
2008-03-30, 12:34 PM
If I remember the explanation correctly, the dice roller requires the database to work. Since a thread is not present in the database when it is created, the dice roller does not work in the first post.

Ardemus
2008-03-30, 03:14 PM
Ok, so the first post really doesn't work. Thanks :)

However, I wonder why my 2nd post didn't work either, maybe I need to wait a few minutes to make sure that it's propagated through the database.

I think I'll just make an editable post in one of the higher forums and link to it from the dice rolling forum so I can make changes as needed.

Zherog
2008-03-30, 08:28 PM
If I remember the explanation correctly, the dice roller requires the database to work. Since a thread is not present in the database when it is created, the dice roller does not work in the first post.

Correct. Die rolls are stored in the database, with the ID of thread as part of the record. When you're creating a new thread, there isn't an ID yet so it's unable to store the record properly.

I don't see where you actually have any rolls in the second or third posts of those threads. You have them inside the CODE tag, which is gonna turn them off. I posted a die roll here (in one of your threads) (http://www.giantitp.com/forums/showthread.php?p=4125959&posted=1#post4125959) and it worked just fine.

Ardemus
2008-03-30, 09:07 PM
Thank you for the continued input. I've gotten things sorted out and working correctly.

I've posted the main tutorial here in OOC:
http://www.giantitp.com/forums/showthread.php?p=4124667#post4124667

And dropped a link to it from here in Dice Rolls:
http://www.giantitp.com/forums/showthread.php?t=76370

I contacted Rawhide about possibly cleaning up the extra posts in Dice Rolls, and making a sticky tutorial thread.


You have them inside the CODE tag, which is gonna turn them off.

That is what I expected, and I tried to use that for documenting the rules! I was dismayed to find that [noparse] and [code] tags have no effect on [roll] and [rollv] tags. :smalleek: I was only able to communicate the source code without substitution by editing the posts (the forum does not parse new roll / rollv tags after the initial post submission).

You'll note that the links above have perfectly functional die rolls within code tags. In fact, the 1st and 2nd posts in the thread that you contributed to use exactly the same source code (save the small preamble), but you can see [rollx] markers in the first and calculated die rolls in the second.

It's rather interesting because it tells a story about how the [roll] tag is implemented. I can point you to my experiments in the Dice Rolls thread if you're interested.