LonePaladin
 member, 845 posts
 Creator of HeroForge
Mon 19 Aug 2019
at 06:29
Embed Die Rolls in Posts?
There's a feature that probably doesn't get much use here (though I like it) -- the ability to write up a link in a post or character sheet, that when you click the link it jumps you to the Die Roller with whatever presets you make in the link.

It's explained in the Die Roller section of the Help page, but as a brief summary you can place [dice=3d6] into a post, and it turns into a link to the Die Roller page, all set to roll 3d6. You can add other bits to set it for pre-set game systems, include Reason text, or replace the "Link to Die Roller" text with whatever you want.

But what if we had the ability to simply embed a result from the Die Roller into a post directly? Similarly to the way Private Lines work, you could have it start with some code -- say, [roll=3d6] -- and when you click on Post Message, it will replace that bit of code with a roll of the dice.

For example, you post:
quote:
Urkel attacks the goblin, hitting AC [roll=1d20+3] for [roll=1d6+1] damage.

And what gets posted might look like:
quote:
Urkel attacks the goblin, hitting AC {14} for {4} damage.

The brackets would inform everyone that it was auto-generated.

Now, the obvious question: what's to stop players from editing their post afterward and making the numbers say what they want? The way editing works, probably nothing -- but if the Die Roller page also generated a result with each use of the [roll] tag, GMs would have a way to double-check. And every edited post is flagged as being edited, so GMs would be informed that they might want to look.
bigbadron
 moderator, 15780 posts
 He's big, he's bad,
 but mostly he's Ron.
Mon 19 Aug 2019
at 06:51
Embed Die Rolls in Posts?
It's a good idea, in principle, but I'm wondering how much use it would see.  A lot of players, in my experience, make posts that reflect their dice rolls, which they can't do if the roll is made when they hit the post button (not without going back to edit their post every time).

For example: if they roll a critical hit in an ongoing combat (one where they have a rough idea of what is needed to hit) they will then post to describe that solid hit.  Likewise if they roll an obvious fumble/botch, they will post describing the dropped/broken weapon or tool.
jase
 admin, 3676 posts
 Cogito, ergo procuro.
 Carpe stultus!
Mon 19 Aug 2019
at 09:58
Embed Die Rolls in Posts?
The first issue is that the roller is so powerful that the syntax is quite daunting and, as an unavoidable consequence, cumbersome.

The second, and far more important issue, is that there are ways you can manipulate the results.  I've seen it for myself (not here obviously) and have not seen any ways to eliminate it.  Maybe it's just me automatically looking for issues with any feature.

The other annoying thing about it, as BBR said, is you've got to post the message before you can see the results.  "I hit the troll".  Edit.  "I miss the troll!".

I'd actually rather have a system where you rolled in the dice roller and then could reference the result.  GM would have to enforce a description for each roll (no point doing two d20's and then cherry picking which result was for which action).

Something like [roll=36224.101.1566207903] which refers to the roll in game 36224, roll for character 101 (presumably your character) and 1566207903 (linux version of "now" (as I type this)).

Then the system would automatically extract the result and populate it in the message, with an added bonus of there being a hover-over help that gave the memo/reason for the roll.  Plus probably some auto-cheat mechanism if the roll was a lot older than the date of the post.

Providing the player puts in a proper description for the result and the GM checks the roller log (the "rolls" link next to the post would be handy here) in case the user has pretended a poor roll never happened... then I can't see any way it could be manipulated.  The added bonus is you get to see the result of your rolls before you post.

That's just my off-the-top-of-my-head idea.
LonePaladin
 member, 846 posts
 Creator of HeroForge
Mon 19 Aug 2019
at 21:07
Embed Die Rolls in Posts?
That sounds like a much more elegant solution.

On the surface; I know that under the hood, it would look like a Rube Goldberg machine.
jase
 admin, 3678 posts
 Cogito, ergo procuro.
 Carpe stultus!
Tue 20 Aug 2019
at 06:37
Embed Die Rolls in Posts?
Pretty happy with the results.  You roll in the dice roller and it'll give a link to the results.  You then copy and paste that into your message.

Looks like below (with me hovering my mouse over the "80" to see the help text and also the roll memo/note).

Will add in a little security (can't link to another character's roll (GM excepted) and it'll also make a note if the message date and the roll are in really disparate times).


jase
 admin, 3681 posts
 Cogito, ergo procuro.
 Carpe stultus!
Tue 20 Aug 2019
at 15:03
Embed Die Rolls in Posts?
I've uploaded the code for this to the responsive site so you should be able to use it there, but only there.

If you link to a post then people using the responsive site will see it, but be warned that those using the "normal" site will just see [roll=784345.44343.353].  Also update your custom theme if you're using one.

Changed the code a little so that the log will only have links for those rolls you have "access" to (i.e. its one of your characters (or you're the GM)).  Security isn't as awesome as I'd like it as it's theoretically possible to link to someone else's roll (normally I'd make it impossible), but you'd have to go through around 60 million permutations so pretty comfortable with that (the log only shows the hour and minute of each roll, you'd need to figure the second and microsecond the roll was performed).

Pretty exited to have this one available so would love some feedback.  If it goes down really well I'll even look at hacking it into the normal site.

This message was last edited by the user at 15:32, Tue 20 Aug.

horus
 member, 844 posts
 Wayfarer of the
 Western Wastes
Tue 20 Aug 2019
at 16:27
Embed Die Rolls in Posts?
Wow... this is pretty neat because it helps streamline the flow of a game nicely.

Will test when I get some more time (maybe tonight when I get home).

Thanks, LP, for suggesting, and jase for implementing.
theseeker
 member, 15 posts
Tue 20 Aug 2019
at 22:45
Embed Die Rolls in Posts?
;) Black Hat on ;)

Not tested, but it might not be as hard to link in someone else's roll as you think.  **IF** they put the roll in a post you can see, view it on the normal site, and copy/past the number.

Assuming I understood how the pieces fit together.
jase
 admin, 3682 posts
 Cogito, ergo procuro.
 Carpe stultus!
Wed 21 Aug 2019
at 04:13
Embed Die Rolls in Posts?
You are correct.  People can also use "quote" to get the text out.

But if someone's posted their roll then they're obviously happy with the content being public.

I'm more concerned about it from a perspective of someone managing to link to a roll that's otherwise not visible to them.  If the link has been published then it's clearly visible to them.  (c;

What I'll probably also do is make sure the linked roll is owned by the character posting the message (usual caveat; unless the poster is a GM).

I've got to figure out what additional information is displayed.  If it's a secret roll then I'll probably still display it as if someone links to a secret roll then they're obviously happy with it being published.  There’s also the fudged/rigged comment that’s included in the roll when the GM is manipulating the results, in which case I’ll show that if the viewer is a GM.

All those little bits need to be included but I’m ok with people knowing the link to the roll once the link has been posted.  Plus with the additional security even if they do put it in a post of their own it won’t actually do anything.  I think… whole thing was a bit rushed ‘cos I was excited.  (c;
Imladir
 member, 11 posts
Thu 22 Aug 2019
at 18:19
Embed Die Rolls in Posts?
I've just tested it and it seems to be working just fine...as long as there's only one link per line. The second one (and any roll after that I suppose) is not formatted and is displayed as [roll=xxxxxxxxxxxxxx].
jase
 admin, 3686 posts
 Cogito, ergo procuro.
 Carpe stultus!
Fri 23 Aug 2019
at 04:27
Embed Die Rolls in Posts?
Right you are!  Have fixed that up, thanks.

Have also applied security to the linking.  If you don't have access to the roll (i.e. you've copied it from someone else's post) then it'll get displayed as "[roll=128738247.5454.433(invalid)".  If the roll doesn't exist in the log then it'll have "(missing)" at the end instead.

Speaking of, because it all relies on grabbing the result from the dice roller log I've increased the log from 200 rolls to 1,000.

I'm actually wondering if the alternate/better way is to have the system extract the roll information as you save the message and insert the roll information that way.  That way it's permanently saved within the message (not withstanding editing it).

Currently if the GM deletes the roll log or it was over 1,000 rolls ago it'll stop getting displayed.

There's more security concerns if I save it within the message but shouldn't be insurmountable.
Pat
 supporter, 161 posts
Tue 27 Aug 2019
at 14:19
Embed Die Rolls in Posts?
One problem I'm having with this is the punctuation. With the roll ID being encased in [], pasting in a private line doesn't work.
jase
 admin, 3704 posts
 Cogito, ergo procuro.
 Carpe stultus!
Tue 27 Aug 2019
at 15:49
Embed Die Rolls in Posts?
Very good point.  I think I can move it so it messes with the rolls before then doing the PLs.

Also trying to decide if I change the way it works so it saves the roll result into the actual message (rather than pulling it from the log).  Will do both at once if I go that way.

Until then, avoid using rolls in PLs.  (c;
Escribblings
 member, 28 posts
Wed 4 Sep 2019
at 23:31
Embed Die Rolls in Posts?
[moved]

This message was last edited by the user at 11:54, Sat 07 Sept.

SunRuanEr
 subscriber, 139 posts
Thu 5 Sep 2019
at 01:56
Embed Die Rolls in Posts?
Just went and tested this a bit, and I notice that it tags Secret Rolls with an 'RUBB::secret', yet still displays all their information.

Is it possible to make the hover-over text only visible to the GM and the player that made the roll, IF it's a Secret roll?* Or to make the hover-over text eliminate the dice modifiers, etc?

I know a lot of people roll in secret and strip the crunchy bits out, to prevent other players from extrapolating their stats, yet still post up the results publicly that would probably get use out of this neat feature if they could use it without giving away the farm.

*-this might already be the case, but I can't verify that to be sure
accident
 member, 3 posts
Fri 6 Sep 2019
at 03:41
Embed Die Rolls in Posts?
I'd vote for getting the results from the roller and saving them in the message. Worst case, it's subject to the same type of tampering that you'd have now with people copy-pasting the line from the log. You could include an identifier (like the timestamp) either in line or in a mouse over, that could be used to verify (if within the last 1000 rolls).

I imagine going through old messages and seeing a bunch of invalid roll tags wouldn't be great for posterity :)
theseeker
 member, 22 posts
Fri 6 Sep 2019
at 19:37
Embed Die Rolls in Posts?
There seems to be a glitch in the display of dice roller information on the responsive site.  The pasted link shows as
«left bracket»roll=«number».«number».«number»«right bracket».  However, the displayed contents shows (without hover) as
quote:
6.  «roll reason text»«single quote character» class=«single quote character»helphover«single quote character»4 successes
That leading `6` is the last die from the roll.  Hover does nothing.  I am guessing that that extra quote character is messing things up.  If it matters, this is using the `Shadowrun 4th ed` system in the dice roller.  No special characters in the reasons field.  Unless a comma or minus is special.

With the rules about linking to existing games, I am not including the actual roll link here.
jase
 admin, 3723 posts
 Cogito, ergo procuro.
 Carpe stultus!
Sat 7 Sep 2019
at 06:28
Embed Die Rolls in Posts?
Have tweaked some of the dice parsing, see if that's better now.

Secret rolls will show all the details if you link to them.  It's trickier than you think removing all the random roll information, for now pop it in a private line to the GM if you want to keep it between you and them.

Speaking of, you can now do that without it prematurely ending the PM.
Pat
 supporter, 162 posts
Sat 7 Sep 2019
at 20:58
Re: Embed Die Rolls in Posts?
jase:
Speaking of, you can now do that without it prematurely ending the PM.


Yay!
theseeker
 member, 23 posts
Sun 8 Sep 2019
at 05:14
Re: Embed Die Rolls in Posts?
jase:
Have tweaked some of the dice parsing, see if that's better now.

This did not fix the rolls included in the previous post, but it does now display correctly for a new roll.  I gather the parsing is done at post creation time, not when the link is displayed later.  Which makes sense, given the discussion about the 1000 roll history.

Hmmm, assumption does not quite hold up.  Editing the previous post did not get it to reparse either.  Must be tied to when the dice roller link was created.

<thumbs up>
jase
 admin, 3727 posts
 Cogito, ergo procuro.
 Carpe stultus!
Sun 8 Sep 2019
at 07:58
Re: Embed Die Rolls in Posts?
In reply to theseeker (msg # 20):

rMail me the rolls, might be a parsing issue.  tx