Is this function available?

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
brad
Great Wyrm
Posts: 1233
Joined: Fri Apr 27, 2007 10:27 pm
Location: NY
Contact:

Is this function available?

Post by brad »

So, there is power function. You can put 2^3 in your equation and you will get 8. Is there something that does the opposite? Something that gives you 2 to what power is 8? Nothing is on the parser page. I need this to make a range penalty figurer macro.
View MapTool video tutorials at RPToolsTutorials.net

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Post by Phergus »

That would be log base 2. Which I don't believe the parser does.

Easily emulated with a short table. 16 entries would get you to a range of 65536.

User avatar
brad
Great Wyrm
Posts: 1233
Joined: Fri Apr 27, 2007 10:27 pm
Location: NY
Contact:

Post by brad »

True. A table will work. Thanks.

I see how to use the table in a Global macro, but is there a way to call a specific value of a table with a Token macro?
View MapTool video tutorials at RPToolsTutorials.net

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Post by Azhrei »

Phergus wrote:That would be log base 2. Which I don't believe the parser does.
A logarithm of X to base B can be calculated if any logarithm function is available. The formula is log(X) / log(B), where log() can be base 10 logarithm, or the natural logarithm, or any other. Most function libraries will provide either log() to calculate base 10 logarithms and ln() for natural logarithms.

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

Post by giliath »

I added support for the Math function log and ln into the parser. The next version of MapTool will be released with the new parser.
~Giliath

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

Post by trevor »

giliath wrote:I added support for the Math function log and ln into the parser. The next version of MapTool will be released with the new parser.
specifically 1.3b36
Dreaming of a 1.3 release

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

Post by jfrazierjr »

giliath wrote:I added support for the Math function log and ln into the parser. The next version of MapTool will be released with the new parser.
Giliath, I know I for one would love you forever if you were to include some way to have a variable roll expression:

xd6 where x is either a property OR a prompted variable. At this point, something like 4E fighter power Brute Strike has to be done manually in the macro's instead of using a property since in the case in point, the fighter is using a weapon that rolls 2d6 instead of a single dice and this power does 3[W] which translates to 3(2d6) which turns into 6d6 damage.....

Joe
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
UntoldGlory
Great Wyrm
Posts: 1649
Joined: Sun Mar 16, 2008 8:12 pm

Post by UntoldGlory »

Yeah, that would be awesome. It was something I pined for in 3.5 playing a Psion, when one time I might do a 3d6 energy ray, and another time a 6d6, or any number of d6 from 1 to my current level!

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

Post by giliath »

You can. 4d6 is just a short form of roll(6, 4), so you can put variables or prompting expressions in that.

Does that solve what you need?

I may have the order of parameters inverted.

Code: Select all

Try roll(4, 6) for 4d6 instead.
Last edited by giliath on Mon Jul 21, 2008 12:40 pm, edited 1 time in total.
~Giliath

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

Post by trevor »

giliath wrote:You can. 4d6 is just a short form of roll(6, 4), so you can put variables or prompting expressions in that.

Does that solve what you need?
So you could technically do:

attack for [roll(6, AttackCount)]

?
Dreaming of a 1.3 release

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

Post by jfrazierjr »

giliath wrote:You can. 4d6 is just a short form of roll(6, 4), so you can put variables or prompting expressions in that.

Does that solve what you need?
That is part of it. part 1 is using a variable expression to say how many of X dice needs to be rolled as you state above. part 2 is how many times to roll expression x:

x[d20+1+2+0] where x is prompted for and the entire expression is rolled x times

d20+1+2+0 => 14+1+2+0 = 17
d20+1+2+0 => 18+1+2+0 = 21
d20+1+2+0 => 7+1+2+0 =10

Also, I just tried the whole roll(x,y) thing inside [] and was told I was a cheater....heh... not exactly what I expected...
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
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

jfrazierjr wrote: Also, I just tried the whole roll(x,y) thing inside [] and was told I was a cheater....heh... not exactly what I expected...
hmmmmm ..... unless you _are_ a cheater ...... heh j/k :)
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 »

We don't support that yet. You need looping of some sort which we have been talking about lately, but before that we need more boolean logic.
~Giliath

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Post by Craig »

jfrazierjr wrote: Also, I just tried the whole roll(x,y) thing inside [] and was told I was a cheater....heh... not exactly what I expected...
Just place a space between the opening square bracket and the roll so
[ roll(x,y)]

User avatar
brad
Great Wyrm
Posts: 1233
Joined: Fri Apr 27, 2007 10:27 pm
Location: NY
Contact:

Post by brad »

giliath wrote:I added support for the Math function log and ln into the parser. The next version of MapTool will be released with the new parser.
Thanks giliath, that will be very helpful.
View MapTool video tutorials at RPToolsTutorials.net

Post Reply

Return to “MapTool”