These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.
You did some amazing tweaks to this tool i didnt even considered.
Btw ... i stress tested the import by trying it on the movepad-lib:token (2650 lines of code) and it didnt went through importing. Following error msg came.
I didnt tested yet to pump up my stack size.
That's odd. I ran the same lib through, you know as a test and I didn't get any errors and I only use a stack of 2. A stack of 6 seems pretty high to me. I'm not too sure about java, but I recall someone posting that anything above 1.6g max mem is outside the range of java.
Doing string manipulation inside of a nested loop can really overload the stack, especially when you nest the function calls. I'll take a look at the code again and separate anything like that out in to separate statements.
Also, that error seems to be related to calling an index of an array that doesn't exist. I'll check my logic and make do a test with some various end of file conditions. It may be a problem with my whitespace filter.
Okay, I fixed the logic with the maxLines error. If I had 501 lines, it would change the maxLines to 501 and then try to read line 501 to see if it was the beginning of a macro... but line 501 is really 502.. hence the error. I don't know why it didn't error sooner or changing the stack would help, oh well.
I also broke apart a pretty stack intensive statement
edit: Actually, I do know why I didn't see the error before. It only would happen if the code block being transferred was over 500 lines and was the last code block. So, 900 lines would be split in to potentially 500 and 400.. no problem, but 1020 could be 500 and 520 if line 500 was in the middle of the macro. That's when the error would occur. I'm thinking changing the stack had nothing to do with it. The number or lines must have been changed or functions repositioned to avoid the above outcome.
So, I guess here is version 1a which includes my moving of onCampaignLoad to top of output:
Not to be too picky or anything (although I am, I guess!) but HTML comments must have spaces next to the dashes. So "<!--" is not an HTML comment lead-in, but "<!-- " is (notice the trailing space). Ditto for "-->" and " -->" (notice the leading space).
Not a big deal I suppose, but your current code would treat "<!---->" as a comment and technically it isn't.
That is pretty picky, hehe. I suppose a comment should have content. I guess I would be accounting for ill-formed comments then, like the one at w3schools in their definition and example of comments.
I'm tempted to make the change because you're right, but I do use <!-----------> as a visual spacer sometimes and the whole point of putting the comment in a hidden tag is because maptool doesn't hide comments or visual spacers. So, that's why during a function that sometimes has output and sometimes doesn't will just post a blank giving away gm activities. So, putting the text string in a hidden maptool tag will just leave the whitespace which is trimmed and doesn't produce output. Well, in most cases with the exception of using execLink where it always outputs at least a blank even with no output when using the "all" parameter and [if:] statements with no false branch specified.
I found something that is potentially a problem. I had the habit of copying the props from another macro when making a new macro not thinking about the "index" prop. Oops. I was wondering why my macros were disappearing. This can also happen if you export from one lib to another lib where one index will overwrite the other. So, I here is my change to fix that:
aliasmask wrote:I made a slight update, which includes the fix above.
Thanks for the update, but I'm getting a very strange error when I try to drag that rptok onto my map: Spoiler
java.lang.InstantiationError: java.util.Map$Entry
at sun.reflect.GeneratedSerializationConstructorAccessor149.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.newInstance(Sun14ReflectionProvider.java:62)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:257)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:124)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:66)
at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:63)
at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:54)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:188)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:117)
at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:29)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:833)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:789)
at net.rptools.lib.io.PackedFile.getContent(PackedFile.java:138)
at net.rptools.lib.io.PackedFile.getContent(PackedFile.java:123)
at net.rptools.maptool.util.PersistenceUtil.loadToken(PersistenceUtil.java:400)
at net.rptools.maptool.client.ui.assetpanel.ImageFileImagePanelModel.getTransferable(ImageFileImagePanelModel.java:98)
at net.rptools.maptool.client.ui.assetpanel.AssetPanel$3.getTransferable(AssetPanel.java:261)
at net.rptools.lib.swing.ImagePanel.dragGestureRecognized(ImagePanel.java:395)
at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(Unknown Source)
at sun.awt.windows.WMouseDragGestureRecognizer.mouseDragged(Unknown Source)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:24)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I'm not doing anything different than I normally would and can deploy the 1.0a rptok just fine the same way.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
aliasmask wrote:I made a slight update, which includes the fix above.
Thanks for the update, but I'm getting a very strange error when I try to drag that rptok onto my map: Spoiler
java.lang.InstantiationError: java.util.Map$Entry
at sun.reflect.GeneratedSerializationConstructorAccessor149.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.newInstance(Sun14ReflectionProvider.java:62)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:257)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:124)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:66)
at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:63)
at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:54)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:188)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:117)
at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:29)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:833)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:789)
at net.rptools.lib.io.PackedFile.getContent(PackedFile.java:138)
at net.rptools.lib.io.PackedFile.getContent(PackedFile.java:123)
at net.rptools.maptool.util.PersistenceUtil.loadToken(PersistenceUtil.java:400)
at net.rptools.maptool.client.ui.assetpanel.ImageFileImagePanelModel.getTransferable(ImageFileImagePanelModel.java:98)
at net.rptools.maptool.client.ui.assetpanel.AssetPanel$3.getTransferable(AssetPanel.java:261)
at net.rptools.lib.swing.ImagePanel.dragGestureRecognized(ImagePanel.java:395)
at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(Unknown Source)
at sun.awt.windows.WMouseDragGestureRecognizer.mouseDragged(Unknown Source)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:24)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I'm not doing anything different than I normally would and can deploy the 1.0a rptok just fine the same way.
That might be because I created it in 1.3b68... I'll export the macros and create it in 1.3b63 after dinner and see how it works for you.
Question: Why does the dumpMacros macro need to use manual string concatenation instead of Wiki: strformat()? I believe that it does, because I've been trying to re-write it using strformat in hopes of it going faster, but that throws errors. I just wondered if someone who knows more about encode/decode can explain why.
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton
Raoden wrote:Question: Why does the dumpMacros macro need to use manual string concatenation instead of Wiki: strformat()? I believe that it does, because I've been trying to re-write it using strformat in hopes of it going faster, but that throws errors. I just wondered if someone who knows more about encode/decode can explain why.
Apparently [if:] doesn't like Wiki: strformat(). I don't know if this is any faster, but it takes about 6-7 seconds to output 2500 lines.
Cool. Also, what's the value of inserting [h:] around comment lines?
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton