Help, my library was working just fine yesterday, now today I opened the campaign and I get "Error in body of roll"
The macro in question (in my Library)
[h:Token = getStrProp(macro.args, "ParentToken")]
[h,token(Token): status=input(
"uItemName | Default Name | Item Name",
"uQuantity | 0 | Quantity",
"uDescription | None | Description | TEXT | WIDTH=60",
"uWeight | 0 | Weight per Object"
)]
[h:abort(status)]
[h: uNewItem = json.set("{ }", "Name", uItemName, "Amount", uQuantity, "Description", uDescription, "Weight", uWeight)]
[h,token(Token): Inventory = json.append(Inventory, uNewItem)]
<b> * [r: uItemName] Added * </b>
[MACRO("DrawCharacterSheet@Lib:CharacterSheet") : "ParentToken=" + currentToken()]
When I try to run it:
Error in body of roll. Statement options (if any): h,token(Token) Statement Body : status=input( "uItemName | Default Name | Item Name", "uQuantity | 0 | Quantity", "uDescription | None | Description | TEXT | WIDTH=60", "uWeight | 0 | Weight per Object" )
I'm tearing my hair out, as it worked just fine yesterday - I added several items to several tokens, now those same tokens give me this error. I went to the wiki, and it states that "currentToken()" is "1.3b51 - No longer a trusted function."
I even moved the tokens to the default map where I keep my library at. Everything else works, showing that currentToken() is working as expected, and I'm at my wit's end. Anyone have any workarounds?
Macro stopped working
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.
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.
Re: Macro stopped working
Where is this macro located. Make sure you have player editable unchecked. Make sure there is an impersonated token. From what I see, your parent token is the current token so you should just use Wiki: switchToken().
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Macro stopped working
Sorry, more context needed I see.
So the token has a character sheet macro that references a macro in the library token to open an HTML window (the character sheet) that has, among other things, an inventory. There's a link in the character sheet that references the "editItem" macro in the library token. the json arrays that populate this character sheet are in the properties of the token itself, but the macros reside in the library.
There are other links in the character sheet for rolling for stats and such that successfully reference the properties of the parent token, to date this is the only one that doesn't work - and a couple of days ago it worked just fine.
So the token has a character sheet macro that references a macro in the library token to open an HTML window (the character sheet) that has, among other things, an inventory. There's a link in the character sheet that references the "editItem" macro in the library token. the json arrays that populate this character sheet are in the properties of the token itself, but the macros reside in the library.
There are other links in the character sheet for rolling for stats and such that successfully reference the properties of the parent token, to date this is the only one that doesn't work - and a couple of days ago it worked just fine.
Re: Macro stopped working
Also I'm using a library token named:
Lib:CharacterSheet
Lib:CharacterSheet
Re: Macro stopped working
Think I figured it out... in an earlier game macros weren't working, so I changed the library to ownership: all players, and made the library token visible. When I turned off ownership: all players, it started working again.
Thanks for the assist!
Thanks for the assist!