[macro():] Roll Option Breaking

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
Kira
Kobold
Posts: 11
Joined: Tue Jul 13, 2010 1:38 am

[macro():] Roll Option Breaking

Post by Kira »

I'm playing around with some macros for a BESM framework (Still, for those of you who've seen my last few topics). I've got a lot of stuff working and am in the process of revising a lot of my code... However I've come across a strange issue:

Using

Code: Select all

[macro("CalledMacro@Lib:Whatever"): 0]
suddenly stops working. I've had this occur a few times where it should work, but MapTool simply spits out a "Error in body of roll" error. The most recent time this has happened, I was editing a chain of macros and it was working fine, but then I changed a little bit of HTML inside of a strformat() in the called macro... And suddenly it stops working.

A little more in depth:
I will attach the campaign file. The issue I'm running into is using the "NewWeaponTableTest" macro in the "Testing" group of the Campaign macros. It should be calling the "ShowWeaponTable" macro from Lib:HTML which in turn creates a dialog which links to "WeaponTable" on Lib:HTML a chain of macros. Previously it was working, but I edited a bit of the html in "ShowWeaponTable" afterwhich "NewWeaponTableTest" stopped working.

Edit:
Thinking more about it... Is this where I start using UDFs more? I'm not totally familiar with them which is why I've tended to avoid them... But now I'm wondering if it's time to bite the bullet.
Attachments
BESMSetupNew2.0.cmpgn
(709.89 KiB) Downloaded 38 times

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: [macro():] Roll Option Breaking

Post by aliasmask »

If you turn on "Macro Handling" in the Advanced tab, debugging information will be saved to log.txt file in the .maptool directory. You can then open it up and find the last line that says DEBUG to find your error.

Code: Select all

2015-12-19 18:59:43,921 [client.MapToolLineParser:1302] DEBUG -  weapLevel = json.get(weaponProps, "Level")
2015-12-19 18:59:43,921 [client.MapToolLineParser:1320] DEBUG - java.lang.NumberFormatException: For input string: "Level"
I looked at the property and Level isn't defined as a prop. Error occurs in WeaponTable macro on lib:HTML.

Here are a couple of tools I use to make UDFs and output easier. Be sure to read the token notes and the comments in the macros. You can find more info in my signature under RPEdit and Notepad++.
Attachments
Starter Pack - RPEdit for B91.rptok
(107.66 KiB) Downloaded 39 times
starter lib token.rptok
(83.63 KiB) Downloaded 39 times

Kira
Kobold
Posts: 11
Joined: Tue Jul 13, 2010 1:38 am

Re: [macro():] Roll Option Breaking

Post by Kira »

Thanks for that! I know what went wrong: I called the wrong macro at one point and it called an older version of my AddWeapon macro... Which overwrote everything with the wrong data. Hadn't even thought of that...

I'll definitely take a look at the attached stuff, thanks again!

Post Reply

Return to “Macros”