### MapTool 1.4.0.5

Posted:

**Sun Jun 12, 2016 1:00 am**This build contains only bug fixes (all the new juicy stuff is going into dev/test build).

[spoiler=1.4.0.4 New Features]The new json functions are useful for generating multiple rolls (for characters, npcs what have you). In both cases these are simple roll expressions not macros.

This function takes 2 or 3 parameters and returns a json array

json.rolls(roll, dim1, dim2) => returns a json array with the rolls performed

e.g.

{json.rolls("3d6", 6),2} => [ 11, 7, 15, 8, 10, 13 ]

The three parameter version returns a two dimensional array

e.g.

{json.rolls("3d6", 6, 4),2} => [ [ 11, 13, 11, 13 ], [ 8, 11, 17, 10 ], [ 8, 11, 14, 11 ], [ 6, 8, 13, 6 ], [ 6, 11, 8, 10 ], [ 10, 7, 17, 11 ] ]

Is similar to json.rolls() but returns a json object.

It takes 3 parameters

json.objrolls(names, stat, rolls)

This will generate rolls for all the stat for each "name". rolls is either a single string with a roll expression in which case every stat will use same roll expression, or a json array with a roll expression for each stat (so must be same size as stat).

e.g.

<pre>{json.indent(json.objrolls("['henchman1', 'henchman2', 'henchman3']", "['Str', 'Dex', 'Con', 'Int', 'Wis', 'Chr']", "3d6"),2)}</pre>

<pre>{json.indent(json.objrolls("['henchman1', 'henchman2', 'henchman3']", "['Str', 'Dex', 'Con', 'Int', 'Wis', 'Chr']", "['3d6+1', '3d6', '3d6', '3d6-2', '3d6', '2d6']"),2)}</pre>

[/spoiler]

[spoiler=1.4.0.3 New Features]

[spoiler=1.4.0.2 New Features]Allow scripts to modify max loops/recursion post (Craig).[/spoiler]

[spoiler=1.4.0.1 New Features]

[spoiler=1.4.0.0 New Features]

**Bugfixes**- Resize free size figure tokens (Jagged)
- Fixes for Z Order on freesized objects (Jagged)
- Fixes for resizing stamps that are type "figure" (Jagged)
- Small iso fixes (Jagged)
- Fix for Missing images (Jamz)

[spoiler=1.4.0.4 New Features]The new json functions are useful for generating multiple rolls (for characters, npcs what have you). In both cases these are simple roll expressions not macros.

**json.rolls**This function takes 2 or 3 parameters and returns a json array

json.rolls(roll, dim1, dim2) => returns a json array with the rolls performed

e.g.

{json.rolls("3d6", 6),2} => [ 11, 7, 15, 8, 10, 13 ]

The three parameter version returns a two dimensional array

e.g.

{json.rolls("3d6", 6, 4),2} => [ [ 11, 13, 11, 13 ], [ 8, 11, 17, 10 ], [ 8, 11, 14, 11 ], [ 6, 8, 13, 6 ], [ 6, 11, 8, 10 ], [ 10, 7, 17, 11 ] ]

**json.objrolls**Is similar to json.rolls() but returns a json object.

It takes 3 parameters

json.objrolls(names, stat, rolls)

This will generate rolls for all the stat for each "name". rolls is either a single string with a roll expression in which case every stat will use same roll expression, or a json array with a roll expression for each stat (so must be same size as stat).

e.g.

<pre>{json.indent(json.objrolls("['henchman1', 'henchman2', 'henchman3']", "['Str', 'Dex', 'Con', 'Int', 'Wis', 'Chr']", "3d6"),2)}</pre>

Code: Select all

`{`

"henchman1": {

"Str": 10,

"Dex": 12,

"Con": 10,

"Int": 10,

"Wis": 8,

"Chr": 12

},

"henchman2": {

"Str": 11,

"Dex": 10,

"Con": 7,

"Int": 13,

"Wis": 9,

"Chr": 7

},

"henchman3": {

"Str": 10,

"Dex": 10,

"Con": 10,

"Int": 12,

"Wis": 15,

"Chr": 13

}

}

<pre>{json.indent(json.objrolls("['henchman1', 'henchman2', 'henchman3']", "['Str', 'Dex', 'Con', 'Int', 'Wis', 'Chr']", "['3d6+1', '3d6', '3d6', '3d6-2', '3d6', '2d6']"),2)}</pre>

Code: Select all

`{`

"henchman1": {

"Str": 11,

"Dex": 12,

"Con": 13,

"Int": 8,

"Wis": 10,

"Chr": 11

},

"henchman2": {

"Str": 12,

"Dex": 11,

"Con": 12,

"Int": 8,

"Wis": 12,

"Chr": 3

},

"henchman3": {

"Str": 12,

"Dex": 13,

"Con": 9,

"Int": 8,

"Wis": 13,

"Chr": 7

}

}

[spoiler=1.4.0.3 New Features]

- 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.
- 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]
- 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.

[spoiler=1.4.0.2 New Features]Allow scripts to modify max loops/recursion post (Craig).[/spoiler]

[spoiler=1.4.0.1 New Features]

- Map Visible Commands thread (Jagged).
- Table Additions thread (Jagged).
- Copy Map Function thread (Jagged).
- Add UPnP Discovery Timeout preference to UI (joshsziegler).
- Add new macro function setTokenSnapToGrid thread (DarkAlf).
- Tweak display and drawable selection (Jagged).
- Display drawn elements in split panel (Jagged).
- Allow DrawablesGroup to have children (Jagged).
- ViewDrawing thread (Jagged).
- Add double click centre function to draw panel (Jagged).
- Populate the change layer and arrange commands. (Jagged).
- Add smaller icons for templates. (Jagged).

[spoiler=1.4.0.0 New Features]

- Isometric Maps (Jagged) [BETA FEATURE] Isometric Map & new Token type
- Set view area macro command (Jagged)
- Add setTokenWidth/Height macro functions (Dark Alf)
- Add setZoom(x) and getZoom() macro functions (Jagged)
- Fixes for stylesheet removal issues in htmlframe/form with Java 1.7 and up (Yorik + Username)
- New right-click menu option on Stamps to allow user to select a pixel range and enter the number of cells/squares in the selection (JamzTheMan)
- Start of a WebAPI (not ready for use yet).
- German Language Updates (FantasyTeddy)