RPTools.net

Discussion and Support

Skip to content

It is currently Sat Dec 16, 2017 6:12 am 






Reply to topic  [ 13 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Great Wyrm
 
Joined: Sun Jun 22, 2008 6:53 pm
Posts: 2102
Location: Melbourne, Australia
 Post subject: MapTool 1.4.0.3 Build
PostPosted: Fri May 13, 2016 11:49 am 
Yay its time for a new build.

  • Added json.removeFirst macro function, similar to json.difference() but will only remove the first occurrence of match. e.g. json.removeFirst('[2,2,4,5,6,6,4]', '[2,6]') = [2,4,5,6,4]
  • Fix for trailing end of line character of version string in getInfo('client') macro function.
  • Added a client id to getInfo. This will return the id of a client (an essentially randonmly generated id that can't be used to identify your ip etc). This is so macro writers can save settings per client in the campaign.
  • Fix for parser error messages not being displayed nicely.

Also the following math functions have been added. While they have been tested they could stand to have more testing done, so please test them a bit more before relying on them
  • math.abs -- Return the absolute (non negative) of of a value.
  • math.ceil -- Return the nearest whole number, rounding up
  • math.floor -- Return the nearest whole number, rounding down
  • math.cos -- Return the cosine of an angle (angle in degrees)
  • math.cos_r -- Return the cosine of an angle (angle in radians)
  • math.sin -- Return the sine of an an angle (angle in degrees)
  • math.sin_r -- Return the sine of an angle (angle in radians)
  • math.tan -- Return the tangent of an angle (angle in degrees)
  • math.tan_r -- Return the tangent of an angle (angle in radians)
  • math.acos -- Return the inverse cosine of a ratio (returned angle is in degrees)
  • math.acos_r -- Return the inverse cosine of a ratio (returned angle is in radians)
  • math.asin -- Return the inverse sine of a ratio (returned angle is in degrees)
  • math.asin_r -- Return the inverse sine of a ratio (returned angle is in radians)
  • math.atan -- Return the inverse tangent of a ratio (returned angle is in degrees)
  • math.atan_r -- Return the inverse tangent of a ratio (returned angle is in radians)
  • math.atan2 -- A version of atan that takes 2 arguments instead of a ratio so that it can return angle based on signs of inputs (allowing you to determine quadrant). Return is in degrees
  • math.atan2_r -- A version of atan that takes 2 arguments instead of a ratio so that it can return angle based on signs of inputs (allowing you to determine quadrant). Return is in radians
  • math.cbrt, math.cuberoot -- Return the cube root of a number
  • math.hypot, math.hypotenuse -- Return the hypotenuse (h = sqrt(a*a + b*b)) for the two sides passed in
  • math.log -- Return the natural logarithm of a number
  • math.log10 -- Return the base 10 logarithm of a number
  • math.min -- Returns the minimum number from its arguments (2+ arguments)
  • math.max -- Returns the maximum number from its arguments (2+ arguments)
  • math.mod -- Returns the modulus of the arguments (remainder from the division)
  • math.pow -- Returns the value of the first argument raised to the power of the second
  • math.sqrt, math.squareroot -- Returns the square root of a number
  • math.toRadians -- Converts an angle from degrees to radians
  • math.toDegrees -- Converts an angle from radians to degrees
  • math.pi -- Returns the value of PI, mmmmm pie...
  • math.e -- Returns the mathematical constant e (base of natural logarithm)
  • math.isOdd -- Returns 1 if the argument is odd, 0 if it is even
  • math.isEven -- Returns 1 if the argument is even, 0 if it is odd
  • math.isInt -- Returns 1 if the argument is an integer, 0 if it is not.


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3484
Location: Austin, Tx
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Fri May 13, 2016 11:56 am 
Craig wrote:
math.pi -- Returns the value of PI, mmmmm pie...


LOL

Thanks, Craig for all the great work you do.

Queue happy dance music.

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3782
Location: MD
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Fri May 13, 2016 12:06 pm 
Craig wrote:
[*] Added a client id to getInfo. This will return the id of a client (an essentially randomly generated id that can't be used to identify your ip etc). This is so macro writers can save settings per client in the campaign.

How static is this ID? What conditions change it? Don't want to try using it and then see the ID changing like it does for tokens.

Can we get some more examples on how/when to use this? I.e, what inspired its deployment? I figure there is a particular use case in mind... which might help me understand the broader picture.

Oh yeah, thanks for the build/deployment!

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Sun Jun 22, 2008 6:53 pm
Posts: 2102
Location: Melbourne, Australia
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Fri May 13, 2016 12:12 pm 
Full Bleed wrote:
Craig wrote:
[*] Added a client id to getInfo. This will return the id of a client (an essentially randomly generated id that can't be used to identify your ip etc). This is so macro writers can save settings per client in the campaign.

How static is this ID? What conditions change it? Don't want to try using it and then see the ID changing like it does for tokens.

Can we get some more examples on how/when to use this? I.e, what inspired its deployment? I figure there is a particular use case in mind... which might help me understand the broader picture.

Oh yeah, thanks for the build/deployment!

It remains the same until a player deletes their .maptool folder (or the client-id file inside it).
Aliasmask asked for it, I assume so he can save variables against a client for next log in. Maybe he can enlighten us as to his plans :)


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Fri May 13, 2016 12:14 pm 
Thanks Craig! That's a lot of math functions!

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Fri May 13, 2016 12:34 pm 
Craig wrote:
It remains the same until a player deletes their .maptool folder (or the client-id file inside it).
Aliasmask asked for it, I assume so he can save variables against a client for next log in. Maybe he can enlighten us as to his plans :)

Yep, pretty much. I plan to associate tokens to certain players and have a pseudo log-in feature. Sometimes my players log in with different names for various reasons. With this function, I won't have to nag for a log in because it'll just know.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3484
Location: Austin, Tx
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Fri May 13, 2016 5:41 pm 
I'm having some issues with the cos and sin functions. The expected result is for both to move from zero to one as the angel moves around the circle. The 45 degree (1/4pi radians) point in each quadrant should be .707

So the expected result is to go 1(0)-> .707 -> 0(1). I see this for radians. Degrees seems to be borked.


Code:
Cosine Check
0
Degrees 0.0 sin 1.0
Radians 0.00pi sin_r 1.0

1
Degrees 45.0 sin -0.5918127259718502
Radians 0.25pi sin_r 0.7071067811865476

2
Degrees 90.0 sin -0.2995153947555356
Radians 0.50pi sin_r 6.123233995736766E-17

3
Degrees 135.0 sin 0.9463267704531728
Radians 0.75pi sin_r -0.7071067811865475

4
Degrees 180.0 sin -0.8205810566088714
Radians 1.00pi sin_r -1.0

5
Degrees 225.0 sin 0.02493385353255689
Radians 1.25pi sin_r -0.7071067811865477

6
Degrees 270.0 sin 0.7910687129526641
Radians 1.50pi sin_r -1.8369701987210297E-16

7
Degrees 315.0 sin -0.9612629164203338
Radians 1.75pi sin_r 0.7071067811865474


Sine Check
0
Degrees 0.0 sin 0.0
Radians 0.00pi sin_r 0.0

1
Degrees 45.0 sin 0.8060754911159176
Radians 0.25pi sin_r 0.7071067811865475

2
Degrees 90.0 sin -0.9540914674728181
Radians 0.50pi sin_r 1.0

3
Degrees 135.0 sin 0.3232114532680857
Radians 0.75pi sin_r 0.7071067811865476

4
Degrees 180.0 sin 0.5715301650260188
Radians 1.00pi sin_r 1.2246467991473532E-16

5
Degrees 225.0 sin -0.9996891031455815
Radians 1.25pi sin_r -0.7071067811865475

6
Degrees 270.0 sin 0.6117273014893283
Radians 1.50pi sin_r -1.0

7
Degrees 315.0 sin 0.27563309945482667
Radians 1.75pi sin_r -0.7071067811865477


Macros
Code:
Cosine Check<br>
[h:d=0.0]
[h:di=45.0]
[h:r=0.0]
[h:ri=0.25]
[r,for(i, 0, 8,1,"<br>"), code:{
[i]<br>
Degrees [i*di] sin [da=math.cos(di*i)]<br>
Radians [i*ri]pi sin_r [math.cos_r(ri*i*math.pi())]<br>
}]


Code:
Sine Check<br>
[h:d=0.0]
[h:di=45.0]
[h:r=0.0]
[h:ri=0.25]
[r,for(i, 0, 8,1,"<br>"), code:{
[i]<br>
Degrees [i*di] sin [da=math.sin(di*i)]<br>
Radians [i*ri]pi sin_r [math.sin_r(ri*i*math.pi())]<br>
}]

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Mon Feb 16, 2009 7:12 pm
Posts: 236
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Fri May 13, 2016 5:50 pm 
I notice some (not all) of the new math functions appear to parallel ones that MT already had, like abs, hypot, etc. Is there any difference between them, or are these effectively just alternate names?

_________________
I made a framework for Exalted 2.5E.


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Sun Jun 22, 2008 6:53 pm
Posts: 2102
Location: Melbourne, Australia
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Sat May 14, 2016 2:21 am 
RPTroll wrote:
I'm having some issues with the cos and sin functions. The expected result is for both to move from zero to one as the angel moves around the circle. The 45 degree (1/4pi radians) point in each quadrant should be .707

So the expected result is to go 1(0)-> .707 -> 0(1). I see this for radians. Degrees seems to be borked.



I see the problem, doh. I will have them fixed for next build...


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Sun Jun 22, 2008 6:53 pm
Posts: 2102
Location: Melbourne, Australia
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Sat May 14, 2016 2:23 am 
Craig wrote:
RPTroll wrote:
I'm having some issues with the cos and sin functions. The expected result is for both to move from zero to one as the angel moves around the circle. The 45 degree (1/4pi radians) point in each quadrant should be .707

So the expected result is to go 1(0)-> .707 -> 0(1). I see this for radians. Degrees seems to be borked.



I see the problem, doh. I will have them fixed for next build...

those ones that are double ups you can use the ones that suit you best. No real need to favour one over the other


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Mon Feb 16, 2009 7:12 pm
Posts: 236
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Sat May 14, 2016 3:33 am 
Craig wrote:
Craig wrote:
RPTroll wrote:
I'm having some issues with the cos and sin functions. The expected result is for both to move from zero to one as the angel moves around the circle. The 45 degree (1/4pi radians) point in each quadrant should be .707

So the expected result is to go 1(0)-> .707 -> 0(1). I see this for radians. Degrees seems to be borked.



I see the problem, doh. I will have them fixed for next build...

those ones that are double ups you can use the ones that suit you best. No real need to favour one over the other


No harm in that. Thanks!

_________________
I made a framework for Exalted 2.5E.


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3484
Location: Austin, Tx
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Sun May 15, 2016 8:20 pm 
math.atan2 and math.atan2_r seem to always return a blank string

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: MapTool 1.4.0.3 Build
PostPosted: Wed Jun 01, 2016 12:48 am 
Minor bug. When using Edit Map and setting the pixels per cell to below 50, the token still remain at 50 rather than adjusting. This can be fixed by going to edit grid and clicking okay.

I haven't tried 1.4.0.4 yet, but I don't recall this in the build update so it's probably still a problem.

_________________
Downloads:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 13 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman