Tooltips for roll expansion

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm
Contact:

Post by Mr. Pokeylope »

kat2cute wrote:Like the looks of the new syntax. Question, about HTML code work in your Separator area for [C(n): ]. I think I'd want my separator to be <br>, and is there any way to get a new line without using HTML? I am also assuming that the 'n' value will pop up if it is an undefined variable for user-input. Looks nice.


Yes, [C(3, "<br>"): d20] would be valid, and [C(num): d20] would prompt for the value of "num".

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm
Contact:

Post by Mr. Pokeylope »

Naryt wrote:How will the hidden roll be hidden? Will it automatically generate HTML comments or will the output be completely suppressed? If completely suppressed, might I suggest adding another option that outputs as [] does now but automatically wraps it in <!-- --> tags?

It's completely suppressed. An option to put the roll in a comment could be added if people want it. (I'm guessing you want it to show up when you save the chat history?)

Naryt wrote:
Mr. Pokeylope wrote:[D: ] - display individual die rolls. [D: 3d8 + 4] displays as "3d8 + 4 = (3 + 2 + 5) + 4 = 14" (long option is... uh, something)

Mmm that last option is something I miss for some reason. Yes, we really only need the total but it somehow seems more statisfying to know I rolled a 3,7,1 to get that 11.

Yeah, I just want to get the basic framework finished before I go and start hacking at the parser library. Expanded die rolls is going to be a bit more work than most of the other options.

User avatar
Naryt
Dragon
Posts: 517
Joined: Fri Oct 26, 2007 8:55 am
Location: Near a tree, in a cave, under a rock.

Post by Naryt »

Mr. Pokeylope wrote:
Naryt wrote:How will the hidden roll be hidden? Will it automatically generate HTML comments or will the output be completely suppressed? If completely suppressed, might I suggest adding another option that outputs as [] does now but automatically wraps it in <!-- --> tags?

It's completely suppressed. An option to put the roll in a comment could be added if people want it. (I'm guessing you want it to show up when you save the chat history?)


Right, that way if someone wants to dispute the roll after the fact (or even mid game) there's still the possibility of verification. Of course, I can just leave my current <!-- [] -->{} rolls as is and still have that, just not having the <span title="expanded roll data"> in the comments would make it clearer.

Mr. Pokeylope wrote:
Naryt wrote:
Mr. Pokeylope wrote:[D: ] - display individual die rolls. [D: 3d8 + 4] displays as "3d8 + 4 = (3 + 2 + 5) + 4 = 14" (long option is... uh, something)

Mmm that last option is something I miss for some reason. Yes, we really only need the total but it somehow seems more statisfying to know I rolled a 3,7,1 to get that 11.

Yeah, I just want to get the basic framework finished before I go and start hacking at the parser library. Expanded die rolls is going to be a bit more work than most of the other options.

Oh, I completely understand. I went hunting the parser details early on and, well let's just say I got lost. ;)
A wandering lost soul

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Post by jfrazierjr »

Mr. Pokeylope wrote:
kat2cute wrote:Like the looks of the new syntax. Question, about HTML code work in your Separator area for [C(n): ]. I think I'd want my separator to be <br>, and is there any way to get a new line without using HTML? I am also assuming that the 'n' value will pop up if it is an undefined variable for user-input. Looks nice.


Yes, [C(3, "<br>"): d20] would be valid, and [C(num): d20] would prompt for the value of "num".


So Mr. Pokeylope, will

[C(3, ""): "Attack: " + d20 + "<br>" ]

just work? Also, any chance (in the following release if not this one) of making some type of property to get at the loop counter? I am thinking of something like this:

[C(3, ""): "Attack: " + loopcounter + d20 + "<br>" ] so that it does:

Attack 1: 15
Attack 2: 4
Attack 3: 19

of course, I don't care what the specific variable name is, but perhaps loop.counter would be nice and descriptive.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm
Contact:

Post by Mr. Pokeylope »

jfrazierjr wrote:So Mr. Pokeylope, will

[C(3, ""): "Attack: " + d20 + "<br>" ]

just work?

Yep.

jfrazierjr wrote:Also, any chance (in the following release if not this one) of making some type of property to get at the loop counter?

Hmm. That sounds reasonable. How does roll.count sound?

Lindharin
Dragon
Posts: 668
Joined: Sat Apr 21, 2007 4:51 pm

Post by Lindharin »

Mr. Pokeylope wrote:
jfrazierjr wrote:So Mr. Pokeylope, will

[C(3, ""): "Attack: " + d20 + "<br>" ]

just work?

Yep.


Do we really need the separator then? If I can just put the separator I want at the end of the expression, what benefit does including a separator in the options area provide?

Also, what tooltip behavior will it have when you use the C option? Are all of the loops put into the tooltip?


Mr. Pokeylope wrote:
jfrazierjr wrote:Also, any chance (in the following release if not this one) of making some type of property to get at the loop counter?

Hmm. That sounds reasonable. How does roll.count sound?

Works for me...

Another question: What happens if the expression inside a C loop is an assignment? What does [C(3):AttRoll=1d20] actually do?

Is it feasible to have assignments in a C loop automatically apply an incrementing suffix to the variable on the left side of the assignment? For example, something like:

[C(3):AttRoll = 1d20]

would be equivalent to:

[AttRoll1=1d20]
[AttRoll2=1d20]
[AttRoll3=1d20]

Is that possible and desirable? Or maybe instead of it happening automatically, you have to use a flag of some type. Maybe you would need to do [C(3):AttRoll.suffix=1d20] to have it create variables AttRoll1, AttRoll2 and AttRoll3?

Just a random thought...

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm
Contact:

Post by Mr. Pokeylope »

Lindharin wrote:Do we really need the separator then? If I can just put the separator I want at the end of the expression, what benefit does including a separator in the options area provide?

Because [c(3): d20 + ", "] would then give "6, 2, 11, ". You don't want the separator included for the last roll.

Lindharin wrote:Also, what tooltip behavior will it have when you use the C option? Are all of the loops put into the tooltip?

Each one has its own tooltop. [c(3): d20] is equivalent to [d20], [d20], [d20].

Lindharin wrote:Another question: What happens if the expression inside a C loop is an assignment? What does [C(3):AttRoll=1d20] actually do?

It does the assignment three times, so AttRoll ends up with whatever the value of the third roll was.

Lindharin wrote:Is it feasible to have assignments in a C loop automatically apply an incrementing suffix to the variable on the left side of the assignment? For example, something like:

[C(3):AttRoll = 1d20]

would be equivalent to:

[AttRoll1=1d20]
[AttRoll2=1d20]
[AttRoll3=1d20]

Is that possible and desirable? Or maybe instead of it happening automatically, you have to use a flag of some type. Maybe you would need to do [C(3):AttRoll.suffix=1d20] to have it create variables AttRoll1, AttRoll2 and AttRoll3?

You can accomplish this with [c(3): eval("AttRoll" + roll.count + " = d20")].

So, it's now working as described here (still no S or D options). Tomorrow (er, well, today after I wake up) I'll test it some more, make sure the code's nice and clean, check for any last-minute suggestions here, then send the patch off to Trevor.

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm
Contact:

Post by Mr. Pokeylope »

jfrazierjr wrote:So Mr. Pokeylope, will

[C(3, ""): "Attack: " + d20 + "<br>" ]

just work?

As a followup to my previous answer, yes, but you'd probably want [C(3, "<br>"): "Attack: " + d20 ] instead. The extra "<br>" that you get doesn't make a difference in this case, but it does keep the tooltips cleaner: you get
"Attack: " + d20 = "Attack: " + 15
instead of
"Attack: " + d20 + "<br>" = "Attack: " + 15 + "<br>"

knizia.fan
Giant
Posts: 197
Joined: Wed Jul 30, 2008 3:43 pm

Post by knizia.fan »

Hey Trevor! You may want to disable some of the following smilies in the forum management software. Once Mr. Pokeylope's patch goes live, people may get burned when they post code with the new syntax. We know from our experience with HTML tags that people will post without realizing that their text was mangled.

The smilies that could cause problems are

Code: Select all

:(    :D    :x    8)    :o    :-o


The first two are pretty common smiley abbreviations, so we might have to keep them and live with the problems.

Thanks,
--k.fan

Code: Select all

 
[Q:( Strength + Bonus )]
[Q:D + E + F]
[Q:x + y]
[C(8): 3d8]
[Q:o + p]
[Q:-o + p]
 

[Q:( Strength + Bonus )]
[Q:D + E + F]
[Q:x + y]
[C(8): 3d8]
[Q:o + p]
[Q:-o + p]

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Post by jfrazierjr »

Mr. Pokeylope wrote:
jfrazierjr wrote:So Mr. Pokeylope, will

[C(3, ""): "Attack: " + d20 + "<br>" ]

just work?

Yep.

jfrazierjr wrote:Also, any chance (in the following release if not this one) of making some type of property to get at the loop counter?

Hmm. That sounds reasonable. How does roll.count sound?



Sure. You could call it fragglebutt for all I care as long as I have access to it, but yea....roll.count sounds just fine and dandy to me.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
BigO
Dragon
Posts: 558
Joined: Mon Jul 28, 2008 12:23 pm
Location: Oshkosh, WI
Contact:

Post by BigO »

Mr. Pokeylope wrote:
jfrazierjr wrote:So Mr. Pokeylope, will

[C(3, ""): "Attack: " + d20 + "<br>" ]

just work?

Yep.

jfrazierjr wrote:Also, any chance (in the following release if not this one) of making some type of property to get at the loop counter?

Hmm. That sounds reasonable. How does roll.count sound?

I like roll.count.

Will we be able to include IF statements in the [C:] loop? Please?
--O

I am a small and fragile flower.
http://maptool.rocks.andyousuck.com

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm
Contact:

Post by Mr. Pokeylope »

BigO wrote:Will we be able to include IF statements in the [C:] loop? Please?

Of course. Anything you can do in [ ], you can do in [c(): ].

User avatar
Orchard
Great Wyrm
Posts: 1852
Joined: Fri May 09, 2008 10:45 am
Location: Doylestown PA
Contact:

Post by Orchard »

Mr. Pokeylope wrote:
BigO wrote:Will we be able to include IF statements in the [C:] loop? Please?

Of course. Anything you can do in [ ], you can do in [c(): ].


you rock!
0+0=1, for very unstable CPUs.

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm
Contact:

Post by Mr. Pokeylope »

So, I lied; I haven't actually sent the patch in. I was doing some testing and found I needed some more functionality to make one of my macros do what I wanted. (Namely, I wanted to roll a die and save the value, and have it be verifiable, but not have it appear in the output. So now [t("foo"): ] will output the text "foo" and show the roll as a tooltip.)

Also, is there anyone out there who has an SVN checkout and some free time that I can send the patch to? I wouldn't mind another person or two throwing test cases at my code and just generally making sure it does what people want it to. Since I completely changed the way MapTool parses rolls, I'd like to make sure everything works properly.

User avatar
Full Bleed
Demigod
Posts: 4558
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

Post by Full Bleed »

Mr. Pokeylope wrote:Also, is there anyone out there who has an SVN checkout and some free time that I can send the patch to? I wouldn't mind another person or two throwing test cases at my code and just generally making sure it does what people want it to. Since I completely changed the way MapTool parses rolls, I'd like to make sure everything works properly.


I suggest that you contact Giliath directly. Parser stuff seems to go through him.

Post Reply

Return to “MapTool”