Skip to content

Updating Simple5e

Lionel edited this page Aug 6, 2020 · 3 revisions

Updating Simple5e 2.x to 2.2.1

There are 2 major ways to update from to prior versions:

  1. Import the updated properties and macros into your campaign. If you have not changed any default Campaign or GM panel macros and have not changed any Campaign Properties (Token Properties, Campaign Repositories, Sights, Lights, States, or Bars):
    1. Download the Simple5e Parts: Properties, Campaign Macros, and GM Macros, and Token Macros
    2. Backup your campaign!
    3. Right click on the Campaign macro panel and click 'Clear Panel...'. Hit 'Yes'.
    4. Right click on the now-empty Campaign macro panel and select 'Import Macro Set...' and select the CAMPAIGN macro set you downloaded.
    5. Repeat steps 3-4, but with the GM macro panel and GM macro set, and with the Standard Token' Selection panel.
    6. Open Edit > Campaign Properties.
    7. Click 'Import' in the lower-left corner.
    8. Select the CAMPAIGN PROPERTIES you downloaded and hit 'Open'. Then hit 'Ok'.
    9. That's all, you're done!
  2. Use the Update Token. A special Update Token has been created which has all the updated macros and instructions for updating right in MapTool. To use, download the Update Token here and drag it into MapTool.
  3. Fix major issues manually from instructions below. You can browse the fixes below and implement them at your own pace.

Manual Fixes since Simple5e 2.0

To search for more fixes and documentation, please check out the Closed Issues and other wiki articles!

The following issues are also known and you can resolve them by updating to Simple5e 2.2:

  • Invisibility macro shows players too much information and fails on multiple tokens (#13)
  • TempHP not calculated in Heal and Damage NPC campaign macros (#10)
  • 'Dead' state too distracting (#12)
  • No 'Marked' or 'Hexed' states (#8)
  • Macro Search and Replace doesn't work well with special characters (#14)

Players can change and view NPC hit points

Players can use the 'Damage NPC' and 'Heal NPC' macros on the campaign panel to update monster HP. This also outputs the actual monster HP to the player who runs it.

To fix it, edit the 'Damage NPC' and 'Heal NPC' macros, insert a new line after line 1 and insert this snippet:

[h: "<!-- Prevent players from altering tokens they do not own. -->"]
[h, if(!isGM()), code: {
	[vToken = currentToken()]
	[vOwned = getOwned()]
	[if(!listContains(vOwned, vToken)): assert(0, "Only GMs may run the '" + getMacroName() + "' macro on a token they do not own.", 0)]
}]

Note: Simple 5e has a trust-based approach. Players can use most macros on the Campaign panel to affect monsters as a way to help the DM's bookkeeping. However, you can add the above snippet to the top of any Campaign macros you want to prevent Players from using on tokens they do not own. Just remember to put it directly after chat commands like /self or /me.

Initiative bonus exposed when rolling NPC initiative

When players or the GM click the 'Roll Initiative' campaign macro, players can mouse over the roll text to see the NPC's raw roll and bonus.

To fix, edit the 'Roll Initiative' and change [t: to [gt: on line 2.

Comment: The [gt:] roll option displays the tooltip to GMs, and acts like [r:] to players.

Custom Counters buggy in macros made with 'Create Actions'

Actions created with the Create Action macro which adjust a custom counter with maximum values are incorrectly reassigning the counter cost. This causes issues, for instance counters will be reduced to -1 instead of 0.

To fix the Create Action macro, edit it from the GM Macro panel and entirely replace code lines specified with the code below:

  • Replace Line 350 with:
[vEncodedCounterCmdA = "%0A%5Bh%3A+%22%3C%21--+Counter+Options+--%3E%22%5D%0A%5Bh%3A+vCounterName+%3D+%22COUNTERNAME%22%5D%0A%5Bh%3A+vCounterCost+%3D+COUNTERCOST%5D%0A%0A%5Bh%3A+%22%3C%21--+Grab+Counter+Info+--%3E%22%5D%0A%5Bh%3A+vCounter+%3D+json.get%28json.path.read%28CustomCounters%2C+%27.%5B%3F%28%40.name+%3D%3D+%22%27+%2B+vCounterName+%2B+%27%22%29%5D%27%29%2C+0%29%5D%0A%5Bh%3A+vCounterIndex+%3D+json.indexOf%28CustomCounters%2C+vCounter%29%5D%0A%5Bh%3A+vCounterValue+%3D+json.get%28vCounter%2C+%22value%22%29%5D%0A%5Bh%3A+vCounterMax+%3D+json.get%28vCounter%2C+%22max%22%29%5D%0A%5Bh%3A+vNewCounterValue+%3D+vCounterValue+-+vCounterCost%5D%0A%09%09%0A%5Br%2C+if%28vNewCounterValue+%3C+0%29%2C+code%3A+%7B%0A%09%5Bh%3A+%22%3C%21--+If+the+counter+would+go+below+0%2C+run+the+code+below+this+line.+--%3E%22%5D%0A%09%5Bh%2C+if%28vCounterMax+%21%3D+%22%22%29%3A+vCounterMaxText+%3D+%22%2F%22+%2B+vCounterMax%26semi%3B+vCounterMaxText+%3D+%22%22%5D%0A%09can%26%2339%26semi%3Bt+do+that%21+%28%5Br%3A+vCounterValue%5D%5Br%3AvCounterMaxText%5D+%5Br%3AvCounterName%5D+left%2C+need+%5Br%3A+vCounterCost%5D%29.%0A%09%0A%7D%26semi%3B%7B%0A%09%5Bh%3A+%22%3C%21--+If+the+counter+has+the+counter+resources%2C+run+the+code+below+this+line.+--%3E%22%5D%0A"]
  • Leave Line 351 as is.
  • Replace Line 352 with:
"%0A%09%5Bh%3A+%22%3C%21--+Prevent+the+counter+from+going+over+maximum.+--%3E%22%5D%0A%09%5Bh%2C+if%28isNumber%28vCounterMax%29%29%2C+code%3A+%7B%09%09%0A%09%09%5Bif%28vNewCounterValue+%3E+vCounterMax%29%3A+vNewCounterValue+%3D+vCounterMax%5D%0A%09%7D%26semi%3B%7B%7D%5D%0A%09%0A%09%5Bh%3A+%22%3C%21--+Update+the+counter+and+reload+Character+Sheet+if+present.+--%3E%22%5D%0A%09%5Bh%3A+vCounter+%3D+json.set%28vCounter%2C+%22value%22%2C+vNewCounterValue%29%5D%0A%09%5Bh%3A+CustomCounters+%3D+json.set%28CustomCounters%2C+vCounterIndex%2C+vCounter%29%5D%0A%09%5Bh%2C+if%28isFrameVisible%28token.name+%2B+%22+-+Character+Sheet%22%29+%26%26+hasMacro%28%22Sheet%22%29%29%2C+code%3A+%7B%0A%09%09%5Bmacro%28%22Sheet%40TOKEN%22%29%3A%22%22%5D%0A%09%7D%26semi%3B%7B%7D%5D%0A%7D%5D"]

Note: Don't worry about the long lines above; each line will appear as a solid block in MapTool.

Comment: The counter code is wrapped around action code with encoded macro commands that are pregenerated using the encode() function. You can actually decode() these chunks to view them if you want to add your own boilerplate to these snippets.

Players cannot create actions

At least one user has had an issue with the Create Action macro not working for players. This likely has to do with GM macros not properly being 'trusted' (a bug in MapTool).

To fix:

  • Edit the CAMPAIGN Panel 'Create Action' macro.
  • REMOVE line 7: [macro("Create Action@GM"):""]
  • Copy the ENTIRE GM Panel 'Create Action' macro into the clipboard.
  • Paste the ENTIRE GM Panel 'Create Action' macro into the CAMPAIGN panel version, beginning at Line 7.

That's it! You can remove the GM panel version of the macro if you wish. If you keep the GM copy of the macro, you'll have to edit the macro in both places if you update it.

Some tooltips too long

In the lower part of the Campaign macro panel, some tooltips are obnoxiously long. To shorten them, right click on the macro, select the 'Details' tab, and shorten or delete the entire tooltip for each offending macro.

Remove All macro doesn't handle invisibility and inspiration properly

To fix, edit the Remove All macro and replace the entire existing macro with the following snippet:

[h, if(state.Invisible): setOwnerOnlyVisible(0)]
[h: vInspiration = state.Inspiration]
[h: setAllStates(0)]
[h: state.Inspiration = vInspiration]
[h: vStateProps = "Concentration, Exhaustion, DeathSuccesses, DeathFails"]
[h, foreach(vProp, vStateProps, ""): resetProperty(vProp)]