what exactly breaks if I would not use this update? (this is more asked in the light that with 5 different locations where i run mt, there's a great chance that i forget to update one). is it 'just' the label popping up or it also have more serious effects? I don't do this often but I have had some 'search and replace' through the 50k lines of code using your method (which is always a bit scary as it touches EVERYTHING ,but that's what backups are for) so any changes in the code will make me a bit wary.aliasmask wrote:MapTool 1.3b89 load fix. This should be backwards compatible with b87 as well.
RPedit - Macro Importer/Exporter and Editor [4/19/13]
Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice
Re: RPedit - Macro Importer/Exporter and Editor [7/17/11]
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
Well, I used the 3.5/Pathfinder framework for my test case. I tested the existing copy to a new exported/imported copy to see if anything different pops up. It didn't. Also, I didn't change much in this, just the order of operation of a couple of lines and one extra line to removed command from the props before applying varsFromStrProp (which is something I probably should have done in the first place).
I've noticed a couple of wonky things with b89 that I'm still trying to figure out. One of them is with the 3.5/Pathfinder framework and his OutputTo function. There is some kind of ; conversion that is messing with some of the old output that worked fine before.
If you're going to use b89, I would not use the version before this. You'll know the error when you see it, and it will not function at all. In fact, I would use this version for b87 and before as well. I'm going to go through this thread and remove all other versions to remove any version confusion.
I've noticed a couple of wonky things with b89 that I'm still trying to figure out. One of them is with the 3.5/Pathfinder framework and his OutputTo function. There is some kind of ; conversion that is messing with some of the old output that worked fine before.
If you're going to use b89, I would not use the version before this. You'll know the error when you see it, and it will not function at all. In fact, I would use this version for b87 and before as well. I'm going to go through this thread and remove all other versions to remove any version confusion.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
in case you didn't know: user profile --> overview --> manage attachments. Ideal for such a clean up.aliasmask wrote: I'm going to go through this thread and remove all other versions to remove any version confusion.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
Thanks. I have like 8 pages of attachments from over the years. Good thing I named all the files roughly the same.wolph42 wrote:in case you didn't know: user profile --> overview --> manage attachments. Ideal for such a clean up.aliasmask wrote: I'm going to go through this thread and remove all other versions to remove any version confusion.
Anyway, all the older versions have been removed. The OP has a link to the most recent download. If someone wants it for an older version of MT I think the code is compatible to about b73. It would just be a matter of exporting the macros from one to the other in MapTool, not RPEdit.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: RPedit - BUG!!
Hi Alias,
I've discovered a rather disturbing bug in rpedit, which has resulted in the BoT being broken several times. It took me a while to narrow it down but I finally was able to limit the issue to this:
when this 'macro' is loaded in rpedit ONLY the first line is taken and the rest of the macro is lost. Fortunately this appears to have happened only once now (I think) but its rather disturbing as I use your editor to wade through the thousands of lines of code and if one macro is lost I don't notice it until someone reports a bug to me.
Anyway what also struck me as odd is that this is what rpedit shows in the frame:
apart from the dissapearing code, notice how the 'single quotes' suddenly are changed into "double quotes", I guess its a related issue.
edit: if you swap the two lines, then again only the first line is shown, the rest is lost.
also: if you put lines between these two lines, then still everything is lost after the first line. It appears that if this combination is the macro then after the first line everything is lost.
some more findings:
results in only first line
works! So apparently the first line must be a [''] or [""] combined with another line with quotes anywhere in the code.
final edit (im gonna stop after this one): it does also not matter WHERE the quotes are between the [] so where it basically boils down to is:
IF the first line in a macro starts with [" OR [' THEN the remainder of the macro is lost!! I ran some tests and this turns out to be true for most macros. the only second ingredient is another line in the macro where there are also quotes (can be the same as the first line, so the single/double is also not a requirement to break it.
I've discovered a rather disturbing bug in rpedit, which has resulted in the BoT being broken several times. It took me a while to narrow it down but I finally was able to limit the issue to this:
Code: Select all
['test1']
["test2"]
Anyway what also struck me as odd is that this is what rpedit shows in the frame:
Code: Select all
@@ @T9
@PROPS@ fontColor=black ; autoExecute=true ; fontSize=1.00em ; sortBy=7 ; color=default ; playerEditable=false ; applyToSelected=true ; group= ; tooltip= ; minWidth=90 ;
["test1"]
!!
edit: if you swap the two lines, then again only the first line is shown, the rest is lost.
also: if you put lines between these two lines, then still everything is lost after the first line. It appears that if this combination is the macro then after the first line everything is lost.
some more findings:
Code: Select all
["test2"]
<!-- IGNORE ME -->
[ignore me too]
['test1']
Code: Select all
<!-- IGNORE ME -->
["test2"]
<!-- IGNORE ME -->
[ignore me too]
['test1']
final edit (im gonna stop after this one): it does also not matter WHERE the quotes are between the [] so where it basically boils down to is:
IF the first line in a macro starts with [" OR [' THEN the remainder of the macro is lost!! I ran some tests and this turns out to be true for most macros. the only second ingredient is another line in the macro where there are also quotes (can be the same as the first line, so the single/double is also not a requirement to break it.
- Attachments
-
- LibW42_Test.rptok
- (79.49 KiB) Downloaded 103 times
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
Are you using the latest version. Because of the java 7 change, it broke something in how the old version was parsing the lines of code. It was mostly due to lazy programming because I would do a varsFromStrProp on whole macro structure where certain combinations in the command variable would blow up. So, I removed that from structure first and then applied it in the fix and changed the order of operation a little. (noted previously in this thread).
I'll test your file and see if it's related to that bug that was fixed in latest version.
edit: yes, I see the error. I'll see what is causing it. I think it may be related to a conversion from str prop to json and back. Somewhere it thinks the first line looks like a json, hence the quote conversion. If you put [r: 'test'] it no longer looks like a json and processes normally.
edit: Weird, my file doesn't have the changes I made to it. I think I may have posted the wrong file. Anyway, I'll post the fix soon. Wait did I post the code changes earlier?
I'll test your file and see if it's related to that bug that was fixed in latest version.
edit: yes, I see the error. I'll see what is causing it. I think it may be related to a conversion from str prop to json and back. Somewhere it thinks the first line looks like a json, hence the quote conversion. If you put [r: 'test'] it no longer looks like a json and processes normally.
edit: Weird, my file doesn't have the changes I made to it. I think I may have posted the wrong file. Anyway, I'll post the fix soon. Wait did I post the code changes earlier?
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
Okay, I see. My "fix" is also reproducing the same error. If I do this:
"command" is pulled from json and put in to a variable BUT if the string looks like this: [word ...] where ... can be the rest of the macro command (called greedy in regex) then it thinks it's a json and tries to "fix" it. So, the problem isn't my code, but MT json interpretation.
This definitely isn't good. I believe there was a patch for json.type that was going to better identify a json structure and this could be related.
edit: I posted some output and you'll see it's MT related. "macro" is defined like this:
So, for T2 you see it never reads the full text and T1 is converted when assigned to a variable because it looks similar to a json and is converted by MT.
The semi good news is I can do a work around for T1 Example, but T2 is a big problem. Also, the fix for T1 would slow down the process and I think I can do a work around for T2 by not returning it as a json.
In the macro text of a macro button, if you have a space or anything before the [, then it won't look like a json and the problem is solved. If your first line doesn't look like a json [H: ..] then it works fine. If the code doesn't end in ] then you're fine. I never ran in to this because I usually put <-- comment --> at beginning and pretty much always use r: or h: in my statements.
Code: Select all
[H: command = replace(json.get(macro,"command"),"\\n{3,}",eol+eol)]
[H: macro = replace(json.remove(macro,"command"),";","&#"+59)]
[H: varsFromStrProp(json.toStrProp(macro))]
This definitely isn't good. I believe there was a patch for json.type that was going to better identify a json structure and this could be related.
edit: I posted some output and you'll see it's MT related. "macro" is defined like this:
Code: Select all
[H: macro = getMacroProps(index,"json",id)]
Test Results
In the macro text of a macro button, if you have a space or anything before the [, then it won't look like a json and the problem is solved. If your first line doesn't look like a json [H: ..] then it works fine. If the code doesn't end in ] then you're fine. I never ran in to this because I usually put <-- comment --> at beginning and pretty much always use r: or h: in my statements.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
well I usually also not run into it cause all my macros start with
[h:<!-- macroname -->]
however in this case I forgot the 'h:'.
I would suggest that you report this bug. (I just reported another one).
[h:<!-- macroname -->]
however in this case I forgot the 'h:'.
I would suggest that you report this bug. (I just reported another one).
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
new bug found.
Tested in b87 and b89, only appears in b89.
I don't know if this happens in general but:
- open the current bag of tricks in b87
- select your lib:test
- run 'edit token' from campaign panel
- select 'all macros'
works.
Do the same in b89 and I get a 'label' request. (pop-up).
Tested in b87 and b89, only appears in b89.
I don't know if this happens in general but:
- open the current bag of tricks in b87
- select your lib:test
- run 'edit token' from campaign panel
- select 'all macros'
works.
Do the same in b89 and I get a 'label' request. (pop-up).
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
Not sure I fully understand the latest back-n-forth over some bugs from different versions (b87 vs b89 and java 6 vs java 7).
Are there any known issues using the latest version on b87 with java 6?
Are there any known issues using the latest version on b87 with java 6?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
The last reported issue is tested in j6 and j7. Same result.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
I'll see if I get an error, but is it the same error as above. If a macro starts with [ a-z ... and ends with ] without the : after the first set of characters, it tries to convert it to a json improperly. I believe Lee is working on a fix for this.
The solution is, for at least the very first line of a macro, to include the : or put a comment an html comment at top until that gets fixed in b90.
Wolph42, I'll take a look and see if this is something new. That bug is only in b89 and is related to the parser.
The solution is, for at least the very first line of a macro, to include the : or put a comment an html comment at top until that gets fixed in b90.
Wolph42, I'll take a look and see if this is something new. That bug is only in b89 and is related to the parser.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
What I'm working on, I'm afraid, is completely incompatible with the current official source. Though I see a light at the end of the tunnel, I'm still in the throes of ironing out the upheaval I caused by touching the JSON implementation (there were a LOT ). Right now, I'm so far off the beaten track that I'll probably make a call for campaigns with heavy JSON to do testing with, which means it'll be a while before I'm confident to release. What I can say is that I'm taking pains to make sure JSON is encoded and decoded correctly, while watching if the parser spits out a furball.aliasmask wrote:...I believe Lee is working on a fix for this.
Anyway, coupled with my experiments with topology, this further delays my demo production again. Sigh. But, I digress. I failed to see the OP when it first came out, but A.M. pointed it out to me earlier this month. I'll try to look into it when I have the time, but, apart from the BoT, could I be provided with a smaller scale test to do debugging with?
Thanks.
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
If you look a couple of posts above, I posted some testing data (Test Results Spoiler). T1, T2, T3 are really small macros that I run the rpedit against. The right hand side is just debugging to show that the proper data is being passed to macro as demonstrated by the dialogue line in code below the images.
When command is defined it changes the value in the assignment because of the json-like format. The replace just replaces 3+ CRs to 2 getting rid of excessive blank lines.
When command is defined it changes the value in the assignment because of the json-like format. The replace just replaces 3+ CRs to 2 getting rid of excessive blank lines.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]
Ah, I see. From what I can tell, passing ['[]'] through the parser works as expected (i.e. treated as a string), correct? I was a bit groggy a while ago and forgot to say that yes, the parser does look for jsons first before treating what's left as a string/number. It does a split between ':' to separate roll options from the roll itself; so if there's a '[something something]' or '{}' after the split, it will try to convert it to JSON. It seems sound when you stare at the code, but I suspect that in your macro code, there's an evalMacro or execMacro in there somewhere, and that something changed in how b89 interprets it. Either that, or there's something different about MT's variable resolver. With that being said, I'll try extracting your macro code for RPEdit and narrow it down from there, or you could pick out suspect snippets of code for me since you know this code bestaliasmask wrote:If you look a couple of posts above, I posted some testing data (Test Results Spoiler). T1, T2, T3 are really small macros that I run the rpedit against. The right hand side is just debugging to show that the proper data is being passed to macro as demonstrated by the dialogue line in code below the images.
Edit: Still groggy it seems. I see what you mean by the single quotes turning into doubles, and it happening to strings not necessarily having brackets enclosing them (e.g. '[string]' or '{string}'). Hmm, it could either be a JSON transformation or the use of toString() within the code, which wraps the passed object in double quotes.
Edit #2: fixed that broken chain of thought up there. oh the fatigue...
Last edited by Lee on Thu Aug 22, 2013 10:03 am, edited 1 time in total.
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in