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
BigO
Dragon
Posts: 558
Joined: Mon Jul 28, 2008 12:23 pm
Location: Oshkosh, WI
Contact:

Post by BigO »

Mr. Pokeylope wrote: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.
I'm always up for some testing. I've got eclipse set up to work with SVN but you'll have to teach me how to apply your patch.
--O

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

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

Post by Lindharin »

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 can test it. I'll PM you with my email address.

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

Full Bleed wrote:
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.
This is correct, but be sure to CC: me too
Dreaming of a 1.3 release

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

Also, I'd like to take a moment for a quick reminder:

We love community led development and contributions. That said, we need contributors to communicate directly with myself and giliath whenever they are considering making a large or invasive change.
Dreaming of a 1.3 release

User avatar
giliath
RPTools Founder
Posts: 275
Joined: Tue Jan 31, 2006 11:10 am
Location: Austin, TX

Post by giliath »

trevor wrote: We love community led development and contributions. That said, we need contributors to communicate directly with myself and giliath whenever they are considering making a large or invasive change.
Also, keep in mind, we have to coordinate simultaneous changes, keep a consistent and solid base, so we can try to provide the best version of MapTool we can. At the moment we are looking very seriously at a change that provides a more full scripting language support and more generic approach to macros that will likely conflict with the changes discussed here.

That being said, I am looking forward to seeing this patch as it has several things Trevor and I have talked about potentially doing but have not had the time to.
~Giliath

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

Post by Lindharin »

Hi there,

I've been testing Mr. Pokeylope's new [] format and it works very well, and I've emailed him with some initial feedback.

But aside from testing whether the function works as designed, trying to integrate it into my existing macros has led me to realize that I personally don't really use it much.

The new [] functionality works GREAT when you are typing in the chat line or using simple macros with everything calculated in-line.

If you use complicated macros where you do a lot of calculations up top (usually hidden) and then display the results down below in a specific format, it doesn't really help. Putting the [] around the calculations doesn't matter since you don't want them shown. Putting the [] at the bottom where you output the results doesn't help since it just lists "myVar=20" or whatever, rather than how the 20 was generated earlier.

What I am making real use of is the behind-the-scenes change that allows tooltips at all. By using something like:

Code: Select all

"<span title=' "+myVarDetail+" '>"+myVar+"</span>
I can keep the original roll details in a variable like myVarDetail and list that in the tooltip at the time of display, way down at the bottom of the macro.

Another thing I keep using is the looping mechanism with [c(n):blah]. That is really useful for shortening macro code. For example, in the sample code I've seen for using the health bar state overlays, there are like 20+ if statements to turn on and off the states based on your current hp percentage. With the loop mechanism, it can be reduced to 3 lines:

Code: Select all

[c(21):eval("state.HP"+(5*(roll.count-1))+"=0")]
[HPPct=5*round(max(HP,0)/MaxHP*20+0.49999)]
[eval("state.HP"+HPPct+"=1")]
Another thing I use the loop for is building a string from the results of multiple dice rolls. Let's say I need to roll 3d6 for damage but I want to display each die roll in the tooltip, like "3+1+5" or whatever I rolled.

If I do something like [c(3,"+"):myVar=1d6] the end result is that myVar just has the third roll since you keep overwriting it. What you need to do is [c(3):myVar=if( roll.count==1, 1d6, myVar+"+"+roll(1d6))]. That is not hard, but as a future enhancement maybe we could add an assignment operator. Something like [A(myVar),C(3,"+"):1d6] would roll the 1d6 three times (with "+" as the separator) and just append the final output to the variable myVar. Then myVar would be "1+5+2" or whatever the roll was.

Thanks to Mr. Pokeylope for his work, it is proving extremely useful!

Post Reply

Return to “MapTool”